}
}
diff --git a/GanjooRazor/Areas/User/Pages/Editor.cshtml.cs b/GanjooRazor/Areas/User/Pages/Editor.cshtml.cs
index 3b73cbf5..a95c62bf 100644
--- a/GanjooRazor/Areas/User/Pages/Editor.cshtml.cs
+++ b/GanjooRazor/Areas/User/Pages/Editor.cshtml.cs
@@ -88,6 +88,27 @@ namespace GanjooRazor.Areas.User.Pages
return -1;
}
+ ///
+ /// total number of couplets/lines in the poem (same counting rules as GetVerseCoupletNumber,
+ /// just run all the way through) - used to render the small read-progress bar next to the
+ /// couplet number in the verse-editing and couplet-summary ("خلاصه و معنی") sections.
+ ///
+ public int TotalCoupletsCount =>
+ PageInformation?.Poem?.Verses == null || PageInformation.Poem.Verses.Length == 0
+ ? 0
+ : GetVerseCoupletNumber(PageInformation.Poem.Verses[PageInformation.Poem.Verses.Length - 1]);
+
+ ///
+ /// 0-100 fill percentage for the read-progress bar, for a given couplet number (1-based, as
+ /// returned by GetVerseCoupletNumber)
+ ///
+ public int GetCoupletProgressPercent(int coupletNumber)
+ {
+ if (TotalCoupletsCount <= 0 || coupletNumber <= 0)
+ return 0;
+ return Math.Min(100, coupletNumber * 100 / TotalCoupletsCount);
+ }
+
public PoemRelatedImage TextSourceImage { get; set; }
diff --git a/GanjooRazor/wwwroot/css/user-panel.css b/GanjooRazor/wwwroot/css/user-panel.css
index 4d64377a..49a9c756 100644
--- a/GanjooRazor/wwwroot/css/user-panel.css
+++ b/GanjooRazor/wwwroot/css/user-panel.css
@@ -800,6 +800,26 @@ body.up-modal-open {
vertical-align: middle;
}
+/* small read-progress indicator shown beside the couplet number - how far through the whole
+ poem this couplet is, not a form control */
+.up-verse-progress {
+ display: inline-block;
+ width: 44px;
+ height: 5px;
+ border-radius: 999px;
+ background: var(--up-border);
+ overflow: hidden;
+ vertical-align: middle;
+ margin-inline-end: var(--up-space-2);
+}
+
+.up-verse-progress-fill {
+ display: block;
+ height: 100%;
+ background: var(--up-primary);
+ border-radius: 999px;
+}
+
.up-form-actions {
display: flex;
gap: var(--up-space-2);