Open fsbraun opened 1 year ago
Yes, that point about it providing an example of how to extend functionality is real key one thay we should be able to demonstrate at launch.
And I don't actually know how it's done yet. I'd have a stab at it if I did.
I've got more thoughts but little time. The spiral of complexity is a big one. And nobody has even brought up timezones yet. 😬
Thanks for adding this important missing piece to djangocms-versioning. I just tested this pull request, but there are some issues:
@Aiky30 I get your point about separating this feature into another package. However, how would you implement it? And since it seems that some work has already been done, is this available?
I probably will implement this PR into our installation anyway, because it's a feature our users expect since it was available in CMS3. And I can't wait until a new package emerges anytime.
Description
Based on the discussion #340 this PR uses the power of djangocms-versionings' abstraction and introduces an option to limit the visibility of a published content object in time.
UX
New option to publish from the versioning menu (The "Publish" button does not change behavior.)
The menu brings up a modal allowing to select time limits for the visibility of the to-be-published version:
Technically, the time limits do not affect the published status but only the visibility. This means, dates on published versions cannot be changed any more. You'd need to create a new draft and publish that to make a change.
Versioning menu shows pending or expired visibility dates. "pending" is a word for a published version that is not yet visible. "expired" is a word for a published version not visible any more:
View published button for PageContents is only offered for pages which are currently visible (since otherwise they'll show a 404)
Pending or expired aliases render empty.
Tests
This is a proof of concept for discussion. Tests will need to be added and also some informaion on the changelist for versions.
Tests fail since the version admin's
publish_view
now also accepts a GET request which renders the form for time limits. Tests have now been adjusted, yetIssues
Related resources
340
Checklist
master