diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs index 0f4120c3..3cce1ce4 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs @@ -477,7 +477,7 @@ namespace RMuseum.Services.Implementation stats = $"{LanguageUtils.FormatMoney(sumRhythmsCouplets - secondMetreCoupletCount)} بیت شعر موجود"; } - string htmlText = "
"; + string htmlText = "
"; htmlText += $"
{Environment.NewLine}"; diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-TOC.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-TOC.cs index a17b0a7b..870dd220 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-TOC.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-TOC.cs @@ -331,34 +331,22 @@ namespace RMuseum.Services.Implementation } - html = _AddTabs(html, cat); + html = _AddTabs(html, cat, true, "stats"); + + html += await _GetCategoryStatsPage(poet.Id, catId, rhythms, context); if (cat.ParentId == null) { //poet page var poetPage = await context.GanjoorPages.AsNoTracking().Where(p => p.ParentId == null && p.PoetId == cat.PoetId && p.GanjoorPageType == GanjoorPageType.PoetPage).SingleAsync(); - - - - /* - html += $"

دیگر صفحات مرتبط با {poet.Nickname} در این پایگاه:

{Environment.NewLine}"; - // do not include stats pages - var statsPage = await context.GanjoorPages.AsNoTracking() - .Where(p => p.FullUrl == $"{poetPage.FullUrl}/vazn").SingleOrDefaultAsync(); - if (statsPage != null) - { - html += $"
{Environment.NewLine}"; - html += $"اوزان اشعار {poet.Nickname}{Environment.NewLine}"; - html += $"
{Environment.NewLine}"; - } - */ - bool hasQuotes = await context.GanjoorQuotedPoems.AsNoTracking().Where(p => p.PoetId == poet.Id && p.Published == true).AnyAsync(); if (hasQuotes) { - html += "
"; + html = _AddTabs(html, cat, false, "quoteds"); + + html += "
"; html += $"
{Environment.NewLine}"; @@ -428,7 +416,7 @@ namespace RMuseum.Services.Implementation foreach (var childPage in thisPoetsSimilars) { var childPoet = poets.Where(p => p.Id == childPage.SecondPoetId).SingleOrDefault(); - if(childPoet != null) + if (childPoet != null) { var childPoetCat = await context.GanjoorCategories.AsNoTracking().Where(c => c.PoetId == childPoet.Id && c.ParentId == null).SingleAsync(); var poetImageUrl = $"https://api.ganjoor.net/api/ganjoor/poet/image{childPoetCat.FullUrl}.gif"; @@ -514,13 +502,9 @@ namespace RMuseum.Services.Implementation html += $"
{Environment.NewLine}";//related-poets-section html += $"
{Environment.NewLine}";//related-images-frame } - + } - - - html += await _GetCategoryStatsPage(poet.Id, catId, rhythms, context); - return new RServiceResult(html); } @@ -698,7 +682,7 @@ namespace RMuseum.Services.Implementation } - html = _AddTabs(html, cat); + html = _AddTabs(html, cat, true, "stats"); html += await _GetCategoryStatsPage(poet.Id, catId, rhythms, context); return new RServiceResult(html); @@ -709,18 +693,18 @@ namespace RMuseum.Services.Implementation } } - private string _AddTabs(string html, GanjoorCat cat) + private string _AddTabs(string html, GanjoorCat cat, bool first, string active) { - html += $"
{Environment.NewLine}"; - html += $"
{Environment.NewLine}"; - html += $" {Environment.NewLine}"; - html += $" {Environment.NewLine}"; - html += $"{Environment.NewLine}"; + html += $"
{Environment.NewLine}"; + html += $"
{Environment.NewLine}"; + html += $"{Environment.NewLine}"; + html += $"{Environment.NewLine}"; + html += $"{Environment.NewLine}"; if (cat.ParentId == null) { - html += $" {Environment.NewLine}"; - html += $" {Environment.NewLine}"; - html += $" {Environment.NewLine}"; + html += $"{Environment.NewLine}"; + html += $" {Environment.NewLine}"; + html += $" {Environment.NewLine}"; } html += $"
{Environment.NewLine}";