docs: #292 adding new poem specfic fields to modify page UI

This commit is contained in:
Hamid Reza Mohammadi 2022-03-11 12:41:45 +03:30
parent 0a2b6fc946
commit f691d8e496
7 changed files with 91 additions and 6 deletions

View File

@ -119,7 +119,7 @@
<input type="checkbox" asp-for="ModifyModel.NoIndex" />
</td>
</tr>
<tr>
<tr>
<td>
<span class="inputlabel">از این نشانی (کامل) هم به این صفحه ری‌دایرکت شود</span>
</td>
@ -127,6 +127,35 @@
<input style="text-align:left;direction:ltr;" asp-for="ModifyModel.RedirectFromFullUrl" />
</td>
</tr>
<tr>
<td>
<span class="inputlabel">منتشر شده (فقط شعر - فعلا استفاده نشده)</span>
</td>
<td>
<input type="checkbox" asp-for="ModifyModel.Published" />
</td>
</tr>
<tr>
<td>
<span class="inputlabel">ترتیب در فهرستها (فقط شعر)</span>
</td>
<td>
<input asp-for="ModifyModel.MixedModeOrder" />
</td>
</tr>
<tr>
<td>
<span class="inputlabel">زبان (فقط شعر و برای کدگذاری صفحه و نه مشخصات لهجه‌ها)</span>
</td>
<td>
<select asp-for="ModifyModel.Language">
<option value ="">فارسی</option>
<option value="azb">ترکی آذری</option>
<option value="ar">عربی</option>
<option value="ckb">کردی</option>
</select>
</td>
</tr>
<tr>
<td>
<span class="inputlabel">توضیح این ویرایش: </span>

View File

@ -134,6 +134,9 @@ namespace GanjooRazor.Areas.Admin.Pages
Rhythm = PageInformation.Poem == null ? null : PageInformation.Poem.GanjoorMetre == null ? null : PageInformation.Poem.GanjoorMetre.Rhythm,
NoIndex = PageInformation.NoIndex,
RedirectFromFullUrl = PageInformation.RedirectFromFullUrl,
Language = PageInformation.Poem.Language,
MixedModeOrder = PageInformation.Poem.MixedModeOrder,
Published = PageInformation.Poem.Published,
};
return true;
}

View File

@ -105,7 +105,7 @@ namespace RMuseum.Models.Ganjoor
public bool Published { get; set; }
/// <summary>
/// language
/// language (this is intended to affect html page encodings and not determine actuallly accents and ....)
/// </summary>
public string Language { get; set; }
}

View File

@ -41,7 +41,7 @@
public int? CoupletIndex { get; set; }
/// <summary>
/// language
/// language (this is intended to affect html page encodings and not determine actuallly accents and ....), so it is unusable for verses I guess
/// </summary>
public string Language { get; set; }

View File

@ -60,6 +60,21 @@
/// </summary>
public string RedirectFromFullUrl { get; set; }
/// <summary>
/// order when mixed with categories
/// </summary>
public int MixedModeOrder { get; set; }
/// <summary>
/// published
/// </summary>
public bool Published { get; set; }
/// <summary>
/// language (this is intended to affect html page encodings and not determine actuallly accents and ....)
/// </summary>
public string Language { get; set; }
/// <summary>
/// a description of the modfication
/// </summary>

View File

@ -6463,7 +6463,7 @@
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoem.Language">
<summary>
language
language (this is intended to affect html page encodings and not determine actuallly accents and ....)
</summary>
</member>
<member name="T:RMuseum.Models.Ganjoor.GanjoorPoemCorrection">
@ -7030,7 +7030,7 @@
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorVerse.Language">
<summary>
language
language (this is intended to affect html page encodings and not determine actuallly accents and ....), so it is unusable for verses I guess
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorVerseNumber.Id">
@ -7763,6 +7763,21 @@
if a page url is changed, store the old URL here to be redirected automatically
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorModifyPageViewModel.MixedModeOrder">
<summary>
order when mixed with categories
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorModifyPageViewModel.Published">
<summary>
published
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorModifyPageViewModel.Language">
<summary>
language (this is intended to affect html page encodings and not determine actuallly accents and ....)
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorModifyPageViewModel.Note">
<summary>
a description of the modfication

