diff --git a/GanjooRazor/Areas/User/Pages/Edits.cshtml.cs b/GanjooRazor/Areas/User/Pages/Edits.cshtml.cs
index a9339eb1..eb1c1465 100644
--- a/GanjooRazor/Areas/User/Pages/Edits.cshtml.cs
+++ b/GanjooRazor/Areas/User/Pages/Edits.cshtml.cs
@@ -53,11 +53,11 @@ namespace GanjooRazor.Areas.User.Pages
{
{
int pageNumber = 1;
- string url = $"{APIRoot.Url}/api/ganjoor/corrections/mine?PageNumber={pageNumber}&PageSize=20";
if (!string.IsNullOrEmpty(Request.Query["page"]))
{
pageNumber = int.Parse(Request.Query["page"]);
}
+ string url = $"{APIRoot.Url}/api/ganjoor/corrections/mine?PageNumber={pageNumber}&PageSize=20";
if (CanEdit)
{
AllUsersEdits = Request.Query["AllUsers"] == "1";
diff --git a/GanjooRazor/Areas/User/Pages/SectionEdits.cshtml b/GanjooRazor/Areas/User/Pages/SectionEdits.cshtml
new file mode 100644
index 00000000..be269830
--- /dev/null
+++ b/GanjooRazor/Areas/User/Pages/SectionEdits.cshtml
@@ -0,0 +1,189 @@
+@page
+@model GanjooRazor.Areas.User.Pages.SectionEditsModel
+@using RMuseum.Models.Ganjoor
+@using RMuseum.Services.Implementation
+@{
+ Layout = "_UserPanelLayout";
+ ViewData["Title"] = "ویرایشهای قطعات من";
+ await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
+ string color = "gray";
+}
+
@ViewData["Title"]
+@if (Model.LastError != "")
+{
+ @Model.LastError
+}
+else
+{
+
+ if (@Model.CanEdit)
+ {
+
+ }
+
+ @if (Model.Corrections.Count == 0)
+ {
+
+ شما هنوز هیچ ویرایشی در گنجور انجام ندادهاید. برای آشنایی با نحوهٔ ویرایش اشعار اینجا را ببینید.
+
+ }
+
+
+
+ @foreach (var paginationLink in Model.PaginationLinks)
+ {
+ if (!string.IsNullOrEmpty(paginationLink.Url))
+ {
+ @paginationLink.Name
+ }
+ else
+ {
+ @paginationLink.Name
+ }
+ }
+
+
+ @foreach (var correction in Model.Corrections)
+ {
+ if (color == "gray")
+ color = "white";
+ else
+ color = "gray";
+
+
+
+
+ | مشاهدهٔ متن شعر یا بخش |
+
+
+ @if (Model.AllUsersEdits)
+ {
+
+ | @correction.UserNickname |
+
+ }
+
+
+ | متن اولیه |
+ تغییرات من |
+ نتیجهٔ بررسی |
+
+
+ @if (correction.Rhythm != null)
+ {
+
+ |
+ @correction.OriginalRhythm
+ |
+
+ @correction.Rhythm
+ |
+
+ @if (correction.RhythmResult == CorrectionReviewResult.Approved)
+ {
+ @CorrectionReviewResultConvertor.GetString(correction.RhythmResult)
+ }
+ else
+ @if (correction.RhythmResult == CorrectionReviewResult.Approved)
+ {
+ @CorrectionReviewResultConvertor.GetString(correction.RhythmResult)
+ }
+ else
+ {
+ @CorrectionReviewResultConvertor.GetString(correction.RhythmResult)
+ }
+ |
+
+ @if (!string.IsNullOrEmpty(correction.ReviewNote))
+ {
+
+ |
+ @correction.ReviewNote
+ |
+
+ }
+ }
+
+ @if (
+ correction.BreakFromVerse1VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse2VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse3VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse4VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse5VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse6VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse7VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse8VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse9VOrderResult == CorrectionReviewResult.Approved
+ ||
+ correction.BreakFromVerse10VOrderResult == CorrectionReviewResult.Approved
+ )
+ {
+
+ |
+ پیشنهاد شما برای شکستن قطعه تأیید شده است.
+ |
+
+ }
+
+ @if (!string.IsNullOrEmpty(correction.Note))
+ {
+
+ | یادداشت: |
+
+ @correction.Note
+ |
+
+ }
+
+
+ |
+ @if (correction.Reviewed)
+ {
+ ویرایش مجدد
+ }
+ else
+ {
+ مشاهده
+ }
+ |
+
+
+
+
+
+
+
+
+ }
+
+
+ @foreach (var paginationLink in Model.PaginationLinks)
+ {
+ if (!string.IsNullOrEmpty(paginationLink.Url))
+ {
+ @paginationLink.Name
+ }
+ else
+ {
+ @paginationLink.Name
+ }
+ }
+
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/GanjooRazor/Areas/User/Pages/SectionEdits.cshtml.cs b/GanjooRazor/Areas/User/Pages/SectionEdits.cshtml.cs
new file mode 100644
index 00000000..ddae66e4
--- /dev/null
+++ b/GanjooRazor/Areas/User/Pages/SectionEdits.cshtml.cs
@@ -0,0 +1,158 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Threading.Tasks;
+using DNTPersianUtils.Core;
+using GanjooRazor.Utils;
+using GSpotifyProxy.Models;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using RMuseum.Models.Ganjoor.ViewModels;
+using RSecurityBackend.Models.Generic;
+
+
+namespace GanjooRazor.Areas.User.Pages
+{
+ [IgnoreAntiforgeryToken(Order = 1001)]
+ public class SectionEditsModel : PageModel
+ { ///
+ /// Last Error
+ ///
+ public string LastError { get; set; }
+
+ ///
+ /// pagination links
+ ///
+ public List PaginationLinks { get; set; }
+
+ ///
+ /// can edit
+ ///
+ public bool CanEdit { get; set; }
+
+ ///
+ /// all users edits
+ ///
+ public bool AllUsersEdits { get; set; }
+
+ ///
+ /// Corrections
+ ///
+ public List Corrections { get; set; }
+ public async Task OnGetAsync()
+ {
+ if (string.IsNullOrEmpty(Request.Cookies["Token"]))
+ return Redirect("/");
+ CanEdit = Request.Cookies["CanEdit"] == "True";
+ AllUsersEdits = false;
+ LastError = "";
+ using (HttpClient secureClient = new HttpClient())
+ if (await GanjoorSessionChecker.PrepareClient(secureClient, Request, Response))
+ {
+ {
+ int pageNumber = 1;
+ if (!string.IsNullOrEmpty(Request.Query["page"]))
+ {
+ pageNumber = int.Parse(Request.Query["page"]);
+ }
+ string url = $"{APIRoot.Url}/api/ganjoor/section/corrections/mine?PageNumber={pageNumber}&PageSize=20";
+
+ if (CanEdit)
+ {
+ AllUsersEdits = Request.Query["AllUsers"] == "1";
+ if (AllUsersEdits)
+ {
+ url = $"{APIRoot.Url}/api/ganjoor/section/corrections/all?PageNumber={pageNumber}&PageSize=20";
+ }
+ }
+ var response = await secureClient.GetAsync(url);
+ if (!response.IsSuccessStatusCode)
+ {
+ LastError = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync());
+ return Page();
+ }
+
+ Corrections = JArray.Parse(await response.Content.ReadAsStringAsync()).ToObject>();
+
+ string paginnationMetadata = response.Headers.GetValues("paging-headers").FirstOrDefault();
+ if (!string.IsNullOrEmpty(paginnationMetadata))
+ {
+ PaginationMetadata paginationMetadata = JsonConvert.DeserializeObject(paginnationMetadata);
+ PaginationLinks = new List();
+ if (paginationMetadata.totalPages > 1)
+ {
+ if (paginationMetadata.currentPage > 3)
+ {
+ PaginationLinks.Add
+ (
+ new NameIdUrlImage()
+ {
+ Name = "صفحهٔ اول",
+ Url = AllUsersEdits ? "/User/SectionEdits/?page=1&AllUsers=1" : "/User/SectionEdits/?page=1"
+ }
+ );
+ }
+ for (int i = (paginationMetadata.currentPage - 2); i <= (paginationMetadata.currentPage + 2); i++)
+ {
+ if (i >= 1 && i <= paginationMetadata.totalPages)
+ {
+ if (i == paginationMetadata.currentPage)
+ {
+
+ PaginationLinks.Add
+ (
+ new NameIdUrlImage()
+ {
+ Name = i.ToPersianNumbers(),
+ }
+ );
+ }
+ else
+ {
+
+ PaginationLinks.Add
+ (
+ new NameIdUrlImage()
+ {
+ Name = i.ToPersianNumbers(),
+ Url = AllUsersEdits ? $"/User/SectionEdits/?page={i}&AllUsers=1" : $"/User/SectionEdits/?page={i}"
+ }
+ );
+ }
+ }
+ }
+ if (paginationMetadata.totalPages > (paginationMetadata.currentPage + 2))
+ {
+
+ PaginationLinks.Add
+ (
+ new NameIdUrlImage()
+ {
+ Name = "... ",
+ }
+ );
+
+ PaginationLinks.Add
+ (
+ new NameIdUrlImage()
+ {
+ Name = "صفحهٔ آخر",
+ Url = AllUsersEdits ? $"/User/SectionEdits/?page={paginationMetadata.totalPages}&AllUsers=1" : $"/User/SectionEdits/?page={paginationMetadata.totalPages}"
+ }
+ );
+ }
+ }
+ }
+
+ }
+ }
+ else
+ {
+ LastError = "لطفا از گنجور خارج و مجددا به آن وارد شوید.";
+ }
+ return Page();
+ }
+ }
+}
diff --git a/GanjooRazor/GanjooRazor.csproj b/GanjooRazor/GanjooRazor.csproj
index 5e689cfb..2179e6bb 100644
--- a/GanjooRazor/GanjooRazor.csproj
+++ b/GanjooRazor/GanjooRazor.csproj
@@ -22,4 +22,16 @@
+
+
+
+
+
+ <_ContentIncludedByDefault Remove="Areas\User\Pages\SectionEdits.cshtml" />
+
+
+
+
+
+
diff --git a/GanjooRazor/Pages/Shared/_UserPanelLayout.cshtml b/GanjooRazor/Pages/Shared/_UserPanelLayout.cshtml
index 43b00db3..a3cdb0eb 100644
--- a/GanjooRazor/Pages/Shared/_UserPanelLayout.cshtml
+++ b/GanjooRazor/Pages/Shared/_UserPanelLayout.cshtml
@@ -17,17 +17,17 @@
@@ -60,10 +60,6 @@
اعلانهای من
-
- ویرایشهای من
-
-
خوانشهای نشان شده
@@ -76,6 +72,14 @@
آهنگهای پیشنهادی من
+
+ ویرایشهای من
+
+
+
+ ویرایشهای قطعات من
+
+
@if (ViewData.ContainsKey("ganjoor-songrevu"))
{
diff --git a/RMuseum/Models/Ganjoor/ViewModels/GanjoorPoemSectionCorrectionViewModel.cs b/RMuseum/Models/Ganjoor/ViewModels/GanjoorPoemSectionCorrectionViewModel.cs
index fb708491..b830380c 100644
--- a/RMuseum/Models/Ganjoor/ViewModels/GanjoorPoemSectionCorrectionViewModel.cs
+++ b/RMuseum/Models/Ganjoor/ViewModels/GanjoorPoemSectionCorrectionViewModel.cs
@@ -184,5 +184,15 @@ namespace RMuseum.Models.Ganjoor.ViewModels
/// review note
///
public string ReviewNote { get; set; }
+
+ ///
+ /// poem Id
+ ///
+ public int PoemId { get; set; }
+
+ ///
+ /// poem Id
+ ///
+ public int SectionIndex { get; set; }
}
}
diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml
index 533cb904..2b40258d 100644
--- a/RMuseum/RMuseum.xml
+++ b/RMuseum/RMuseum.xml
@@ -9338,6 +9338,16 @@
review note
+
+
+ poem Id
+
+
+
+
+ poem Id
+
+
poem summary
diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs
index 05c1bd67..a7109d56 100644
--- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs
+++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateSectionCorrection.cs
@@ -268,7 +268,7 @@ namespace RMuseum.Services.Implementation
await _notificationService.PushNotification(dbCorrection.UserId,
"بررسی ویرایش پیشنهادی شما",
$"با سپاس از زحمت و همت شما ویرایش پیشنهادیتان برای {dbPoem.FullTitle} بررسی شد.{Environment.NewLine}" +
- $"جهت مشاهدهٔ نتیجهٔ بررسی در میز کاربری خود بخش «ویرایشهای من» را مشاهده بفرمایید.{Environment.NewLine}"
+ $"جهت مشاهدهٔ نتیجهٔ بررسی در میز کاربری خود بخش «ویرایشهای قطعات من» را مشاهده بفرمایید.{Environment.NewLine}"
);
foreach (var section in sections)
@@ -564,6 +564,7 @@ namespace RMuseum.Services.Implementation
List list = new List();
foreach (var dbCorrection in dbPaginatedResult.Items)
{
+ var section = await _context.GanjoorPoemSections.AsNoTracking().Where(s => s.Id == dbCorrection.SectionId).SingleOrDefaultAsync();
list.Add
(
new GanjoorPoemSectionCorrectionViewModel()
@@ -602,7 +603,9 @@ namespace RMuseum.Services.Implementation
Reviewed = dbCorrection.Reviewed,
ReviewNote = dbCorrection.ReviewNote,
ReviewDate = dbCorrection.ReviewDate,
- UserNickname = string.IsNullOrEmpty(dbCorrection.User.NickName) ? dbCorrection.User.Id.ToString() : dbCorrection.User.NickName
+ UserNickname = string.IsNullOrEmpty(dbCorrection.User.NickName) ? dbCorrection.User.Id.ToString() : dbCorrection.User.NickName,
+ PoemId = section == null ? 0 : section.PoemId,
+ SectionIndex = section == null ? 0 : section.Index,
}
);
}