Commit Graph

4319 Commits

Author SHA1 Message Date
Anas Rashid
3305a514ba Numerals: Eastern (۱۲۳) or Western (123) in the display settings; the server sends pages with the chosen digits (scripts and styles untouched) and script-drawn numbers follow. Settings button lines up with the other icons
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:34:38 +02:00
Anas Rashid
e04ed0d4af Colour palettes and a display settings panel: sepia, فیروزی، نیلگوں، سبز، گلابی (each light and dark); font, palette and light/dark/automatic in one header button
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:31:17 +02:00
Anas Rashid
a37ba82829 Header: font list in Naskh at a fixed height (Nastaliq spilled out in Safari); the ع is laid over the book icon as text (Safari drew the SVG text too large)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:29:27 +02:00
Anas Rashid
70e44f705d Header: the font is a list (نسخ / نستعلیق, each in its own font); the word book icon has ع, not a Latin A; log out lines up with the other icons
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:27:30 +02:00
Anas Rashid
c4bf52dd97 Icons and colour roles: header icons with tooltips and a red log out; buttons coloured by what they do; محفوظ شدہ and پسندیدہ لکھاری
- Icon component (Lucide shapes, ISC), currentColor, decorative (the control keeps its words in aria-label/title).
- Colour roles: --action (primary, filled), --ok (approve, publish), --danger (log out, delete, reject); .btn variants
  and .icon-btn; light and dark.
- Header: admin, moderation, saved, word book, account/sign in, font, theme as icons; log out in red.
- Review: save/send filled, approve/publish green, return plain, reject red, with icons. Account: save, log out, password,
  delete. Reading pages: edit, history, arrange, tag. E-books: add, download, covers; the reader's controls as icons.
