Skip to content

Commit

Permalink
Many improvements to generic repository. Added MudBlazor helper project.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix-CodingClimber committed Jan 26, 2024
1 parent b35f4ca commit 1ba8335
Show file tree
Hide file tree
Showing 43 changed files with 1,361 additions and 337 deletions.
16 changes: 11 additions & 5 deletions DotNetElements.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetElements.Core", "src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetElements.Core.Test", "test\DotNetElements.Core.Test\DotNetElements.Core.Test.csproj", "{9BA47821-EBE3-4290-877B-FE75340AE33E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetElements.AspNetCore", "src\DotNetElements.AspNetCore\DotNetElements.AspNetCore.csproj", "{83C7E815-7B9F-42A3-AA58-703234B6A4DB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetElements.Web.MudBlazor", "src\DotNetElements.Web.MudBlazor\DotNetElements.Web.MudBlazor.csproj", "{E2696A69-29A1-470C-8639-421BFBB498A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetElements.Web.AspNetCore", "src\DotNetElements.Web.AspNetCore\DotNetElements.Web.AspNetCore.csproj", "{8097E610-C806-44A2-B367-9F7EA4888BEA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -29,10 +31,14 @@ Global
{9BA47821-EBE3-4290-877B-FE75340AE33E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BA47821-EBE3-4290-877B-FE75340AE33E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BA47821-EBE3-4290-877B-FE75340AE33E}.Release|Any CPU.Build.0 = Release|Any CPU
{83C7E815-7B9F-42A3-AA58-703234B6A4DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83C7E815-7B9F-42A3-AA58-703234B6A4DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83C7E815-7B9F-42A3-AA58-703234B6A4DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83C7E815-7B9F-42A3-AA58-703234B6A4DB}.Release|Any CPU.Build.0 = Release|Any CPU
{E2696A69-29A1-470C-8639-421BFBB498A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2696A69-29A1-470C-8639-421BFBB498A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2696A69-29A1-470C-8639-421BFBB498A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2696A69-29A1-470C-8639-421BFBB498A4}.Release|Any CPU.Build.0 = Release|Any CPU
{8097E610-C806-44A2-B367-9F7EA4888BEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8097E610-C806-44A2-B367-9F7EA4888BEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8097E610-C806-44A2-B367-9F7EA4888BEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8097E610-C806-44A2-B367-9F7EA4888BEA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@inherits CrudEditDialog<TagModel, EditTagModel>

@using DotNetElements.Web.MudBlazor
@using DotNetElements.CrudExample.Modules.TagModule

@code {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@* @inherits CrudTable<Guid, TagModel, AuditedModelDetails, EditTagModel, TagDialog>
@using DotNetElements.Web.MudBlazor
@using DotNetElements.CrudExample.Modules.TagModule
<MudSimpleTable Style="overflow-x: auto;">
<thead>
<tr>
<th>Label</th>
<th style="width: 140px;">Actions</th>
</tr>
</thead>
<tbody>
@foreach (ModelWithDetails<TagModel, AuditedModelDetails> context in TableEntries)
{
<tr>
<td>@context.Value.Label</td>
<td class="py-0 pl-2" style="width: 140px;">
<MudIconButton OnClick="() => OnEditEntry(context)" Class="pa-1" Icon="@Icons.Material.Outlined.Edit" Color="Color.Warning" />
<MudIconButton OnClick="() => OnDeleteEntry(context, context.Value.Label)" Class="pa-1" Icon="@Icons.Material.Outlined.Delete" Color="Color.Error" />
<MudIconButton OnClick="() => OnShowEntryDetails(context)" Class="pa-1" Icon="@Icons.Material.Outlined.Info" Color="Color.Default" />
</td>
</tr>
@if (context.DetailsShown && context.Details is not null)
{
<tr>
<td colspan="100">
<MudGrid Spacing="2">
<MudItem xs="12">
<MudStack Spacing="1">
<MudText Typo="Typo.caption"><b>ID</b></MudText>
<MudText Typo="Typo.caption">@context.Value.Id</MudText>
</MudStack>
</MudItem>
<MudItem xs="4">
<MudStack Spacing="1">
<MudText Typo="Typo.caption"><b>Creation Time</b></MudText>
<MudText Typo="Typo.caption">@context.Details.CreationTime</MudText>
</MudStack>
</MudItem>
<MudItem xs="4">
<MudStack Spacing="1">
<MudText Typo="Typo.caption"><b>Last Modification Time</b></MudText>
<MudText Typo="Typo.caption">@context.Details.LastModificationTime</MudText>
</MudStack>
</MudItem>
</MudGrid>
</td>
</tr>
}
}
</tbody>
</MudSimpleTable>
@code
{
protected override CrudTableOptions OnConfiguring()
{
return new CrudTableOptions("api/tags");
}
} *@
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<MudNavMenu>
<MudNavLink Icon="@Icons.Material.Outlined.Home" Href="/" Match="NavLinkMatch.All">Home</MudNavLink>
<MudNavLink Icon="@Icons.Material.Outlined.TableView" Href="/crud" Match="NavLinkMatch.Prefix">CRUD</MudNavLink>
@* <MudNavLink Icon="@Icons.Material.Outlined.TableView" Href="/genericCrud" Match="NavLinkMatch.Prefix">Generic CRUD</MudNavLink> *@
</MudNavMenu>

Loading

0 comments on commit 1ba8335

Please sign in to comment.