unfound meters
This commit is contained in:
parent
6fcc5b7ffb
commit
8e1031259c
@ -27,9 +27,6 @@ else
|
||||
<a role="button" href="/Admin/ReviewPartEdits" class="pagebutton">پیشنهادهای عادی</a>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.FatalError))
|
||||
{
|
||||
<p>@Model.FatalError</p>
|
||||
@ -38,6 +35,87 @@ else if (@Model.Correction == null)
|
||||
{
|
||||
<p>ویرایشی وجود ندارد.</p>
|
||||
}
|
||||
else if(Model.DeletedUserSections)
|
||||
{
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
تعداد کل: @Model.TotalCount
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><a role="button" target="_blank" href="@Model.PageInformation.FullUrl" class="actionlink">@Model.PageInformation.FullTitle</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@Html.Raw(Model.PoemSection.HtmlText)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
وزن:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="select-search">جستجوی وزن:</label><br />
|
||||
<input type="text" id="select-search" value="" oninput="doSearchInRhythmsCombo('select-search', 'rhythm-new')" list="inputRhythms" autocomplete="off" size="50" autofocus />
|
||||
<datalist id="inputRhythms">
|
||||
@if (Model.RhythmsByVerseCount != null)
|
||||
@foreach (var rhythm in Model.RhythmsByVerseCount)
|
||||
{
|
||||
<option value="@rhythm.Rhythm">@rhythm.Rhythm</option>
|
||||
}
|
||||
</datalist>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="rhythm-new">وزن انتخاب شده:</label>
|
||||
<br />
|
||||
<select id="rhythm-new" name="rhythm-new">
|
||||
@foreach (var rhythm in Model.RhythmsAlphabetically)
|
||||
{
|
||||
<option value="@rhythm.Rhythm">@(rhythm.Rhythm == "" ? "هیچکدام" : rhythm.Rhythm == "null" ? "وزنیابی نشده" : rhythm.Rhythm)</option>
|
||||
}
|
||||
</select>
|
||||
<a role="button" onclick="resetRhythm('rhythm-new')" class="pagebutton">پاک کردن وزن</a>
|
||||
<br />
|
||||
<script>
|
||||
function newRhythm() {
|
||||
var rhythm = prompt("پیشنهاد وزن جدید", "");
|
||||
if (rhythm != null) {
|
||||
var select = document.getElementById('rhythm-new');
|
||||
var options = select.options;
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
if (options[i].value == rhythm) {
|
||||
alert('وزن پیشنهادی تکراری است.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
var opt = document.createElement('option');
|
||||
opt.value = rhythm;
|
||||
opt.innerHTML = rhythm;
|
||||
select.appendChild(opt);
|
||||
|
||||
var opt2 = document.createElement('option');
|
||||
opt2.value = rhythm;
|
||||
opt2.innerHTML = rhythm;
|
||||
document.getElementById('rhythm-new2').appendChild(opt2);
|
||||
|
||||
alert('وزن پیشنهادی به انتهای لیست وزنها اضافه شده. لطفاً از لیست آن را انتخاب کنید.');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<a role="button" onclick="newRhythm()" class="pagebutton">پیشنهاد وزن جدید</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<script>
|
||||
@ -240,6 +318,16 @@ else
|
||||
<input type="text" id="title_review_note" name="title_review_note" value="" size="50" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@if (Model.PoemSection != null)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<a role="button" href=@($"/User/Section?poemId={Model.PoemSection.PoemId}&index={Model.PoemSection.Index}") class="pagebutton" target="_blank">خودم ویرایش کنم</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
@if (Model.Correction.RhymeLetters != null)
|
||||
|
||||
@ -59,6 +59,16 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
/// </summary>
|
||||
public List<GanjoorVerseViewModel> Verses { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// rhythms alphabetically
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsAlphabetically { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// rhythms by frequency
|
||||
/// </summary>
|
||||
public GanjoorMetre[] RhythmsByVerseCount { get; set; }
|
||||
|
||||
private List<GanjoorVerseViewModel> _FilterSectionVerses(GanjoorPoemSection section, GanjoorVerseViewModel[] verses)
|
||||
{
|
||||
List<GanjoorVerseViewModel> sectionVerses = new List<GanjoorVerseViewModel>();
|
||||
@ -155,6 +165,33 @@ namespace GanjooRazor.Areas.Admin.Pages
|
||||
Verses = _FilterSectionVerses(PoemSection, PageInformation.Poem.Verses);
|
||||
}
|
||||
|
||||
if (DeletedUserSections)
|
||||
{
|
||||
var rhythmResponse = await secureClient.GetAsync($"{APIRoot.Url}/api/ganjoor/rhythms?sortOnVerseCount=true");
|
||||
if (!rhythmResponse.IsSuccessStatusCode)
|
||||
{
|
||||
FatalError = JsonConvert.DeserializeObject<string>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
return Page();
|
||||
}
|
||||
|
||||
RhythmsByVerseCount = JsonConvert.DeserializeObject<GanjoorMetre[]>(await rhythmResponse.Content.ReadAsStringAsync());
|
||||
|
||||
List<GanjoorMetre> rhythmsByVerseCount = new List<GanjoorMetre>(RhythmsByVerseCount);
|
||||
rhythmsByVerseCount.Sort((a, b) => a.Rhythm.CompareTo(b.Rhythm));
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
{
|
||||
Rhythm = "null"
|
||||
}
|
||||
);
|
||||
rhythmsByVerseCount.Insert(0, new GanjoorMetre()
|
||||
{
|
||||
Rhythm = ""
|
||||
}
|
||||
);
|
||||
|
||||
RhythmsAlphabetically = rhythmsByVerseCount.ToArray();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user