diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-06 06:09:21 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-06 06:09:21 +0200 |
| commit | 9e63a6bec1b4ccc45dd684f7b6a941b75f9b9cf0 (patch) | |
| tree | 8c7842b3703ad2224deace37f9bd48df3374349b /config | |
| parent | b547decd1f85b43d5fb9e86cd7462b455059b1d1 (diff) | |
Add public preview links for drafts
Lets editors share a draft with people outside the admin system, via a
random per-page token rather than an enumerable id - /preview/<token>.
shared_previews#show is intentionally unauthenticated. Redirects to the
real public URL once the page is published. Surfaced on nodes#show
(Admin Preview + Public Preview, next to Public Link) as generate/revoke
buttons.
Diffstat (limited to 'config')
| -rw-r--r-- | config/routes.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb index 6c07414..26c3d4d 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -38,6 +38,8 @@ Cccms::Application.routes.draw do | |||
| 38 | member do | 38 | member do |
| 39 | put :unlock | 39 | put :unlock |
| 40 | put :publish | 40 | put :publish |
| 41 | put :generate_shared_preview | ||
| 42 | put :revoke_shared_preview | ||
| 41 | end | 43 | end |
| 42 | 44 | ||
| 43 | resources :revisions do | 45 | resources :revisions do |
| @@ -50,6 +52,8 @@ Cccms::Application.routes.draw do | |||
| 50 | end | 52 | end |
| 51 | end | 53 | end |
| 52 | 54 | ||
| 55 | get 'preview/:token', to: 'shared_previews#show', as: :shared_preview | ||
| 56 | |||
| 53 | scope '/admin' do | 57 | scope '/admin' do |
| 54 | resources :assets | 58 | resources :assets |
| 55 | end | 59 | end |
