<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cccms/app/controllers/shared_previews_controller.rb, branch master</title>
<subtitle>[no description]</subtitle>
<id>https://erdgeist.org/gitweb/cccms/atom?h=master</id>
<link rel='self' href='https://erdgeist.org/gitweb/cccms/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://erdgeist.org/gitweb/cccms/'/>
<updated>2026-07-13T15:09:45Z</updated>
<entry>
<title>Fix shared preview redirecting to admin for an ordinary new draft</title>
<updated>2026-07-13T15:09:45Z</updated>
<author>
<name>erdgeist</name>
<email>erdgeist@erdgeist.org</email>
</author>
<published>2026-07-13T15:09:45Z</published>
<link rel='alternate' type='text/html' href='https://erdgeist.org/gitweb/cccms/commit/?id=40adeec1bcc6fa276d765e3b9c37e781c64a48c1'/>
<id>urn:sha1:40adeec1bcc6fa276d765e3b9c37e781c64a48c1</id>
<content type='text'>
superseded/currently_public used published_at presence as a proxy
for page-row relevance, but published_at is carried forward onto
every new draft descended from previously-published content
(Page#clone_attributes_from, Node#save_draft!) -- so it read true
for any draft on an already-published node, whether or not that
specific draft had ever gone live itself. Compare draft_id/head_id
identity directly instead; no timestamp involved. A stale
(superseded) link now redirects to the live public page rather than
an admin URL an anonymous holder can't reach anyway.
</content>
</entry>
<entry>
<title>Fix shared preview links breaking after a second publish</title>
<updated>2026-07-06T11:52:28Z</updated>
<author>
<name>erdgeist</name>
<email>erdgeist@erdgeist.org</email>
</author>
<published>2026-07-06T11:52:28Z</published>
<link rel='alternate' type='text/html' href='https://erdgeist.org/gitweb/cccms/commit/?id=889e15eabbe107d2642fdd8aa3f03821058c00dc'/>
<id>urn:sha1:889e15eabbe107d2642fdd8aa3f03821058c00dc</id>
<content type='text'>
A token's page could stop being node.head_id (superseded by a newer
draft) while still being published_at.present? - the old check only
compared against the current head, so a superseded page fell through
to direct rendering instead of redirecting, serving a stale frozen
snapshot indefinitely instead of the current live content.

Also handles scheduled publishing correctly: a page can be head_id but
not yet public? (published_at in the future) - that case must still
render directly, not redirect into a 404 on the not-yet-live public
URL.
</content>
</entry>
<entry>
<title>Add public preview links for drafts</title>
<updated>2026-07-06T04:09:21Z</updated>
<author>
<name>erdgeist</name>
<email>erdgeist@erdgeist.org</email>
</author>
<published>2026-07-06T04:09:21Z</published>
<link rel='alternate' type='text/html' href='https://erdgeist.org/gitweb/cccms/commit/?id=9e63a6bec1b4ccc45dd684f7b6a941b75f9b9cf0'/>
<id>urn:sha1:9e63a6bec1b4ccc45dd684f7b6a941b75f9b9cf0</id>
<content type='text'>
Lets editors share a draft with people outside the admin system, via a
random per-page token rather than an enumerable id - /preview/&lt;token&gt;.
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.
</content>
</entry>
</feed>
