diff --git a/GanjooRazor/Pages/GanjoorPage.cshtml b/GanjooRazor/Pages/GanjoorPage.cshtml index 6f5e270f..0ecc2f55 100644 --- a/GanjooRazor/Pages/GanjoorPage.cshtml +++ b/GanjooRazor/Pages/GanjoorPage.cshtml @@ -3,7 +3,6 @@ @{ Layout = "_Layout"; } -@using DNTPersianUtils.Core @section Head { @@ -24,7 +23,7 @@ if (Model.IsPoemPage) { - } } - @if ((Model.IsCatPage || Model.IsPoetPage) && Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0) { @@ -82,6 +79,7 @@ } } } + @if (Model.OfflineMode) {
@@ -113,6 +111,7 @@ else if (Model.ReadOnlyMode)

} + @if (Model.IsPoemPage) { if (Model.GanjoorPage != null && Model.GanjoorPage.Poem.Recitations.Length > 0) @@ -125,18 +124,18 @@ else if (Model.ReadOnlyMode) var nLastHighlight = -1; var vCount = 0; - var _setXml = function (xmlUrl) { + var _setXml = function(xmlUrl) { $.ajax({ type: "GET", url: xmlUrl, dataType: "xml", - success: function (xml) { + success: function(xml) { var nOneSecondBugFix = 2000; - $(xml).find('OneSecondBugFix').each(function () { + $(xml).find('OneSecondBugFix').each(function() { nOneSecondBugFix = parseInt($(xml).find('OneSecondBugFix').text()); }); var v = 0; - $(xml).find('SyncInfo').each(function () { + $(xml).find('SyncInfo').each(function() { verseStart[v] = parseInt($(this).find('AudioMiliseconds').text()) / nOneSecondBugFix; verseIndex[v] = parseInt($(this).find('VerseOrder').text()); if (v > 0) @@ -151,7 +150,7 @@ else if (Model.ReadOnlyMode) }); } - var _trackTimeChanged = function (audio) { + var _trackTimeChanged = function(audio) { var currentTime = audio.currentTime; if (currentTime > 0) { @@ -173,1511 +172,81 @@ else if (Model.ReadOnlyMode) var narrators = []; var audioxmlfiles = []; var recitaionIds = []; - @foreach (var recitation in Model.GanjoorPage.Poem.Recitations) - { - if (recitation.InSyncWithText) + @foreach (var recitation in Model.GanjoorPage.Poem.Recitations) { - - narrators.push('@Html.Raw(recitation.AudioArtist)'); - audioxmlfiles.push('@($"{GanjooRazor.APIRoot.InternetUrl}/api/audio/file/{recitation.Id}.xml")'); - recitaionIds.push(@recitation.Id); - + if (recitation.InSyncWithText) + { + + narrators.push('@Html.Raw(recitation.AudioArtist)'); + audioxmlfiles.push('@($"{GanjooRazor.APIRoot.InternetUrl}/api/audio/file/{recitation.Id}.xml")'); + recitaionIds.push(@recitation.Id); + + } } - } } } - @if (Model.GanjoorPage == null) { return; } - + +
- -
- @if (!string.IsNullOrEmpty(Model.LastError)) {
- @if (Model.LastError != null) - { - @Model.LastError - } + @Model.LastError
} else { -
- @if (Model.GanjoorPage.Poem != null && Model.GanjoorPage.Poem.ClaimedByMultiplePoets) - { - - } - - @{ - if (!string.IsNullOrEmpty(Model.PinterestUrl)) - { - if (!Model.LoggedIn) - { -
-
-

- برای پیشنهاد تصاویر مرتبط با اشعار لازم است ابتدا با نام کاربری خود وارد گنجور شوید. -

-

- ورود به گنجور -

-
-
- } - else - { - - } - - } - } -
- @{ - - if (!Model.IsPoemPage && Model.GanjoorPage.PoetOrCat == null) - { -

- - @Model.GanjoorPage.FullTitle - -

- } - } - - @{ - if (Model.GanjoorPage.PoetOrCat != null) - { -
 
- @if (Model.GanjoorPage.SecondPoet != null) - { -
- @Html.Raw(Model.GanjoorPage.PoetOrCat.Poet.Nickname) - @Html.Raw(Model.GanjoorPage.SecondPoet.Nickname) -
- - - } - else - { -
- @Html.Raw(Model.GanjoorPage.PoetOrCat.Poet.Nickname) -
-
- @{ - foreach (var gran in Model.GanjoorPage.PoetOrCat.Cat.Ancestors) - { - @Html.Raw(gran.Title) - - » - } - - @if (!Model.IsPoemPage && !Model.IsCatPage && !Model.IsPoetPage) - { - @Html.Raw(Model.GanjoorPage.PoetOrCat.Cat.Title) - » -

- - @Html.Raw(Model.GanjoorPage.Title) - -

- } - else - { - @if (Model.IsPoemPage) - { - @Html.Raw(Model.GanjoorPage.PoetOrCat.Cat.Title) - - » -

- - @Html.Raw(Model.GanjoorPage.Poem.Title) - -

- - @if (Model.HtmlLanguage == "azb") - { -
- مجموعه‌ای کامل‌تر و معتبرتر از اشعار ترکی را در وبگاه مین سؤز خواهید یافت. -
- } - - @if (Model.HtmlLanguage == "ckb") - { -
- مجموعه‌ای کامل‌تر و معتبرتر از اشعار کردی را در وبگاه ڤەژینبوکس خواهید یافت. -
- - } - } - else - { -

@Html.Raw(Model.GanjoorPage.PoetOrCat.Cat.Title)

- } - - } - } -
- } - } - } - - @if (Model.GanjoorPage.Id == 39401) - { -
- - } - @{ - @Html.Raw(Model.GanjoorPage.HtmlText) - } - - @if (Model.GanjoorPage.Id == 39401) - { -
- @if (Model.CategoryWordsCounts != null) - { - - - - } -
- } - -
- - @if (Model.IsCatPage || Model.IsPoetPage) - { -
-
- - @if (Model.IsPoetPage) - { - - } - - - @if (Model.IsPoetPage) - { - - - } - - -
- - -
-
- - @if (Model.IsPoetPage) - { - - } - - - @if (Model.IsPoetPage) - { - - - } - -
- - - - @if (Model.IsPoetPage) - { -
-
- - @if (Model.IsPoetPage) - { - - } - - - @if (Model.IsPoetPage) - { - - - } - -
-
- - -
- if (Model.GanjoorPage.SecondPoet == null) - { -
-
- - @if (Model.IsPoetPage) - { - - } - - - @if (Model.IsPoetPage) - { - - - } - -
- - - } - } - -
-
- - @if (Model.IsPoetPage) - { - - } - - - @if (Model.IsPoetPage) - { - - - } - - -
- - - @if ( - !Model.OfflineMode && - Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0 - ) - { -
- } - - } - - - - - @if (!string.IsNullOrEmpty(Model.NextUrl) || !string.IsNullOrEmpty(Model.PreviousUrl)) - { -
 
- -
 
- } - - - @if (Model.IsPoemPage) - { - -
 
- - @if (Model.Banner != null) - { -
- @Model.Banner.AlternateText -
- } - -
-
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
-
- - -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
- - - -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
- - - @{ - if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
- - - - } - - if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
- - - } - -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
-
- @for (int i = 0; i < Math.Min(5, Model.GanjoorPage.Poem.Top6QuotedPoems.Length); i++) - { - - } - - @if (Model.GanjoorPage.Poem.Top6QuotedPoems.Length == 6) - { -
- - } - @if (Model.LoggedIn) - { - - } - else - { - - } -
- } - @if (Model.SectionsWithRelated.Any() || Model.SectionsWithMetreAndRhymes.Any()) - { -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
-
- @foreach (var s in Model.SectionsWithRelated) - { - @for (int i = 0; i < Math.Min(5, s.Top6RelatedSections.Length); i++) - { -
-
- @s.Top6RelatedSections[i].PoetName -
- -
- @Html.Raw(s.Top6RelatedSections[i].HtmlExcerpt) -
- - @if (s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount > 0 && s.GanjoorMetre != null && !string.IsNullOrEmpty(s.RhymeLetters)) - { - @if (s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount > 20) - { - مشاهدهٔ بیش از @s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount.ToPersianNumbers() مورد هم آهنگ دیگر از @s.Top6RelatedSections[i].PoetName - } - else - { - مشاهدهٔ @s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount.ToPersianNumbers() مورد هم آهنگ دیگر از @s.Top6RelatedSections[i].PoetName - } - } -
- - @if (s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount > 0) - { - - } - } - - @if (s.Top6RelatedSections.Length == 6 && s.GanjoorMetre != null) - { - - - } - } - - @if (Model.SectionsWithMetreAndRhymes.Any()) - { - - مشابه‌یابی بر اساس وزن و قافیه - - - - @for (int nSectionIndex = 1; nSectionIndex < Model.SectionsWithMetreAndRhymes.Count; nSectionIndex++) - { - - مشابه‌یابی بر اساس وزن و قافیه (وزن @((nSectionIndex + 1).ToPersianNumbers())) - - - } - } - -
- } - -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
- @if (!Model.GanjoorPage.Poem.Songs.Any()) - { - - } - else - { -
- @foreach (var song in Model.GanjoorPage.Poem.Songs) - { - - } -

- - معرفی ترانه‌های دیگر - -

-
- } -
- -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
- - - -
-
- - - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) - { - - } - - @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) - { - - } - - @if (Model.SectionsWithRelated.Count > 0) - { - - } - - - -
- - - - -
- } - - - - - @if (!Model.OfflineMode && (Model.IsCatPage || Model.IsPoetPage) && Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0) - { - - } - - @if (!Model.OfflineMode && Model.IsPoemPage && Model.GanjoorPage.Poem.GeoDateTags.Length > 0) - { - - } - - - @if (Model.GanjoorPage.Previous != null || Model.GanjoorPage.Next != null) - { - - } - - - @if (Model.CanEdit && !Model.IsPoemPage) - { -
 
- - } - - -
+ @if (Model.IsPoetPage) + { + + } + else if (Model.IsCatPage) + { + + } + else if (Model.IsPoemPage) + { + + } + else + { + + } } - -
- - - - - +
@{ if (!string.IsNullOrEmpty(Model.PinterestUrl)) { } - } + \ No newline at end of file diff --git a/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_CatPagePartial.cshtml b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_CatPagePartial.cshtml new file mode 100644 index 00000000..c4ba9fd1 --- /dev/null +++ b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_CatPagePartial.cshtml @@ -0,0 +1,189 @@ +@model GanjoorPageModel + +
+ + + @* Category Tabs *@ +
+ + + @* Word Counts Section *@ + + + @* Recitations Section *@ +
+ + + + @* Top Visits Section *@ +
+ + + + @* Map *@ + @if (!Model.OfflineMode && Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0) + { +
+ } +
+ +@* Navigation *@ +@if (!string.IsNullOrEmpty(Model.NextUrl) || !string.IsNullOrEmpty(Model.PreviousUrl)) +{ +
 
+ +
 
+} + +@if (Model.CanEdit && !Model.IsPoemPage) +{ +
 
+ +} + +@if (!Model.OfflineMode && Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0) +{ + +} \ No newline at end of file diff --git a/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_GenericPagePartial.cshtml b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_GenericPagePartial.cshtml new file mode 100644 index 00000000..3f9e7a4d --- /dev/null +++ b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_GenericPagePartial.cshtml @@ -0,0 +1,96 @@ +@model GanjoorPageModel + +
+
+ @if (Model.GanjoorPage.PoetOrCat == null) + { +

+ + @Model.GanjoorPage.FullTitle + +

+ } + else + { +
 
+ @if (Model.GanjoorPage.SecondPoet != null) + { + + + } + else + { +
+ + @Html.Raw(Model.GanjoorPage.PoetOrCat.Poet.Nickname) + +
+
+ @{ + foreach (var gran in Model.GanjoorPage.PoetOrCat.Cat.Ancestors) + { + @Html.Raw(gran.Title) + » + } + @Html.Raw(Model.GanjoorPage.PoetOrCat.Cat.Title) + » +

+ + @Html.Raw(Model.GanjoorPage.Title) + +

+ } +
+ } + } + + + @Html.Raw(Model.GanjoorPage.HtmlText) +
+ + @* Navigation *@ + @if (!string.IsNullOrEmpty(Model.NextUrl) || !string.IsNullOrEmpty(Model.PreviousUrl)) + { +
 
+ +
 
+ } + + @if (Model.CanEdit && !Model.IsPoemPage) + { +
 
+ + } +
\ No newline at end of file diff --git a/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_PoemPagePartial.cshtml b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_PoemPagePartial.cshtml new file mode 100644 index 00000000..171fe6b2 --- /dev/null +++ b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_PoemPagePartial.cshtml @@ -0,0 +1,994 @@ +@model GanjoorPageModel +@using DNTPersianUtils.Core + +
+ @if (Model.GanjoorPage.Poem != null && Model.GanjoorPage.Poem.ClaimedByMultiplePoets) + { + + } + + @{ + if (!string.IsNullOrEmpty(Model.PinterestUrl)) + { + if (!Model.LoggedIn) + { +
+
+

+ برای پیشنهاد تصاویر مرتبط با اشعار لازم است ابتدا با نام کاربری خود وارد گنجور شوید. +

+

+ ورود به گنجور +

+
+
+ } + else + { + + } + } + } + +
+ @if (Model.GanjoorPage.PoetOrCat != null) + { +
 
+ @if (Model.GanjoorPage.SecondPoet != null) + { +
+ @Html.Raw(Model.GanjoorPage.PoetOrCat.Poet.Nickname) + @Html.Raw(Model.GanjoorPage.SecondPoet.Nickname) +
+ + } + else + { +
+ @Html.Raw(Model.GanjoorPage.PoetOrCat.Poet.Nickname) +
+
+ @foreach (var gran in Model.GanjoorPage.PoetOrCat.Cat.Ancestors) + { + @Html.Raw(gran.Title) + » + } + @Html.Raw(Model.GanjoorPage.PoetOrCat.Cat.Title) + » +

+ + @Html.Raw(Model.GanjoorPage.Poem.Title) + +

+ + @if (Model.HtmlLanguage == "azb") + { +
+ مجموعه‌ای کامل‌تر و معتبرتر از اشعار ترکی را در وبگاه مین سؤز خواهید یافت. +
+ } + + @if (Model.HtmlLanguage == "ckb") + { +
+ مجموعه‌ای کامل‌تر و معتبرتر از اشعار کردی را در وبگاه ڤەژینبوکس خواهید یافت. +
+ } +
+ } + } + + + + @if (Model.GanjoorPage.Id == 39401) + { +
+ + } + + @Html.Raw(Model.GanjoorPage.HtmlText) + + @if (Model.GanjoorPage.Id == 39401) + { +
+ @if (Model.CategoryWordsCounts != null) + { + + } +
+ } +
+ + @* Navigation *@ + @if (!string.IsNullOrEmpty(Model.NextUrl) || !string.IsNullOrEmpty(Model.PreviousUrl)) + { +
 
+ +
 
+ } + + @* Banner *@ + @if (Model.Banner != null) + { +
+ @Model.Banner.AlternateText +
+ } + + @* Comments Section *@ +
+
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ +
+ @* ============ INFORMATION TAB ============ *@ + + + @* ============ WORD COUNTS TAB ============ *@ +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ + + @* ============ MANUSCRIPTS TAB ============ *@ +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ + + @* ============ RECITATIONS TAB ============ *@ + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { +
+
+ + + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ + } + + @* ============ COMMENTARIES TAB ============ *@ + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ + } + + @* ============ QUOTED POEMS TAB ============ *@ +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+
+ @for (int i = 0; i < Math.Min(5, Model.GanjoorPage.Poem.Top6QuotedPoems.Length); i++) + { + + } + + @if (Model.GanjoorPage.Poem.Top6QuotedPoems.Length == 6) + { +
+ + } + @if (Model.LoggedIn) + { + + } + else + { + + } +
+ + @* ============ RELATED POEMS TAB ============ *@ + @if (Model.SectionsWithRelated.Any() || Model.SectionsWithMetreAndRhymes.Any()) + { +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+
+ @foreach (var s in Model.SectionsWithRelated) + { + @for (int i = 0; i < Math.Min(5, s.Top6RelatedSections.Length); i++) + { +
+
+ @s.Top6RelatedSections[i].PoetName +
+ +
+ @Html.Raw(s.Top6RelatedSections[i].HtmlExcerpt) +
+ + @if (s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount > 0 && s.GanjoorMetre != null && !string.IsNullOrEmpty(s.RhymeLetters)) + { + @if (s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount > 20) + { + مشاهدهٔ بیش از @s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount.ToPersianNumbers() مورد هم آهنگ دیگر از @s.Top6RelatedSections[i].PoetName + } + else + { + مشاهدهٔ @s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount.ToPersianNumbers() مورد هم آهنگ دیگر از @s.Top6RelatedSections[i].PoetName + } + } +
+ + @if (s.Top6RelatedSections[i].PoetMorePoemsLikeThisCount > 0) + { + + } + } + + @if (s.Top6RelatedSections.Length == 6 && s.GanjoorMetre != null) + { + + + } + } + + @if (Model.SectionsWithMetreAndRhymes.Any()) + { + + مشابه‌یابی بر اساس وزن و قافیه + + + + @for (int nSectionIndex = 1; nSectionIndex < Model.SectionsWithMetreAndRhymes.Count; nSectionIndex++) + { + + مشابه‌یابی بر اساس وزن و قافیه (وزن @((nSectionIndex + 1).ToPersianNumbers())) + + + } + } +
+ } + + @* ============ SONGS TAB ============ *@ +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ @if (!Model.GanjoorPage.Poem.Songs.Any()) + { + + } + else + { +
+ @foreach (var song in Model.GanjoorPage.Poem.Songs) + { + + } +

+ + معرفی ترانه‌های دیگر + +

+
+ } + + @* ============ 7 DAYS VISITS TAB ============ *@ +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ + + @* ============ DISCUSSIONS TAB ============ *@ +
+
+ + + + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Normal).Any()) + { + + } + @if (Model.GanjoorPage.Poem.Recitations.Where(a => a.RecitationType == RMuseum.Models.GanjoorAudio.RecitationType.Commentary).Any()) + { + + } + + @if (Model.SectionsWithRelated.Count > 0) + { + + } + + + +
+ +
+
+
+ +@if (!Model.OfflineMode && Model.GanjoorPage.Poem.GeoDateTags.Length > 0) +{ + +} \ No newline at end of file diff --git a/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_PoetPagePartial.cshtml b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_PoetPagePartial.cshtml new file mode 100644 index 00000000..0a2a2bc9 --- /dev/null +++ b/GanjooRazor/Pages/Partials/GanjoorPage/PageTypes/_PoetPagePartial.cshtml @@ -0,0 +1,323 @@ +@model GanjoorPageModel + +
+ + + @* Poet Tabs *@ +
+ + + @* Stats Section *@ + + + @* Quoted Poems Section *@ +
+ + + + @* Word Counts Section *@ +
+ + + + @* Recitations Section *@ +
+ + + + @* Photos Section *@ +
+ +
+ +
+ + @* Paper Sources Section *@ + @if (Model.GanjoorPage.SecondPoet == null) + { +
+ + + } + + @* Top Visits Section *@ +
+ + + + @* Map *@ + @if (!Model.OfflineMode && Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0) + { +
+ } +
+ +@* Navigation *@ +@if (!string.IsNullOrEmpty(Model.NextUrl) || !string.IsNullOrEmpty(Model.PreviousUrl)) +{ +
 
+ +
 
+} + +@if (Model.CanEdit && !Model.IsPoemPage) +{ +
 
+ +} + +@if (!Model.OfflineMode && Model.CategoryPoemGeoDateTags != null && Model.CategoryPoemGeoDateTags.Length > 0) +{ + +} \ No newline at end of file diff --git a/GanjoorService.sln b/GanjoorService.sln index ff4168b2..033d8808 100644 --- a/GanjoorService.sln +++ b/GanjoorService.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31912.275 +# Visual Studio Version 18 +VisualStudioVersion = 18.8.12009.203 stable MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RMuseum", "RMuseum\RMuseum.csproj", "{113EF3DE-E8A9-40EF-9DA0-8DFABB3CDD68}" EndProject