- نشانات is now محفوظ شدہ; favourite writers have their own page, پسندیدہ لکھاری (/writers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:23:06 +02:00
3f6f7e503a Merge pull request 'E-books: a section for every poet (tabs, covers), right-to-left PDF reader, page bookmarks, book details' (#70) from feature/ebooks-section into main
Reviewed-on: #70
2026-10-09 13:17:31 +00:00
Anas Rashid
0a507d1fdd E-books as a section of every poet, with tabs and covers; a right-to-left PDF reader; page bookmarks; book details
- ای بکس card beside the poet's books and genres on every poet page; /<poet>/ebooks with tabs
  پی ڈی ایف (PDF) / ای پب (ePUB) / یونیکوڈ متن (Unicode) (+ آرکائیو when present) and a grid of covers.
- Covers: made in the moderator's browser from a PDF's first page (pdf.js) or an EPUB's cover (epub.js); archive.org's
  thumbnail; a styled card for text; or the moderator's own image. سرورق بنائیں on existing books.
- PDF reader (pdf.js) reading right to left: next page to the left (button, ← key, left half), facing pages with the
  cover alone then 2|3; left to right for LTR books; full screen (F); opens in a new tab; byte-range requests.
- Page bookmarks in the reader's library (kind 'page'), listed in نشانات and opening at that page.
- Details: writer as printed, co-authors (linked to poets on the site, who list the book too; new names kept as text),
  language, reading direction (RTL/LTR), extra tags (on tag pages), source, copyright, note; in upload and review.
- Word lookup and selection menu only on reading text, not menus, buttons or tabs.
- Schema: the library kind check lists 'page' where it is defined (it was re-added without it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:16:06 +02:00
cdfa5f9020 Merge pull request 'Fix publishing: URL is not a constructor' (#69) from fix/url-shadowing into main
Reviewed-on: #69
2026-10-09 12:59:04 +00:00
Anas Rashid
3fffbcc514 Fix publishing: a constant named URL hid the global URL (default divan-data folder), so every publish failed with 'URL is not a constructor'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:58:56 +02:00
b2746bfd08 Merge pull request 'Fix: e-books in the moderation queue and log had no title or link' (#68) from fix/ebook-queue-titles into main 2026-10-09 12:57:27 +00:00
Anas Rashid
4cf3c6cb8a E-books in the moderation queue and activity log: their title and link (were blank); rows say what kind of change they are
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:57:17 +02:00
6f96548f7a Merge pull request 'E-books: upload with its own permission, review, and viewers for PDF, EPUB, text and archive.org' (#67) from feature/ebooks into main
Reviewed-on: #67
2026-10-09 12:54:27 +00:00
Anas Rashid
09336ead0e E-books: a poet's books as PDF, EPUB, text (DOCX made text) or archive.org items, uploaded with their own permission and approved like any change
- ebooks permission (create, per poet); the upload button only for L2/L1 moderators with it (and admins).
- Files kept by SHA-256 in DIVAN_FILES_DIR (ab/cd/<sha>.<ext>; one copy per file), up to 100 MB, kind read from
  the bytes; details in PostgreSQL indexed by poet and trigram (title, text of text books); search shows e-books.
- An upload is a revision (entity 'ebook') through L2 -> L1 -> admin; unpublished files only for moderators;
  approved details committed to divan-data (divan/<poet>/ebooks/<id>.txt).
- ای بکس on the poet page; /ebook/<id>: PDF in the browser viewer, EPUB with epub.js, text, archive.org embed.
- README: e-books and the file store (attach growable block storage or an S3 bucket via rclone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:52:23 +02:00
67f0cdbd7f Merge pull request 'Footer tagline: made by a Pakistani, for Pakistan (with the flag)' (#66) from feature/footer-pakistan into main
Reviewed-on: #66
2026-10-09 12:45:09 +00:00
Anas Rashid
bafabb3d59 Footer tagline: ایک پاکستانی کی طرف سے، پاکستان کے لیے, with Pakistan's flag (SVG)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:44:29 +02:00
c2293f9794 Merge pull request 'Tags: typed tags on poets, books, works and couplets; tag pages; tag: in search' (#65) from feature/tags into main
Reviewed-on: #65
2026-10-09 12:43:56 +00:00
Anas Rashid
542c4672c9 Tags (#52): typed tags on poets, books/chapters, works and couplets; tag pages; tag: in search
- Types موضوع، صنف، بحر، شخصیت، مقام، دور and free ٹیگ; a work's tag may be on one couplet (شعر n, from 1).
- Tagging is a revision (tags-category / tags-work) through the L2 -> L1 -> admin pipeline with the new 'tags'
  permission; publishing writes divan-data/divan/<url>.tags, commits it and updates the site; the import reloads them.
- Pages show tag chips (couplet tags under the couplet); /tag/<type>/<name> lists what carries a tag; /tags lists all.
- Search: tag:عشق / ٹیگ:"حب الوطنی" filters works (tagged work, couplet or book), matching tags shown as a group.
- Tag editor rows with suggestions, Urdu keyboard and Roman typing.
- Tests run one file at a time (they share Ghalib's ghazals); the library test picks a ghazal with three couplets.
- Mod buttons sit in a div (a form closes a p, which broke the row).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:42:19 +02:00
1494c28776 Merge pull request 'Home sections editor: Urdu keyboard and Roman typing in its boxes' (#64) from feature/site-editor-keyboard into main
Reviewed-on: #64
2026-10-09 12:30:21 +00:00
Anas Rashid
8429ba1ddb Home sections editor: Urdu keyboard and Roman typing inside the name and section boxes, as in search
The keyboard finds its box again by id when a page redraws it (Base.astro), so it keeps typing into the
name box after a poet is added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:30:06 +02:00
0357a74778 Merge pull request 'Home page sections: a site permission to rename, add and reorder sections and sort their poets' (#63) from feature/site-sections into main
Reviewed-on: #63
2026-10-09 12:25:36 +00:00
8dd8cdf34b Merge pull request 'About page: دیوان کے بارے میں' (#62) from feature/about-page into main
Reviewed-on: #62
2026-10-09 12:25:18 +00:00
Anas Rashid
771ba54863 Home page sections (site permission): rename, add, remove and reorder sections; chosen poets; sort by hand, alphabetically or by timeline
- 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>
2026-10-09 14:24:43 +02:00
Anas Rashid
67525a0964 About page (/about): Ganjoor as the inspiration, Wikisource as the first source, open source, moderators and Divan's own copy, new writers, plans; linked from the footer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:20:16 +02:00
d4d8c92711 Merge pull request 'Arranging content: reorder works, sections and books (own permission)' (#61) from feature/arrange-content into main
Reviewed-on: #61
2026-10-09 12:05:54 +00:00
Anas Rashid
cde754412e Arranging content (#41): reorder a book or section's works and sub-sections, a poet's books
- 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>
2026-10-09 14:02:26 +02:00
0a4d1f7b0f Merge pull request 'Editor: live code view beside the editor; unchanged drafts are not kept' (#60) from feature/editor-code-view into main
Reviewed-on: #60
2026-10-08 23:21:09 +00:00
Anas Rashid
ed2973dea8 Editor: کوڈ shows the Divan text beside the editor, live; unchanged drafts are not kept
- کوڈ in the toolbar: the Divan text next to the editor (stacked on phones), updated as you type; the سورس tab still edits it.
- A draft is only listed (my drafts, history, activity) once its text differs from the text it started from;
  saving it unchanged drops it (compared as Divan text, so layout-only differences don't count) and says so;
  submitting an unchanged returned draft is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 01:20:05 +02:00
f8517aeb85 Merge pull request 'UI: poet cards (corner bookmark, one size, years on two lines); centred previous/next' (#59) from feature/poet-card-layout into main
Reviewed-on: #59
2026-10-08 23:13:33 +00:00
73cf7c5c4c Merge pull request 'Urdu content editor on Tiptap (structured editing, with the source view)' (#58) from feature/tiptap-editor into main
Reviewed-on: #58
2026-10-08 23:13:20 +00:00
Anas Rashid
ff814a7b76 Reading pages: previous/next buttons centred, پچھلا on the right and اگلا on the left
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 01:11:10 +02:00
Anas Rashid
ad82ad3957 Poet cards: years in Naskh so their lines stay compact (cards grew too tall in Brave with Nastaliq)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 01:09:50 +02:00
Anas Rashid
7ca1c68c52 Poet cards: one size for all (210px, two per row on phones); long names end in … with the full name on hover
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 01:07:33 +02:00
Anas Rashid
9e110d8241 Poet cards: keep the bookmark inside the side padding so it never covers the name (Safari's wider fallback font)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 01:05:30 +02:00
Anas Rashid
6451b615bd Poet cards: bookmark in the top-left corner (saved cards keep their size); Hijri and Gregorian years on separate lines, more padding
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 01:02:28 +02:00
Anas Rashid
f6d0742a97 Editor: keep the font's ligatures (Tiptap's CSS turns them off, which broke Nastaliq)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:58:12 +02:00
Anas Rashid
267c693c87 Urdu content editor on Tiptap (#28): structured editing of Divan text, with the source view
- web/src/lib/editor.ts (Tiptap 3 MIT core): verse units of misras (1 = مصرع, 2 = شعر, 3+ = بند, as in
  Divan text) with مطلع/حسن مطلع/مقطع labels, prose paragraphs, chapter headings and sub-headings, a
  dictionary-link mark, footnotes and variant readings; Enter adds a misra (or moves into the next
  empty one), Enter on an empty misra starts a new unit.
- Revision page: editor and source tabs over the same text, the work's data points as rows, a
  toolbar (couplet, paragraph, headings, labels, dictionary link, footnote, variant, undo/redo,
  Roman typing, Urdu keyboard). Saving always sends Divan text.
- Divan text: inline segments keep where links, footnotes and variants sit; toText writes a
  document back. All 11,087 works round-trip unchanged through toText and through the editor.
- The Urdu keyboard and Roman typing type into rich editors; the reader's word sidebar and
  selection menu stay out of editors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:53:17 +02:00
20df27bb26 Merge pull request 'Moderators' guide: how to write Divan text with all the tags' (#57) from feature/mod-guide into main
Reviewed-on: #57
2026-10-08 22:44:14 +00:00
271d826fc2 Merge pull request 'Publishing commits to divan-data git; public names only; 'last edited' on poems' (#56) from feature/git-publishing into main
Reviewed-on: #56
2026-10-08 22:44:06 +00:00
Anas Rashid
b605d2722b Moderators' guide (رہنمائی): writing Divan text with every tag, Urdu spelling, summaries and review
/mod/guide, open to all: the tag summary table; the work header; ghazal couplets (Hasrat Mohani);
stanzas (Hali's musaddas); prose chapters and sub-headings (Muhammad Husain Azad's Aab-e-Hayat);
matla/maqta labels; dictionary links, footnotes and variant readings; Urdu letters, punctuation,
digits, diacritics, ZWNJ compounds and spacing; edit summaries; the L2 -> L1 -> admin review.
Every example shows its source beside the site's own rendering (shared DivanPreview component,
also used on the revision page). Linked from the moderation tabs and the editor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:42:21 +02:00
Anas Rashid
93825fe5d9 Publishing commits to divan-data git (#34); public names only; 'last edited' on poems
- api/src/git.ts: each published version is a commit in the divan-data checkout (queued, one at a
  time): the moderator as author by public name with a placeholder email, the summary and version
  in the message, Reviewed-by / Approved-by / Divan-Revision / Divan-Version trailers;
  DIVAN_GIT_PUSH=1 pushes. The commit id is kept with the revision.
- Privacy fix: published files and commits carry public names (profile name, else 'موڈریٹر <id>'),
  never email addresses (divan-data is public).
- Poem pages: 'دیوان کا ورژن …' with who edited, reviewed and published, the date, and a link to
  the commit diff (DIVAN_DATA_COMMIT_URL).
- deploy/sync.sh: pull --rebase so publishing commits are kept.
- Admins are super moderators (documented).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:37:39 +02:00
acb8235403 Merge pull request 'Search box icons: search button; keyboard icons inside the poet name box' (#55) from feature/search-box-icons into main
Reviewed-on: #55
2026-10-08 22:34:59 +00:00
5929201efa Merge pull request 'Moderation: versions of works and the L2 → L1 → admin pipeline' (#54) from feature/moderation-pipeline into main
Reviewed-on: #54
2026-10-08 22:34:50 +00:00
835df62aad Merge pull request 'Divan-owned content: works edited in Divan, plus the content management model' (#53) from feature/divan-owned-content into main
Reviewed-on: #53
2026-10-08 22:34:40 +00:00
Anas Rashid
bf7c00d51d Search boxes: search icon at the far left of the top box; poet name box has the keyboard icons inside, like the top box
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:33:52 +02:00
Anas Rashid
19af91c594 Moderation: versions of works and the L2 -> L1 -> admin pipeline (#31, #51)
- revisions (a work's Divan text, summary, status, author/reviewer/publisher, the text it started from)
  and revision_events (who did what, with comments): the review thread and the moderation log.
- API (api/src/moderation.ts): what a moderator may do on a work, queue, drafts (one open draft per
  person and work), save, submit, approve, return/reject (reason required), publish; history; log.
  Rules come from the IAM grants: L2 drafts, an L1 covering the work reviews, an admin publishes; L1
  drafts go to the admin, admin drafts publish directly. Publishing numbers the version, writes it
  to divan-data (owned.ts) and updates the site; a draft based on an older version is refused (409).
- Line diff (api/src/diff.ts) against the text a draft started from.
- Site: ترمیم کریں / تاریخچہ on works, /mod (queue, activity log), /mod/rev/<id> (editor with the Urdu
  keyboard and Roman typing, diff, preview, actions, timeline), /mod/work/<id> (versions).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:31:47 +02:00
Anas Rashid
8d82527765 Divan-owned content (#30): write works as Divan text + generated JSON for divan-data; headings; content management model
- api/src/owned.ts: fromPoem (a work as Divan text, the start of an edit) and writeOwned (the .dtx
  source and the generated .json into divan-data/divan/); a CLI for writing one by hand.
- Divan text: chapter headings and sub-headings with levels, as their own verse entries.
- All 11,087 works convert to Divan text and back unchanged (apart from repeated spaces, and raw
  '== … ==' markers in prose becoming headings).
- docs/content-model.md: the content management model (what is identified, versions and who did
  what (#51), tags and tag search (#52), storage).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:22:31 +02:00
a9626b4d9e Merge pull request 'Research: content model and moderation (no wiki engine embedded; Divan text format)' (#49) from research/content-model into main 2026-10-08 22:16:18 +00:00
Anas Rashid
89231985b9 Merge remote-tracking branch 'gitea/main' into research/content-model 2026-10-09 00:16:13 +02:00
098a0185e6 Merge pull request 'Bookmark icon and wording: محفوظ کریں / محفوظ شدہ' (#48) from feature/bookmark-icon into main 2026-10-08 22:16:03 +00:00
Anas Rashid
6d1668b8d3 Merge remote-tracking branch 'gitea/main' into research/content-model 2026-10-09 00:15:49 +02:00