Content display, requests and Google Workspace (v1.9.5 to v1.9.11-content-display) #15

Merged
ngu-git-admin merged 20 commits from content-display into main 2026-09-30 02:34:53 +01:00

Content display, requests and Google Workspace (v1.9.5 to v1.9.11-content-display). 13 changes, migrations 044 to 048.

Content

  • Import from Word (Blog posts → Import from Word): a .docx becomes an unpublished post: title, date, headings, paragraphs, lists, tables, bold, italic, links. docs/importing.md.
  • New block types: Table (a row per line, cells split by |; migration 044) and Link cards (picture, title, description, the whole card a link; Fetch preview fills them; migration 045).
  • Download a blog post as PDF: print layout with the author, cover, and a link and QR code to the post.
  • Blog posts moved from Pages to Data in the admin menu.

Request form (/request, migration 046)

  • One form for a blog post, event, chapter, region (updates only), partner, team, award or person, with up to 3 files (.docx, PDF, JPEG, PNG). ?type= picks the kind; buttons on the Community sections, blog posts, Retreats and the front page calendar (none for people, teams or awards).
  • Forms → Content requests: same triage as feedback, files download from Drive, and a .docx can become a draft blog post.
  • Email notices for new content and data requests (Site settings → Notices), with a Send a test notice button.

Google Workspace (one service account, no new libraries)

  • Drive: files live in named folders of one shared drive (GOOGLE_SHARED_DRIVE, the bare id): "Requests" (private) and "Media".
  • File library (Tools → Media → Files, migration 048): PDF, Office, MP3, M4A and zip files up to 50 MB, shared as anyone with the link can view. Files added to the Media folder in Drive by hand are picked up. Content block links get Choose a file, and link cards take the file's first-page preview.
  • Admin access from Google groups (Site settings → Access, migration 047): a group per role (admin, editor, viewer). Accounts are made at first Google sign-in and their role follows the group (checked at sign-in, hourly, and by Panel → Re-sync now). Superadmins and admin-cli accounts are never changed. Panel → Check their groups tests an email.

Fixes

  • The last glyph icons (✕, +, ⧉, ♪, ▾, ▴, ◌, ✓) replaced with Phosphor.
  • A reply from nginx rather than the API (a 413, 502 or 504) now says what happened, instead of "Server did not return JSON".
  • Hidden-field clearing when two fields share a path.

Testing

  • Type-check and build pass.
  • End-to-end scripts on throwaway databases, with Google faked at fetch, cover the request form, test notices, group access and the file library.
  • Not yet checked in a browser.

Deploying

Migrations 044 to 048 run at boot. Also needed:

  • nginx blocks (nginx-dev has them): /api/admin/import/docx (11m), /api/requests (31m), /api/admin/files (51m).
  • Service account and shared drive: GOOGLE_SERVICE_ACCOUNT and GOOGLE_SHARED_DRIVE (this replaces GOOGLE_DRIVE_FOLDER). If Drive has a "Blog" folder, rename it to "Media".
  • Gmail: GOOGLE_MAIL_FROM must be a user, not a group.
  • Group lookups: GOOGLE_DIRECTORY_AS, plus the Admin SDK API and the admin.directory.group.member.readonly scope added to the delegation.
  • Sharing outside the organization must be allowed for the Media files, both in the Workspace and on the shared drive.

Details: docs/google-drive-and-mail.md, docs/google-sign-in.md, docs/importing.md, and the TODO's deploy items.

🤖 Generated with Claude Code

Content display, requests and Google Workspace (v1.9.5 to v1.9.11-content-display). 13 changes, migrations 044 to 048. ## Content - **Import from Word** (Blog posts → Import from Word): a .docx becomes an unpublished post: title, date, headings, paragraphs, lists, tables, bold, italic, links. `docs/importing.md`. - **New block types:** Table (a row per line, cells split by `|`; migration 044) and Link cards (picture, title, description, the whole card a link; Fetch preview fills them; migration 045). - **Download a blog post as PDF:** print layout with the author, cover, and a link and QR code to the post. - Blog posts moved from Pages to Data in the admin menu. ## Request form (`/request`, migration 046) - One form for a blog post, event, chapter, region (updates only), partner, team, award or person, with up to 3 files (.docx, PDF, JPEG, PNG). `?type=` picks the kind; buttons on the Community sections, blog posts, Retreats and the front page calendar (none for people, teams or awards). - Forms → Content requests: same triage as feedback, files download from Drive, and a .docx can become a draft blog post. - Email notices for new content and data requests (Site settings → Notices), with a **Send a test notice** button. ## Google Workspace (one service account, no new libraries) - **Drive:** files live in named folders of one shared drive (`GOOGLE_SHARED_DRIVE`, the bare id): "Requests" (private) and "Media". - **File library** (Tools → Media → Files, migration 048): PDF, Office, MP3, M4A and zip files up to 50 MB, shared as anyone with the link can view. Files added to the Media folder in Drive by hand are picked up. Content block links get **Choose a file**, and link cards take the file's first-page preview. - **Admin access from Google groups** (Site settings → Access, migration 047): a group per role (admin, editor, viewer). Accounts are made at first Google sign-in and their role follows the group (checked at sign-in, hourly, and by Panel → Re-sync now). Superadmins and admin-cli accounts are never changed. Panel → Check their groups tests an email. ## Fixes - The last glyph icons (✕, +, ⧉, ♪, ▾, ▴, ◌, ✓) replaced with Phosphor. - A reply from nginx rather than the API (a 413, 502 or 504) now says what happened, instead of "Server did not return JSON". - Hidden-field clearing when two fields share a path. ## Testing - Type-check and build pass. - End-to-end scripts on throwaway databases, with Google faked at `fetch`, cover the request form, test notices, group access and the file library. - Not yet checked in a browser. ## Deploying Migrations 044 to 048 run at boot. Also needed: - **nginx blocks** (`nginx-dev` has them): `/api/admin/import/docx` (11m), `/api/requests` (31m), `/api/admin/files` (51m). - **Service account and shared drive:** `GOOGLE_SERVICE_ACCOUNT` and `GOOGLE_SHARED_DRIVE` (this replaces `GOOGLE_DRIVE_FOLDER`). If Drive has a "Blog" folder, rename it to "Media". - **Gmail:** `GOOGLE_MAIL_FROM` must be a user, not a group. - **Group lookups:** `GOOGLE_DIRECTORY_AS`, plus the Admin SDK API and the `admin.directory.group.member.readonly` scope added to the delegation. - **Sharing outside the organization** must be allowed for the Media files, both in the Workspace and on the shared drive. Details: `docs/google-drive-and-mail.md`, `docs/google-sign-in.md`, `docs/importing.md`, and the TODO's deploy items. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ngu-git-admin added 20 commits 2026-09-30 02:03:20 +01:00
- Table content blocks (migration 044): a grid of text, a row per
  line, cells split by |, the first row the header; cells take the
  same formatting as a paragraph; wide tables scroll on a phone
