#250 displayin a limited (5) number of recitations for poems with lots of recitations by default

This commit is contained in:
Hamid Reza Mohammadi 2021-12-01 08:25:24 +03:30
parent 53987bb937
commit ec591172cb
3 changed files with 21 additions and 1 deletions

View File

@ -8,7 +8,7 @@
@for (var nRecitationIndex = 0; nRecitationIndex < Model.Recitations.Length; nRecitationIndex++)
{
var recitaion = Model.Recitations[nRecitationIndex];
<div class="audio-player">
<div class="@Model.CSSClass(nRecitationIndex)">
<audio id="audio-@(nRecitationIndex + 1)" preload="none" controls>
<source src="@recitaion.Mp3Url" title="@($"{recitaion.AudioTitle} به خوانش {recitaion.AudioArtist}")" data-track-number="@(nRecitationIndex + 1)" />
مرورگر شما از پخش صدای HTML 5 پشتیبانی نمی‌کند.
@ -33,7 +33,14 @@
_trackTimeChanged(document.getElementById('audio-@(nRecitationIndex + 1)'));
});
</script>
</div>
@if (nRecitationIndex == 4 && Model.Recitations.Length > 5)
{
<a role="button" class="pagebutton" id="load-all-recitations" onclick="">همهٔ خوانش‌ها<i class="info-buttons">autorenew</i></a>
}
}
</div>

View File

@ -40,5 +40,10 @@ namespace GanjooRazor.Pages
return audiodesc;
}
public string CSSClass(int recitationIndex)
{
return recitationIndex < 5 ? "audio-player" : "hidden-item";
}
}
}

View File

@ -1126,4 +1126,12 @@ ol {
.audio-player{
}
.recitaion-info{
}
.hidden-item {
display: none;
}