Editable content #229

Merged
greg merged 15 commits from feature/186-content_editing into master 2025-05-30 11:14:51 +00:00
Owner

Make some of the content editable.

  • Add new table and model for editable contents. Contents are defined by a context and key, with the context ideally being a path (but not required) and the key identifying the unique piece of content. A rich_text boolean determines if content is editable and rendered as either a string or (GitHub-flavored) Markdown. A lang field is set to "en" by default, for future i18n.
  • A new EditableContentComponent can be used to render editable content
  • A new EditContentButtonComponent can be used for showing an edit button, which will open a modal with the correct content editing UI
  • Only admins can edit content (quelle surprise!)
  • The first editable contents are the title/menu and body text of "contributions/other" (ex "projects")
  • This PR removes the special ks-text-link class, so that links in editable content render with the default link style, without having to add classes to the Markdown source
  • Markdown content can contain arbitrary HTML, not just plain text
  • The best editing is no editing at all, so this PR also removes all Kosmos-specific language from service pages
  • Add a Pages controller, Privacy and ToS pages, and a footer menu to reach them (sticks to the bottom of either the screen or the content, whichever is taller)

closes #186
refs #222

Note: I initially added ActionText, only to find out that it's not the right solution for the problems solved in this PR. I left the commit, so it can easily be re-added in the future from that, if necessary.

Make some of the content editable. * Add new table and model for editable contents. Contents are defined by a `context` and `key`, with the context ideally being a path (but not required) and the key identifying the unique piece of content. A `rich_text` boolean determines if content is editable and rendered as either a string or (GitHub-flavored) Markdown. A `lang` field is set to "en" by default, for future i18n. * A new `EditableContentComponent` can be used to render editable content * A new `EditContentButtonComponent` can be used for showing an edit button, which will open a modal with the correct content editing UI * Only admins can edit content (quelle surprise!) * The first editable contents are the title/menu and body text of "contributions/other" (ex "projects") * This PR removes the special `ks-text-link` class, so that links in editable content render with the default link style, without having to add classes to the Markdown source * Markdown content can contain arbitrary HTML, not just plain text * The best editing is no editing at all, so this PR also removes all Kosmos-specific language from service pages * Add a Pages controller, Privacy and ToS pages, and a footer menu to reach them (sticks to the bottom of either the screen or the content, whichever is taller) closes #186 refs #222 Note: I initially added ActionText, only to find out that it's not the right solution for the problems solved in this PR. I left the commit, so it can easily be re-added in the future from that, if necessary.
raucao added the
ui/ux
feature
labels 2025-05-29 10:26:44 +00:00
raucao added 11 commits 2025-05-29 10:26:45 +00:00
raucao added 1 commit 2025-05-29 11:44:56 +00:00
Remove special link class
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
843bcd8cb9
This cleans up the code quite a bit, but also allows links in editable
content to be rendered with the default style.
raucao added the
kredits-2
label 2025-05-29 11:46:46 +00:00
raucao force-pushed feature/186-content_editing from 843bcd8cb9 to 29a67ff870 2025-05-29 12:07:34 +00:00 Compare
raucao force-pushed feature/186-content_editing from 29a67ff870 to f1d9cf1e3d 2025-05-29 12:10:41 +00:00 Compare
raucao added 1 commit 2025-05-29 12:24:41 +00:00
Fix tab links
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
67c450860a
raucao added 1 commit 2025-05-29 13:26:48 +00:00
Fix link color for Devise links
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
32cd4d896d
raucao changed title from WIP: Editable content to Editable content 2025-05-29 13:35:20 +00:00
raucao added 1 commit 2025-05-30 09:27:34 +00:00
Add Privacy and ToS pages, footer menu
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 3s
f2e8ca790c
greg approved these changes 2025-05-30 11:13:03 +00:00
greg left a comment
Owner

Looking good 👍

Looking good 👍
greg merged commit eefdc88a47 into master 2025-05-30 11:14:51 +00:00
greg deleted branch feature/186-content_editing 2025-05-30 11:14:51 +00:00
Sign in to join this conversation.
No description provided.