Poet and book editors: details, intro and titles through the pipeline #106

Merged
anas merged 1 commits from feature/poet-book-editors into main 2026-10-09 23:08:08 +00:00
Owner

Closes #32. Owner request: moderators can edit works but not poets' intros or book titles; these edits get version history too.

What moderators can edit:

  • Poet (button «تفصیل» on the poet page): name, pen name (تخلص, shown everywhere on the site), birth and death years (CE; the Hijri years follow), and the intro.
  • Book or section (button «عنوان» on its page): the title.

How it works:

  • Same pipeline as works: draft → L1 → admin (an admin's own edit publishes directly).
  • Permission: edit on poets or books in the admin's grants.
  • Each edit has a history page with versions, «فرق», «موازنہ کریں» and «واپس لائیں» (from #98).
  • The moderation queue and activity log show them as «شاعر:» and «عنوان:», with filters.
  • The draft page has a form: name and pen name (with the Urdu keyboard), the two years side by side, and the intro (paragraphs separated by a blank line). Years can be typed in Urdu digits.
  • Checks: name and pen name are required, years are CE between 500 and 2100, death is not before birth, and the intro is at most 5,000 characters.
  • Publishing commits divan/<poet url>.poet or divan/<book url>.book to divan-data and updates the site. The poet's top level takes the new name.
  • Needs divan-data PR "Divan-owned details" so the daily export keeps these edits instead of overwriting them from Wikisource and Wikipedia. Merge it before or together with this one.
  • The poet page shows the intro in paragraphs.
  • The help page has a card for it.

Tested:

  • details.test.ts: text format and checks; permission (403 without a grant); L2 draft → publish; database values (Hijri computed); the data file; the commit message; book title; compare against version 0; revert; activity log.
  • All 47 API tests pass, and the site builds.
  • Checked locally end to end with a temporary data folder: the «تفصیل» button, the form, save and publish as admin, the poet page with the new intro in paragraphs, and the history page. Screenshots at phone width; the year fields' overflow is fixed. Iqbal's local data was restored afterwards.

🤖 Generated with Claude Code

Closes #32. Owner request: moderators can edit works but not poets' intros or book titles; these edits get version history too. **What moderators can edit:** - **Poet** (button «تفصیل» on the poet page): name, pen name (تخلص, shown everywhere on the site), birth and death years (CE; the Hijri years follow), and the intro. - **Book or section** (button «عنوان» on its page): the title. **How it works:** - Same pipeline as works: draft → L1 → admin (an admin's own edit publishes directly). - Permission: edit on **poets** or **books** in the admin's grants. - Each edit has a history page with versions, «فرق», «موازنہ کریں» and «واپس لائیں» (from #98). - The moderation queue and activity log show them as «شاعر:» and «عنوان:», with filters. - The draft page has a form: name and pen name (with the Urdu keyboard), the two years side by side, and the intro (paragraphs separated by a blank line). Years can be typed in Urdu digits. - Checks: name and pen name are required, years are CE between 500 and 2100, death is not before birth, and the intro is at most 5,000 characters. - Publishing commits `divan/<poet url>.poet` or `divan/<book url>.book` to divan-data and updates the site. The poet's top level takes the new name. - **Needs divan-data PR "Divan-owned details"** so the daily export keeps these edits instead of overwriting them from Wikisource and Wikipedia. Merge it before or together with this one. - The poet page shows the intro in paragraphs. - The help page has a card for it. **Tested:** - `details.test.ts`: text format and checks; permission (403 without a grant); L2 draft → publish; database values (Hijri computed); the data file; the commit message; book title; compare against version 0; revert; activity log. - All 47 API tests pass, and the site builds. - Checked locally end to end with a temporary data folder: the «تفصیل» button, the form, save and publish as admin, the poet page with the new intro in paragraphs, and the history page. Screenshots at phone width; the year fields' overflow is fixed. Iqbal's local data was restored afterwards. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-09 23:06:37 +00:00
anas merged commit be7140841a into main 2026-10-09 23:08:08 +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#106
No description provided.