#478 user contributions in his or her profile

This commit is contained in:
Hamid Reza Mohammadi 2025-03-28 15:14:05 +03:30
parent 3a721c8dbf
commit 8d43c3cb2a
2 changed files with 53 additions and 0 deletions

View File

@ -145,6 +145,47 @@
{
@Html.Raw(Model.Profile.Bio)
}
@if (
Model.Contributions.PoemCorrections > 0
||
Model.Contributions.SectionCorrections > 0
||
Model.Contributions.CatCorrections > 0
||
Model.Contributions.SuggestedSongs > 0
||
Model.Contributions.QuotedPoems > 0
||
Model.Contributions.Comments > 0
||
Model.Contributions.Recitations > 0
||
Model.Contributions.MuseumLinks > 0
||
Model.Contributions.PinterestLinks > 0
||
Model.Contributions.PoetSpecLines > 0
||
Model.Contributions.PoetPictures > 0
)
{
<table>
<tr>
<th colspan="2">
<span class="align-center">آمار مشارکت‌ها:</span>
</th>
</tr>
@if(Model.Contributions.PoemCorrections > 0)
{
<tr>
<td><p>ویرایش‌های تأیید شده:</p></td>
<td><p>@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Contributions.PoemCorrections)</p></td>
</tr>
}
</table>
}
</div>
<hr />
}

View File

@ -142,6 +142,8 @@ namespace GanjooRazor.Pages
public GanjoorUserPublicProfile Profile { get; set; }
public UserContributionsViewModel Contributions { get; set; }
public string Title { get; set; }
public string HomeLink { get; set; }
@ -200,6 +202,16 @@ namespace GanjooRazor.Pages
Profile = JsonConvert.DeserializeObject<GanjoorUserPublicProfile>(await responseUserProfile.Content.ReadAsStringAsync());
var responseContributions = await _httpClient.GetAsync($"{APIRoot.Url}/api/contributions/{filterUserId}");
if (!responseContributions.IsSuccessStatusCode)
{
LastError = JsonConvert.DeserializeObject<string>(await responseContributions.Content.ReadAsStringAsync());
return Page();
}
Contributions = JsonConvert.DeserializeObject<UserContributionsViewModel>(await responseContributions.Content.ReadAsStringAsync());
ViewData["Title"] = $"گنجور » حاشیه‌گذاری‌های {Profile.NickName}";
Title = $"حاشیه‌گذاری‌های {Profile.NickName}";