Files
RenewCMS/docs/design/screens/sites.md
T

8.9 KiB
Raw Blame History

Sites

Route: /settings/sites. API: GET /v1/site/ · POST /v1/site/ · PATCH /v1/site/{id} · DELETE /v1/site/{id}?reassign_to={id}.

A site is a frontend that displays content: name, key, base URL, default social image, default robots policy, optional locale and a default flag. Each article belongs to exactly one site. A default site always exists and cannot be deleted; the first is seeded once, at migration, from PUBLIC_URL (the CMS's own address, so only a starting value: the owner is expected to set the frontend's address). The base URL must use https, except for loopback hosts (localhost, 127.0.0.1, ::1), so a local frontend works. is_online stays the global publish switch.

Roles. Only the owner can create, edit, set the default or delete a site. Admins and other roles don't see the Sites entry under Settings, and the "Publishing" card is hidden for them. A direct link to /settings/sites shows a 403 page. Choosing a site for an article is not site management: anyone who can edit an article can set its site in the editor and read the site list (GET /v1/site/).

Site key. The key is set when the site is created and can't be edited afterwards. The edit form shows it read-only with a lock and the text "Used in API paths, so it can't change." There is no editable-key state and no key-change warning.

Shared pieces. The list, slide-over, delete-with-reassign dialog, slug field and media field are defined once in DirectoryFrame.dc.html and referenced by both Sites and Authors; nothing is drawn separately for either screen. AppFrame.dc.html holds the shell (sidebar, Settings card, editor section, Profile card).

Visual reference: RenewCMS Screens Back-office.dc.html, groups "Sites", "Sites: form", "Sites: delete". Every state is drawn in light and dark (theme switch) at 1440×900 and 390×844. Copy is exact. Strings in a Copy cell are separated by " · " and listed in reading order. Dialog and form submit states ("Saving…", "Moving articles…") use the button loading pattern from the controls matrix and are not drawn per screen.

Sites (group "Sites", 9 states)

Only the owner can create, edit, set the default or delete a site. Other roles don't see the Sites entry under Settings; a direct link shows a 403 page. A site name can still appear read-only in the article editor and the Articles list. New child of Settings, under a "Publishing" heading in the sidebar (Settings also gets a "Publishing" card with a "Manage sites" row, owner only). Columns: name with key, base URL, article count. The default site carries a "Default" badge and has no delete action. A site with robots set to noindex shows a "Noindex" badge. List, row menu and dialogs come from DirectoryFrame and are shared with Authors.

# State Trigger Copy
1 Default The list loaded. Four sites, Renew is the default. Owner only. Sites · The frontends that display your content. · Add site · Site · Base URL · Articles · Default · Noindex · 268 articles · 38 articles · 6 articles · No articles
2 Only the default site First run: the seeded site only. A hint under the list, no empty-state wall. Add another site if your content is shown on more than one frontend. Each article belongs to one site.
3 Loading The first load, or a retry. Skeleton rows appear after 150 ms.
4 Error A 500 or network failure on the list request. Couldn't load sites · Check your connection and try again. · Try again
5 Row menu The ellipsis button, or Enter on the focused menu button. Mobile: bottom sheet titled with the site name. Edit · Set as default · Delete…
6 Default site: delete unavailable Menu on the default site. "Delete…" is aria-disabled, stays focusable and explains itself: tooltip on desktop, text in the sheet on touch. The default site can't be deleted. Make another site the default first.
7 Set as default: confirm "Set as default" in the row menu. On 200 the badge moves and a toast confirms. The button reads "Saving…" while the request runs. Make Journal the default site? · New articles start on this site. Articles that are already on other sites stay where they are. · Cancel · Make default · Default site changed · "Journal" is now the default site.
8 Hidden entry (admin) An admin opens Settings. The sidebar has no Publishing group and no Sites entry, and the page has no Publishing card. Roles without Settings have nothing to hide. No Publishing group · No Sites entry · No "Manage sites" row
9 Forbidden (403) A role other than owner opens /settings/sites from a bookmark or a link. The sidebar has no Sites entry, so the page explains instead of redirecting. The API answers 403. You don't have access to Sites · Only the owner can manage sites. Ask the owner of this site if you need a change. · Back to Settings

Sites: add and edit (group "Sites: form", 7 states)

Owner only. A slide-over, because the form has a live preview (the canonical URL). Fields: name, key, base URL, default social image (media picker), default robots policy, optional locale, default switch. The key is set when the site is added and can't be edited afterwards: the edit form shows it read-only with a lock and the text "Used in API paths, so it can't change." Closing with changes asks "Discard changes?" with the existing discard dialog. The slug field, media field and picker are the shared ones from DirectoryFrame (the picker is drawn once, in Authors: form). Locale error: "Use a language tag like en or fr-CH."

# State Trigger Copy
1 Add: empty "Add site" in the page header, or the bottom button on mobile. Add site · Name · e.g. Journal · Key · Generated from the name · Base URL · https://blog.example.com · The public address of the frontend. Use https and no path. · Default social image (optional) · Choose image · Used when an article has no image of its own. · Default robots policy · Index · Noindex · Search engines may list this site's pages. · Locale (optional) · e.g. en or fr-CH · A language tag. Leave empty if the site has no single language. · Make this the default site · New articles start here. The current default is Renew. · Canonical URL preview · Cancel · Add site
2 Add: key from the name Typing a name fills the key. The pencil unlocks it until the site is added. journal · Auto · Lowercase letters, numbers and hyphens. Used in API paths. It can't be changed after the site is added.
3 Add: URL not valid On blur or submit. Nothing is sent. A URL with a path and text that is not a URL get their own messages, drawn the same way. Use https. For example https://blog.example.com. · Remove the path. Use only the host, like https://blog.example.com. · Enter a full URL, like https://blog.example.com.
4 Add: duplicate key 409 on submit, or on blur after a check. A site with the key "journal" already exists. Choose another key. · Use journal-2
5 Add: save failed 500 or network failure. The values stay. Couldn't save the site. Your changes are still here. Try again in a moment.
6 Edit: default site Edit on the default site. The key is read-only with a lock, because it is used in API paths. The switch is on and locked. Edit Renew · Key · renew · Used in API paths, so it can't change. · Default site · New articles start on the default site. To change it, make another site the default. · Save changes
7 Edit: other site, noindex Edit on a non-default site. Edit Projects · Key · projects · Used in API paths, so it can't change. · Noindex · Asks search engines not to list this site's pages. · Make this the default site

Sites: delete (group "Sites: delete", 3 states)

Owner only. A site with articles cannot be deleted without a destination: the dialog has a select and shows how many articles move. Destination defaults to the default site. Without reassign_to the server answers 409. This is the shared ReassignDialog from DirectoryFrame; its failed state is drawn once, in Authors: delete.

# State Trigger Copy
1 With articles "Delete…" on a site that has articles. The button reads "Moving articles…" while the request runs. On 204 the row leaves the list and a toast reads "Site deleted" · "38 articles moved to Renew." Delete this site? · "Journal" will be deleted. 38 articles belong to it, so choose a site to move them to. This can't be undone. · Move articles to · Renew · renew.example · 38 articles will move to Renew. Their canonical host changes to renew.example. · Cancel · Move 38 articles and delete
2 Choose destination The select is open. The site being deleted is not listed. Journal is not offered. Options show name and host.
3 No articles A site with zero articles: plain confirm, no select. Delete this site? · "Archive" will be deleted. No articles belong to it. This can't be undone. · Delete site