Files
marechai/Marechai/Pages/Admin/Resolutions.razor

115 lines
3.7 KiB
Plaintext
Raw Normal View History

2020-05-30 04:36:31 +01:00
@{
2020-12-20 21:34:13 +00:00
/******************************************************************************
2020-05-30 04:36:31 +01:00
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
}
@page "/admin/resolutions"
@using Marechai.Database.Models
2020-05-30 04:36:31 +01:00
@inherits OwningComponentBase<ResolutionsService>
@inject IStringLocalizer<ResolutionsService> L
2020-12-20 21:34:13 +00:00
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
2020-05-30 04:36:31 +01:00
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Resolutions"]</h3>
2020-12-20 21:34:13 +00:00
@if(_resolutions is null)
2020-05-30 04:36:31 +01:00
{
<p>@L["Loading..."]</p>
return;
}
<p>
<a class="btn btn-primary" href="/admin/resolutions/create">@L["Create new"]</a>
</p>
<table class="table table-striped">
<thead>
<tr>
<th>
@L["Width"]
</th>
<th>
@L["Height"]
</th>
<th>
@L["Colors"]
</th>
<th>
@L["Palette"]
</th>
<th>
@L["Chars"]
</th>
<th>
@L["Grayscale"]
</th>
<th></th>
</tr>
</thead>
<tbody>
2020-12-20 21:34:13 +00:00
@foreach(var item in _resolutions)
2020-05-30 04:36:31 +01:00
{
<tr>
<td>
@item.Width
</td>
<td>
@item.Height
</td>
<td>
@item.Colors
</td>
<td>
@item.Palette
</td>
<td>
@item.Chars
</td>
<td>
@item.Grayscale
</td>
<td>
<a class="btn btn-primary" href="/admin/resolutions/details/@item.Id">@L["Details"]</a>
<a class="btn btn-secondary" href="/admin/resolutions/edit/@item.Id">@L["Edit"]</a>
2020-12-20 21:34:13 +00:00
<Button Clicked="() => {ShowModal(item.Id);}" Color="Color.Danger">@L["Delete"]</Button>
2020-05-30 04:36:31 +01:00
</td>
</tr>
}
</tbody>
</table>
2020-12-20 21:34:13 +00:00
<Modal Closing="@ModalClosing" IsCentered="true" ref="_frmDelete">
<ModalBackdrop />
2020-05-30 04:36:31 +01:00
<ModalContent Centered="true">
<ModalHeader>
<ModalTitle>@L["Delete resolution"]</ModalTitle>
2020-12-20 21:34:13 +00:00
<CloseButton Clicked="@HideModal" />
2020-05-30 04:36:31 +01:00
</ModalHeader>
<ModalBody>
<Text>@string.Format(L["Are you sure you want to delete resolution {0}?"], _resolution)</Text>
</ModalBody>
<ModalFooter>
2020-12-20 21:34:13 +00:00
<Button Clicked="@HideModal" Color="Color.Primary" Disabled="@_deleteInProgress">@L["Cancel"]</Button>
<Button Clicked="@ConfirmDelete" Color="Color.Danger" Disabled="@_deleteInProgress">@L["Delete"]</Button>
2020-05-30 04:36:31 +01:00
</ModalFooter>
</ModalContent>
2020-12-20 21:34:13 +00:00
</Modal>