+ @if (Model.PoetGroups != null && Model.PoetGroups.Any(g => g.Id == 0))
+ {
مقبول شعرا
@@ -112,8 +114,35 @@ else
}
+ }
- @{
+ @if (Model.NoContentYet)
+ {
+
+
دیوان کا مواد تیار کیا جا رہا ہے۔ براہِ کرم کچھ دیر بعد دوبارہ تشریف لائیں۔
+ @if (Model.LoggedIn)
+ {
+
مواد درآمد کریں
+ }
+
+ }
+ else if (!Model.PoetGroups.Any(g => g.Id != 0))
+ {
+ @* century groups are rebuilt when an import finishes; until then list all poets *@
+
شعرا
+
+ @foreach (var poet in Model.Poets)
+ {
+
+ }
+
+ }
+ else
+ {
صدیوں کے لحاظ سے
diff --git a/DivanRazor/Pages/Index.cshtml.cs b/DivanRazor/Pages/Index.cshtml.cs
index ab599240..fc90f1f0 100644
--- a/DivanRazor/Pages/Index.cshtml.cs
+++ b/DivanRazor/Pages/Index.cshtml.cs
@@ -165,11 +165,9 @@ namespace DivanRazor.Pages
// empty database instead of rendering something useful. Steer the visitor toward
// fixing that instead of letting them hit an unhandled exception: log in first if
// needed, then straight to the admin page that can seed real content.
- if (IsDatabaseEffectivelyEmpty())
- {
- const string targetUrl = "/Admin/PublicDataImport";
- return LoggedIn ? Redirect(targetUrl) : Redirect($"/login?redirect={targetUrl}");
- }
+ // divan: the home page is public. No poets yet -> public "being prepared" notice (admins get an
+ // import link in the view); poets but no century groups yet (e.g. mid-import) -> one flat group.
+ NoContentYet = IsDatabaseEffectivelyEmpty();
ViewData["Title"] = "دیوان";
@@ -177,15 +175,18 @@ namespace DivanRazor.Pages
}
///
- /// true if there's nothing meaningful to show on the home page yet — no poets at all, or
- /// no century grouping (the "popular poets" group with Id == 0 that the view relies on).
+ /// true if there are no poets to show yet
///
private bool IsDatabaseEffectivelyEmpty()
{
- return Poets == null || Poets.Count == 0
- || PoetGroups == null || !PoetGroups.Any(g => g.Id == 0);
+ return Poets == null || Poets.Count == 0 || PoetGroups == null;
}
+ ///
+ /// true when there is nothing to list yet (fresh install or import not started)
+ ///
+ public bool NoContentYet { get; set; }
+
public async Task
OnGetPoetInformationAsync(int id)
{
if (id == 0)
diff --git a/DivanRazor/Pages/Partials/DivanPage/PageTypes/_PoetPagePartial.cshtml b/DivanRazor/Pages/Partials/DivanPage/PageTypes/_PoetPagePartial.cshtml
index 46139499..90afd512 100644
--- a/DivanRazor/Pages/Partials/DivanPage/PageTypes/_PoetPagePartial.cshtml
+++ b/DivanRazor/Pages/Partials/DivanPage/PageTypes/_PoetPagePartial.cshtml
@@ -52,7 +52,6 @@
-
@@ -69,7 +68,6 @@
-
@@ -84,7 +82,6 @@
-
@* Paper Sources Section *@
@if (Model.DivanPage.SecondPoet == null)
{
@@ -167,7 +130,6 @@