Arranging content: reorder works, sections and books (own permission) #61

Merged
anas merged 1 commits from feature/arrange-content into main 2026-10-09 12:05:55 +00:00
Owner

Closes #41. The export side is divan-data PR "Divan-owned order", which builds on divan-data #1.

What moderators can do

  • On a poet page or a book/section page, moderators with the arrange permission see ترتیب دیں and ترتیب کا تاریخچہ.
    • A poet's page arranges their books or top sections.
    • A book or section arranges its sub-sections and works, e.g. Ghalib's ghazals or the poems of Iqbal's books.
  • The draft is a numbered list: drag an item, or use ↑ ↓, اول (to the top) and آخر (to the bottom).
  • The diff and preview show the new order.
  • Moving a work into another section is not in this PR; it is a separate step.

Rules

  • Its own permission: arrange on works or books (a grant from the admin panel), separate from edit. Admins can always arrange.
  • Same pipeline: an arrangement is a revision of type order, going L2 → L1 → admin. It appears in the queue, activity log and history (/mod/order/:id).
  • Text and checks:
    • One line per item: <last part of the URL> <title>. Only the order counts.
    • Every item must stay listed exactly once.
    • Publishing re-checks this, so if the sync added a work meanwhile, publishing is refused (409) and the draft must be redone.
  • Unchanged drafts: an arrangement with no change isn't kept, as with texts.

Publishing

  • Writes divan-data/divan/<url>.order and commits it, with public names and the review trailers.
  • Updates the site's positions.
  • The export (divan-data PR) follows the file, so the daily sync keeps Divan's order. A work new on Wikisource comes after the listed ones.

Note on ghazal lists: they are still grouped by radif letter. If the order mixes letters, a heading repeats.

Tested

  • npm test: 37 pass. The new arranging test covers:
    • editing does not grant arranging;
    • a missing or repeated item is refused;
    • L2 moves the last ghazal first, L1 approves, the admin publishes;
    • the site's first ghazal changes, the .order file and commit are written, the version is numbered;
    • an unchanged draft is dropped.
  • Headless Chrome as an admin on Iqbal's poet page and his شاعری section:
    • buttons and a real drag reorder the list, and the hidden text follows;
    • save shows the diff and the preview;
    • moving back to the original order drops the draft.
  • Not published locally, because that would commit to the real ~/divan-data. Temporary account removed.

🤖 Generated with Claude Code

Closes #41. The export side is divan-data PR "Divan-owned order", which builds on divan-data #1. **What moderators can do** - On a poet page or a book/section page, moderators with the **arrange** permission see **ترتیب دیں** and **ترتیب کا تاریخچہ**. - A poet's page arranges their books or top sections. - A book or section arranges its sub-sections and works, e.g. Ghalib's ghazals or the poems of Iqbal's books. - The draft is a numbered list: drag an item, or use **↑ ↓**, **اول** (to the top) and **آخر** (to the bottom). - The diff and preview show the new order. - Moving a work into another section is not in this PR; it is a separate step. **Rules** - **Its own permission:** `arrange` on works or books (a grant from the admin panel), separate from `edit`. Admins can always arrange. - **Same pipeline:** an arrangement is a revision of type `order`, going L2 → L1 → admin. It appears in the queue, activity log and history (`/mod/order/:id`). - **Text and checks:** - One line per item: `<last part of the URL> <title>`. Only the order counts. - Every item must stay listed exactly once. - Publishing re-checks this, so if the sync added a work meanwhile, publishing is refused (409) and the draft must be redone. - **Unchanged drafts:** an arrangement with no change isn't kept, as with texts. **Publishing** - Writes `divan-data/divan/<url>.order` and commits it, with public names and the review trailers. - Updates the site's positions. - The export (divan-data PR) follows the file, so the daily sync keeps Divan's order. A work new on Wikisource comes after the listed ones. **Note on ghazal lists:** they are still grouped by radif letter. If the order mixes letters, a heading repeats. **Tested** - `npm test`: 37 pass. The new arranging test covers: - editing does not grant arranging; - a missing or repeated item is refused; - L2 moves the last ghazal first, L1 approves, the admin publishes; - the site's first ghazal changes, the `.order` file and commit are written, the version is numbered; - an unchanged draft is dropped. - Headless Chrome as an admin on Iqbal's poet page and his شاعری section: - buttons and a real drag reorder the list, and the hidden text follows; - save shows the diff and the preview; - moving back to the original order drops the draft. - Not published locally, because that would commit to the real `~/divan-data`. Temporary account removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-09 12:02:54 +00:00
- Its own permission (arrange), separate from editing; same L2 -> L1 -> admin pipeline as a work's text
  (revisions with entity 'order'), one line per item; only the order counts and every item stays listed.
- Publishing writes divan-data/divan/<url>.order, commits it and updates the site's positions.
- ترتیب دیں on poet and book/section pages; a sortable list (drag, ↑ ↓, اول, آخر); /mod/order/:id history.
- An unchanged arrangement is not kept, as with texts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anas merged commit d4d8c92711 into main 2026-10-09 12:05:55 +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#61
No description provided.