poem correction history: display user infor for admin

This commit is contained in:
Hamid Reza Mohammadi 2024-12-29 15:39:20 +03:30
parent 012a74fc5d
commit 145ce7993b
2 changed files with 15 additions and 0 deletions

View File

@ -66,6 +66,13 @@ else
<div style="background-color:@color" id="correction-@correction.Id">
<table>
@if(Model.CanEdit)
{
<tr>
<td colspan="2"><a href="/User/Edits?UserId=@correction.UserId" target="_blank">@correction.UserId</a></td>
</tr>
}
<tr>
<td colspan="2"><a href="/?p=@correction.PoemId" target="_blank">مشاهدهٔ متن شعر یا بخش</a></td>
</tr>

View File

@ -19,6 +19,7 @@ namespace GanjooRazor.Areas.User.Pages
[IgnoreAntiforgeryToken(Order = 1001)]
public class PoemCorrectionsHistoryModel : PageModel
{
/// <summary>
/// Last Error
/// </summary>
@ -34,6 +35,11 @@ namespace GanjooRazor.Areas.User.Pages
/// </summary>
public List<GanjoorPoemCorrectionViewModel> Corrections { get; set; }
/// <summary>
/// can edit
/// </summary>
public bool CanEdit { get; set; }
public GanjoorLanguage[] Languages { get; set; }
private async Task ReadLanguagesAsync(HttpClient secureClient)
{
@ -51,6 +57,8 @@ namespace GanjooRazor.Areas.User.Pages
if (string.IsNullOrEmpty(Request.Cookies["Token"]))
return Redirect("/");
CanEdit = Request.Cookies["CanEdit"] == "True";
LastError = "";
using (HttpClient secureClient = new HttpClient())
if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))