- Blog posts -> Import from Word: the server reads the .docx (zip and
  XML read without a library, sizes capped) and creates an unpublished
  post through the CRUD engine: title, date, headings, paragraphs,
  lists, tables, bold, italic and links; the editor opens with a note
  of what came over and what didn't (images)
- docs/importing.md, and an nginx block for the upload

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Download PDF beside the byline opens the browser's print dialog (Save
as PDF) with a print layout: the site's header, footer and notices
hidden, the contents column dropped, the light palette whatever the
screen shows, and at the bottom the post's link and a QR code of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "cards" content block: each item is a card with a picture, title and
description that links somewhere, like a link shared in a chat. Fetch
preview fills the card from the link. Migration 044 (not deployed yet)
now allows both table and cards.

Also fixes hidden-field clearing when two fields share a path, and adds
table and card blocks to the showcase post.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
044 had already run with only the table type, so a database that ran
it would never see the edited CHECK, and boot would refuse the cards
type. 044 is back as it was; 045 rebuilds content_blocks to allow
cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One form at /request for blog posts, events, and new or updated
chapters, regions (updates only), partners, teams, awards and people.
?type= opens it on one; buttons on the Community sections, blog posts,
Retreats and the front page calendar do. Files (.docx, PDF, JPEG, PNG)
go to a Google Drive folder through a service account.

Requests are feedback rows of type 'content' (migration 046), in a
third Forms queue: files download from Drive, a .docx can become a
draft blog post, and deleting a request deletes its files. New content
and data requests email the addresses in Site settings through Gmail.

Setup: docs/google-drive-and-mail.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GOOGLE_SHARED_DRIVE (the shared drive's bare id) replaces
GOOGLE_DRIVE_FOLDER. driveUpload takes a folder path, found by name in
the shared drive or made the first time, so each use gets its own
folder: "Requests" for the Request form now, others later. The docs
say plainly that the setting is the id only, not the address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Panel → Site settings → Notices → Send a test notice emails the
addresses in the box now and shows where it came from, or Google's
reason for refusing, so the Gmail setup can be checked without the
journal. Superadmins only (POST /api/admin/panel/test-notice).

The docs now say the sender must be a Workspace user: a group can't
be acted as through delegation, though it can receive notices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Site settings → Access names a group for each of admin, editor and
viewer (migration 047). Someone in one who signs in with Google gets a
Google-only account with their highest group's role, and the role
follows the groups: at every sign-in, hourly while signed in, and on
Panel → Google groups → Re-sync now. Out of every group, the account
is disabled and signed out until they're back in one.

Group accounts' roles are locked in the Panel; a superadmin's Disable
sticks. Superadmins and admin-cli accounts are never changed. If
Google can't be asked, sign-ins are refused but the hourly check
leaves accounts alone. Panel → Check their groups tests an email.

Lookups use the service account through the Directory API as
GOOGLE_DIRECTORY_AS. Setup: docs/google-sign-in.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools → Media → Files uploads PDF, Office (.docx, .xlsx, .pptx), MP3,
M4A and zip files, up to 50 MB, to the shared drive's Blog folder and
shares each as anyone with the link can view (migration 048). A file's
name and contents must agree.

Content block links get "Choose a file" (paragraph, button and image
links, list and link items, link cards). A link card also takes the
file's name and Drive's picture of its first page, fetched after
upload and saved into the image library; cards to Drive say "Google
Drive". Deleting a file says first what still links to it.

Setup and the nginx block: docs/google-drive-and-mail.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening Tools → Media → Files (or a Choose a file picker) now looks in
the shared drive's Blog folder, at most every 30 seconds, and adds
anything put there in Drive itself: shared as anyone with the link,
previewed, Google Docs, Sheets and Slides included, folders and
shortcuts left out. A file Drive won't share is named in a note and
tried again every ten minutes.

A reply that isn't the API's (nginx's own error page) now says what it
was: a 413 names nginx's upload limit, a 502 the service, a 504 the
timeout, instead of "Server did not return JSON".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The folder isn't only for blog posts. A Blog folder made before this
can be renamed to Media in Drive; its files keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The editor's insert, duplicate and remove buttons, the image
library's close button and audio tile, the schedule's fold-out caret,
the admin menu's caret, the history timeline's caret and gap marker,
and the QR page's copied tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ngu-git-admin merged commit f797e2c509 into main 2026-09-30 02:34:53 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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: ngu-git-admin/NGU-Web#15
No description provided.