View File

@ -1944,6 +1944,7 @@ namespace RMuseum.Services.Implementation
return new RServiceResult<GanjoorPoemCorrectionViewModel>(null);
var dbPoem = await _context.GanjoorPoems.Include(p => p.GanjoorMetre).Where(p => p.Id == moderation.PoemId).SingleOrDefaultAsync();
var dbPage = await _context.GanjoorPages.AsNoTracking().Where(p => p.Id == moderation.PoemId).SingleOrDefaultAsync();
GanjoorModifyPageViewModel pageViewModel = new GanjoorModifyPageViewModel()
{
@ -1956,6 +1957,11 @@ namespace RMuseum.Services.Implementation
HtmlText = dbPoem.HtmlText,
SourceName = dbPoem.SourceName,
SourceUrlSlug = dbPoem.SourceUrlSlug,
MixedModeOrder = dbPoem.MixedModeOrder,
Published = dbPoem.Published,
Language = dbPoem.Language,
NoIndex = dbPage.NoIndex,
RedirectFromFullUrl = dbPage.RedirectFromFullUrl,
Note = dbCorrection.Note
};
@ -2049,6 +2055,7 @@ namespace RMuseum.Services.Implementation
try
{
var dbMainPoem = await _context.GanjoorPoems.Include(p => p.GanjoorMetre).Where(p => p.Id == poemId).SingleOrDefaultAsync();
var dbPage = await _context.GanjoorPages.AsNoTracking().Where(p => p.Id == poemId).SingleOrDefaultAsync();
GanjoorModifyPageViewModel pageViewModel = new GanjoorModifyPageViewModel()
{
@ -2061,6 +2068,11 @@ namespace RMuseum.Services.Implementation
HtmlText = dbMainPoem.HtmlText,
SourceName = dbMainPoem.SourceName,
SourceUrlSlug = dbMainPoem.SourceUrlSlug,
RedirectFromFullUrl = dbPage.RedirectFromFullUrl,
NoIndex = dbPage.NoIndex,
Language = dbMainPoem.Language,
MixedModeOrder = dbMainPoem.MixedModeOrder,
Published = dbMainPoem.Published,
Note = "گام اول شکستن شعر به اشعار مجزا"
};
@ -2102,7 +2114,9 @@ namespace RMuseum.Services.Implementation
GanjoorMetreId = poem.GanjoorMetre == null ? null : poem.GanjoorMetre.Id,
SourceName = poem.SourceName,
SourceUrlSlug = poem.SourceUrlSlug,
Published = true,
Language = dbMainPoem.Language,
MixedModeOrder = dbMainPoem.MixedModeOrder,
Published = dbMainPoem.Published,
};
@ -2168,6 +2182,11 @@ namespace RMuseum.Services.Implementation
HtmlText = dbMainPoem.HtmlText,
SourceName = dbMainPoem.SourceName,
SourceUrlSlug = dbMainPoem.SourceUrlSlug,
RedirectFromFullUrl = dbPage.RedirectFromFullUrl,
NoIndex = dbPage.NoIndex,
Language = dbMainPoem.Language,
MixedModeOrder = dbMainPoem.MixedModeOrder,
Published = dbMainPoem.Published,
Note = "گام نهایی شکستن شعر به اشعار مجزا"
};
@ -2765,6 +2784,10 @@ namespace RMuseum.Services.Implementation
dbPoem.RhymeLetters = pageData.RhymeLetters;
dbPoem.OldTag = pageData.OldTag;
dbPoem.OldTagPageUrl = pageData.OldTagPageUrl;
dbPoem.MixedModeOrder = pageData.MixedModeOrder;
dbPoem.Language = pageData.Language;
dbPoem.Published = pageData.Published;
dbPoem.HtmlText = pageData.HtmlText;
dbPoem.Title = pageData.Title;