#478 conribs page
This commit is contained in:
parent
d83510fe3e
commit
8c913d1794
@ -25,6 +25,26 @@
|
||||
cookieValue = getCookie("stickyEnabled");
|
||||
var stickyEnabled = cookieValue != "false";
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.stats-section {
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin-bottom: 30px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@ -145,22 +145,22 @@ namespace GanjooRazor.Pages
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await responseDays.Content.ReadAsStringAsync()));
|
||||
}
|
||||
var days = JArray.Parse(await responseDays.Content.ReadAsStringAsync()).ToObject<List<GroupedByDateViewModel>>();
|
||||
if (days == null)
|
||||
{
|
||||
return new BadRequestObjectResult("خطا در دسترسی به آمار روزانه");
|
||||
}
|
||||
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/contributions/{dataType}/by/user?PageNumber=1&PageSize=30");
|
||||
var responseUsers = await _httpClient.GetAsync($"{APIRoot.Url}/api/contributions/{dataType}/by/user?PageNumber=1&PageSize=30");
|
||||
|
||||
if (!responseUsers.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await responseUsers.Content.ReadAsStringAsync()));
|
||||
}
|
||||
List<GroupedByUserViewModel> users = dataType == "users" ? null : JArray.Parse(await responseUsers.Content.ReadAsStringAsync()).ToObject<List<GroupedByUserViewModel>>();
|
||||
|
||||
var response = await _httpClient.GetAsync($"{APIRoot.Url}/api/contributions/{dataType}/summary");
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
return new BadRequestObjectResult(JsonConvert.DeserializeObject<string>(await response.Content.ReadAsStringAsync()));
|
||||
}
|
||||
var users = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject<List<GroupedByUserViewModel>>();
|
||||
if (users == null)
|
||||
{
|
||||
return new BadRequestObjectResult("خطا در دسترسی به آمار کاربران");
|
||||
}
|
||||
SummedUpViewModel summary = JsonConvert.DeserializeObject<SummedUpViewModel>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
return new PartialViewResult()
|
||||
{
|
||||
@ -171,6 +171,7 @@ namespace GanjooRazor.Pages
|
||||
{
|
||||
Days = days.ToArray(),
|
||||
Users = users.ToArray(),
|
||||
Summary = summary
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,4 +1,28 @@
|
||||
@model GanjooRazor.Pages._GroupedByDateViewPartialModel
|
||||
@{
|
||||
}
|
||||
@if (Model.Summary != null)
|
||||
{
|
||||
<div class="stats-section">
|
||||
@if (Model.Summary.Days != -1)
|
||||
{
|
||||
<div class="stat-item">
|
||||
<div class="stat-value" id="totalDays">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Summary.Days)</div>
|
||||
<div class="stat-label">روز فعالیت</div>
|
||||
</div>
|
||||
}
|
||||
<div class="stat-item">
|
||||
<div class="stat-value" id="totalCorrections">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Summary.TotalCount)</div>
|
||||
<div class="stat-label">تعداد کل ویرایشها</div>
|
||||
</div>
|
||||
@if (Model.Summary.UserIds != -1)
|
||||
{
|
||||
<div class="stat-item">
|
||||
<div class="stat-value" id="totalUsers">@RMuseum.Services.Implementation.LanguageUtils.FormatMoney(Model.Summary.UserIds)</div>
|
||||
<div class="stat-label">کاربران مشارکت کننده</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<partial name="_GroupedByDateViewTablePartial" model="Model.TableModel">
|
||||
|
||||
@ -9,6 +9,8 @@ namespace GanjooRazor.Pages
|
||||
|
||||
public GroupedByUserViewModel[] Users { get; set; }
|
||||
|
||||
public SummedUpViewModel Summary { get; set; }
|
||||
|
||||
public _GroupedByDateViewTablePartialModel TableModel
|
||||
{
|
||||
get
|
||||
|
||||
Loading…
Reference in New Issue
Block a user