modified all admin UIs to position action buttons on the left side of grids and implemented ActionDialog throughout rather than dedicated delete components

This commit is contained in:
Shaun Walker
2019-11-04 23:29:35 -05:00
parent 156f5b5f94
commit ab564f7244
32 changed files with 737 additions and 732 deletions

View File

@ -10,24 +10,24 @@
}
else
{
<ActionLink Action="Add" Text="Install Theme" Style="float: right; margin: 10px;" />
<ActionLink Action="Add" Text="Install Theme" />
<Pager Items="@themes">
<Header>
<th>&nbsp;</th>
<th>Name</th>
<th>Version</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</Header>
<Row>
<td>@context.Name</td>
<td>@context.Version</td>
<td>
@if (context.AssemblyName != "Oqtane.Client")
{
<button type="button" class="btn btn-danger" @onclick=@(async () => await DeleteTheme(context.ThemeName))>Delete</button>
<ActionDialog Header="Delete Theme" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Theme?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTheme(context))" />
}
</td>
<td>@context.Name</td>
<td>@context.Version</td>
<td>
@if (UpgradeAvailable(context.ThemeName, context.Version))
{
@ -64,13 +64,15 @@ else
private async Task DownloadTheme(string themename, string version)
{
await PackageService.DownloadPackageAsync(themename, version, "Themes");
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", themename, version);
await ThemeService.InstallThemesAsync();
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
}
private async Task DeleteTheme(string themename)
private async Task DeleteTheme(Theme Theme)
{
await ThemeService.DeleteThemeAsync(themename);
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
await logger.LogInformation("Theme Deleted {Theme}", Theme);
NavigationManager.NavigateTo(NavigateUrl(Reload.Application));
}
}