Home page sections: a site permission to rename, add and reorder sections and sort their poets #63

Merged
anas merged 1 commits from feature/site-sections into main 2026-10-09 12:25:37 +00:00
Owner

Owner request: a special permission for moderators who manage the home page (featured poets, sections, order).

Who

  • A new grant content type, سائٹ (سرورق کے حصے) (site), with the action edit and scope all. A site grant for one poet or book gives no access.
  • Admins can always edit the home page.

What (/mod/site, the new سرورق tab in moderation)

  • Rename any section. A century section without its own name shows its century name.
  • Reorder sections (↑ ↓), remove sections, and add sections:
    • منتخب شعرا (chosen poets): pick poets with the Urdu name box (Urdu keyboard and Roman typing work there), order them by hand, remove them. "مقبول شعرا" is one of these.
    • صدی (century): every poet born in that Hijri century appears automatically, including new ones from the sync.
  • Sort each section دستی (by hand; chosen-poets sections), حروفِ تہجی (Urdu alphabetical) or زمانی (timeline, by birth year).
  • Changes apply at once and are recorded in the audit log. There is no review step; say if this should go through L1/admin like content.
  • The first use seeds today's layout (featured poets, then centuries by timeline), so the home page looks the same until someone edits it.

API

  • Table home_sections.
  • GET /api/home (public): the sections with their poets; the home page reads this.
  • GET and POST /api/mod/site: the editor's data and the save.

Tested

  • npm test: 38 pass. The new test covers:
    • the default layout includes every poet;
    • the permission check (403);
    • a nameless chosen section is refused;
    • rename, alphabetical sort and moving a section first;
    • chosen order, with repeats and unknown poets dropped;
    • the audit entry.
  • Headless Chrome as an L2 with only a site grant:
    • renamed مقبول شعرا, added میر انیس via the name box and moved him up;
    • made the 13th century alphabetical, renamed it and moved it up;
    • added a new section with غالب, saved, and the home page followed.
  • The local layout was restored and the test account removed.

Local setup: apply db/schema.sql before running (import or dict-sync do this).

🤖 Generated with Claude Code

Owner request: a special permission for moderators who manage the home page (featured poets, sections, order). **Who** - A new grant content type, **سائٹ (سرورق کے حصے)** (`site`), with the action **edit** and scope **all**. A site grant for one poet or book gives no access. - Admins can always edit the home page. **What** (`/mod/site`, the new **سرورق** tab in moderation) - **Rename** any section. A century section without its own name shows its century name. - **Reorder** sections (↑ ↓), **remove** sections, and **add** sections: - **منتخب شعرا** (chosen poets): pick poets with the Urdu name box (Urdu keyboard and Roman typing work there), order them by hand, remove them. "مقبول شعرا" is one of these. - **صدی** (century): every poet born in that Hijri century appears automatically, including new ones from the sync. - **Sort** each section **دستی** (by hand; chosen-poets sections), **حروفِ تہجی** (Urdu alphabetical) or **زمانی** (timeline, by birth year). - Changes apply at once and are recorded in the audit log. There is no review step; say if this should go through L1/admin like content. - The first use seeds today's layout (featured poets, then centuries by timeline), so the home page looks the same until someone edits it. **API** - Table `home_sections`. - `GET /api/home` (public): the sections with their poets; the home page reads this. - `GET` and `POST /api/mod/site`: the editor's data and the save. **Tested** - `npm test`: 38 pass. The new test covers: - the default layout includes every poet; - the permission check (403); - a nameless chosen section is refused; - rename, alphabetical sort and moving a section first; - chosen order, with repeats and unknown poets dropped; - the audit entry. - Headless Chrome as an L2 with only a site grant: - renamed مقبول شعرا, added میر انیس via the name box and moved him up; - made the 13th century alphabetical, renamed it and moved it up; - added a new section with غالب, saved, and the home page followed. - The local layout was restored and the test account removed. **Local setup:** apply `db/schema.sql` before running (import or dict-sync do this). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-09 12:24:59 +00:00
- home_sections: chosen-poets sections (مقبول شعرا) and century sections (every poet born in that Hijri century,
  so new poets appear on their own); first use seeds the layout the home page had.
- New content type 'site' for grants (scope all, action edit); admins always. Changes apply at once and are audited.
- /mod/site editor (tab سرورق): names, ↑ ↓, remove, sort, add/remove/order poets with the Urdu name box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anas merged commit 0357a74778 into main 2026-10-09 12:25:37 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: anas/divan#63
No description provided.