74 lines
3.5 KiB
Plaintext
74 lines
3.5 KiB
Plaintext
@page "/reviews"
|
|
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
|
|
|
@inject IDialogService DialogService
|
|
@inject NavigationManager NavigationManager
|
|
@inject ISnackbar Snackbar
|
|
@inject IUserUtility UserUtility
|
|
@inject IRestWrapper RestWrapper
|
|
|
|
<MudStack class="h-full w-full p-8">
|
|
<MudGrid>
|
|
<MudItem xs="12">
|
|
<MudStack Row="true" class="mb-5">
|
|
<MudText Typo="Typo.h4">نظراتـــــــ</MudText>
|
|
<MudSpacer />
|
|
</MudStack>
|
|
<MudPaper>
|
|
<MudDataGrid FixedFooter="true" FixedHeader="true" Striped="true"
|
|
T="CommentSDto" Items="@ViewModel.PageDto" CurrentPage="@ViewModel.CurrentPage"
|
|
RowsPerPage="20" Filterable="false" Loading="@ViewModel.IsProcessing"
|
|
SortMode="@SortMode.None" Groupable="false">
|
|
<Columns>
|
|
<PropertyColumn Title="عنوان" Property="arg => arg.Title" />
|
|
<PropertyColumn Title="نظر" Property="arg => arg.Content" />
|
|
<PropertyColumn Title="نام نظر دهنده" Property="arg => arg.UserFullName" />
|
|
<TemplateColumn Title="تاریخ ثبت">
|
|
<CellTemplate>
|
|
<p>@context.Item.CreatedAt.ToPersianDateTime().ToLongDateString()</p>
|
|
</CellTemplate>
|
|
</TemplateColumn>
|
|
|
|
|
|
<TemplateColumn CellClass="d-flex justify-end">
|
|
<CellTemplate>
|
|
<MudStack Row="true">
|
|
|
|
<MudButton Variant="Variant.Outlined"
|
|
class="@(context.Item.IsConfirmed ? "visible":"hidden")"
|
|
Color="Color.Primary"
|
|
OnClick="@(async()=>await ViewModel.ConfirmAsync(context.Item))">تایید کردن</MudButton>
|
|
<MudIconButton Icon="@Icons.Material.Filled.RemoveRedEye"
|
|
Size="@Size.Small"
|
|
class="px-2"
|
|
Variant="@Variant.Outlined"
|
|
Color="@Color.Info"
|
|
OnClick="@(async()=>await ViewModel.ShowAsync(context.Item))" />
|
|
</MudStack>
|
|
</CellTemplate>
|
|
</TemplateColumn>
|
|
</Columns>
|
|
<PagerContent>
|
|
<MudStack Row="true" class="w-full">
|
|
|
|
<MudPagination Rectangular="true" Variant="Variant.Filled" Count="@ViewModel.PageCount"
|
|
SelectedChanged="@ViewModel.ChangePageAsync" class="mx-auto my-4" />
|
|
</MudStack>
|
|
|
|
</PagerContent>
|
|
</MudDataGrid>
|
|
</MudPaper>
|
|
</MudItem>
|
|
</MudGrid>
|
|
</MudStack>
|
|
|
|
@code
|
|
{
|
|
public ReviewsPageViewModel ViewModel { get; set; }
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
ViewModel = new ReviewsPageViewModel(NavigationManager, Snackbar, UserUtility, RestWrapper, DialogService);
|
|
await ViewModel.InitializeAsync();
|
|
await base.OnInitializedAsync();
|
|
}
|
|
} |