-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
176 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/DragonFly.BlockField.Razor/Pages/Blocks/AlertBlockView.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@inherits BlockComponent<AlertBlock> | ||
|
||
<div class="alert-block"> | ||
<div class="mb-1"> | ||
<EnumView TEnum="AlertType" @bind-EnumValue="@Block.AlertType" /> | ||
</div> | ||
<BlocksView Blocks="Block.Blocks" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) usercode | ||
// https://github.com/usercode/DragonFly | ||
// MIT License | ||
|
||
namespace DragonFly.BlockField; | ||
|
||
/// <summary> | ||
/// AlertBlock | ||
/// </summary> | ||
public class AlertBlock : Block, IChildBlocks | ||
{ | ||
public AlertBlock() | ||
{ | ||
AlertType = AlertType.Info; | ||
Blocks = new List<Block>(); | ||
} | ||
|
||
public override string CssIcon => "fa-solid fa-circle-info"; | ||
|
||
public IList<Block> Blocks { get; set; } | ||
|
||
public AlertType AlertType { get; set; } | ||
|
||
public IEnumerable<Block> GetBlocks() | ||
{ | ||
return Blocks; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) usercode | ||
// https://github.com/usercode/DragonFly | ||
// MIT License | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace DragonFly.BlockField; | ||
|
||
public enum AlertType | ||
{ | ||
Primary, | ||
Secondary, | ||
Success, | ||
Info, | ||
Warning, | ||
Danger, | ||
Light, | ||
Dark | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) usercode | ||
// https://github.com/usercode/DragonFly | ||
// MIT License | ||
|
||
using DragonFly.BlockField; | ||
|
||
namespace DragonFly.AspNetCore; | ||
|
||
public static class AlertTypeExtensions | ||
{ | ||
public static string ToBootstrapCssClass(this AlertType alertType) | ||
{ | ||
return alertType switch | ||
{ | ||
AlertType.Primary => "alert-primary", | ||
AlertType.Secondary => "alert alert-secondary", | ||
AlertType.Success => "alert-success", | ||
AlertType.Danger => "alert-danger", | ||
AlertType.Warning => "alert-warning", | ||
AlertType.Info => "alert-info", | ||
AlertType.Light => "alert-light", | ||
AlertType.Dark => "alert-dark", | ||
_ => string.Empty | ||
}; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/DragonFlyTemplate/Pages/DisplayTemplates/AlertBlock.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@model AlertBlock | ||
|
||
@if (Model.Blocks.Any()) | ||
{ | ||
<div class="block alert-block"> | ||
<div class="alert @Model.AlertType.ToBootstrapCssClass()"> | ||
@Html.DisplayFor(m => Model.Blocks) | ||
</div> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/DragonFlyTemplate/Pages/DisplayTemplates/ContainerBlock.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
@model ContainerBlock | ||
|
||
@if(Model.Blocks.Any()) | ||
@if (Model.Blocks.Any()) | ||
{ | ||
<div class="block container-block"> | ||
@Html.DisplayFor(m => Model.Blocks) | ||
@Html.DisplayFor(m => Model.Blocks) | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/DragonFlyTemplate/Pages/DisplayTemplates/QuoteBlock.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/DragonFlyTemplate/Pages/DisplayTemplates/SlideshowBlock.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@model SlideshowBlock | ||
|
||
@if (Model.Blocks.Any()) | ||
{ | ||
<div class="block slideshow-block"> | ||
<div class="carousel slide" data-bs-ride="carousel"> | ||
<div class="carousel-inner"> | ||
@for (int i = 0; i < Model.Blocks.Count; i++) | ||
{ | ||
<div class="carousel-item @(i == 0 ? "active" : "")" data-bs-interval="1000000"> | ||
@Html.DisplayFor(m => Model.Blocks[i], Model.Blocks[i].Type) | ||
</div> | ||
} | ||
</div> | ||
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev"> | ||
<span class="carousel-control-prev-icon" aria-hidden="true"></span> | ||
<span class="visually-hidden">Previous</span> | ||
</button> | ||
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next"> | ||
<span class="carousel-control-next-icon" aria-hidden="true"></span> | ||
<span class="visually-hidden">Next</span> | ||
</button> | ||
|
||
</div> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/DragonFlyTemplate/Pages/DisplayTemplates/UnknownBlock.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -176,3 +176,6 @@ body > header { | |
font-size: 1.25rem; | ||
} | ||
|
||
.carousel-item { | ||
height: 200px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
.block { | ||
margin-bottom: 1rem; | ||
margin-bottom: 2rem; | ||
|
||
&:last-child { | ||
margin-bottom: 0px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.