Commit graph

939 commits

Author SHA1 Message Date
Serafeim Papastefanos
6839a7474a Add management command for scheduled pages
The publish_scheduled_pages management command does three actions:

* Gets live pages which have an expiry_datetime that has passed and set
expired = True and live = False

* Gets all revisions on the moderation queue which have an expiry_datetime
that has passed and remove them from the moderation queue

* Gets all revisions that have an approved_go_live_datetime that has
passed. For each one of them the publish() method of the revision is
called which will perform the required actions for making live this
version of the page.

Finally, a dryrun parameter has been added to the management command. If
this parameter is used then the pages that pass the tests for each of the
above lists will be printed.
2014-04-21 21:48:23 +03:00
Serafeim Papastefanos
792b37d956 Add "expired" status to pages 2014-04-21 18:08:47 +03:00
Serafeim Papastefanos
89f2d76bfd Set expired = False when publishing pages both ...
in views and models and refactor code a bit.
2014-04-21 18:03:57 +03:00
Dave Cranwell
14913d0d1a added pagination to list of pages using a given content type 2014-04-17 14:03:52 +01:00
Dave Cranwell
99e599d940 Merge pull request #200 from davecranwell/master
removed breadcrumb from move interface
2014-04-16 11:07:11 +01:00
Dave Cranwell
121e1351cb removed breadcrumb from move interface 2014-04-16 11:06:50 +01:00
Serafeim Papastefanos
1ebe234a7e Add go_live_datetime handling on views/models
The logic for publishing a page exists in the create and edit views of
wagtailadmin.views.pages and in the publish methodd of hte PageRevision
model.

When a page is created and published (create view), if it has a go_live
in the future then it will not be live but the revision that will be
created will have the approved_go_live set to the corresponding datetime.
If the page is just saved or submitted for moderation the normal flow
will be followed.

When a page is edited and published (edit view):
* The approved_go_live_datetime will be cleared for all older revisions of
that page.
* If the edit has a go_live in the future then the new revision that will
be crated will have the approved_go_live set to that datetime. Also the
live attribute of the page will be set to False.
If the page is edited and not published the normal flow will be followed.

When a submitted for moderation page is published (publish method):
* If it has a go_live in the future then the live attribute will be set to
False, the approved_go_live_datetime of the revision will be set to the
go_live_datetime of the page and the approved_go_live_datetime of all
other revisions will be cleared.
* If it does not have a go_live in the future then the page will be live
and the approved_go_live_dattime of all other revisions will be cleard

Finally, if a page is unpublished then then approved_go_live_datetime of
all revisions of that page will be cleared.
2014-04-16 11:15:41 +03:00
Serafeim Papastefanos
a40c71687d Show clean model errors on edit also 2014-04-16 11:15:38 +03:00
Dave Cranwell
2c882efbee Merge pull request #195 from davecranwell/master
breadcrumb moved to an include and added on all page editor interfaces
2014-04-16 09:12:55 +01:00
Serafeim Papastefanos
e4c38302e0 Add fields for scheduled publishing
Also add a clean method to Page to check that expiry date is in the
future and that go live date is before expiry date. In order to display
the correct error message the views/pages.py view has to be changed to
display the error message from clean.

Finally add the migration for the new fields.
2014-04-15 21:55:24 +03:00
Matt Westcott
d3ac6c0728 changelog updates 2014-04-14 13:18:41 +02:00
benemery
e82eb54101 Prevent DB lookups with local cache of filters 2014-04-14 13:11:27 +02:00
Matt Westcott
2939a5015d keep translations in alpha order 2014-04-14 10:05:51 +02:00
gilsondev
1e87b2a8dd Insert responsible of translation in Portuguese Brazil 2014-04-14 10:05:51 +02:00
gilsondev
2e9e43a66a Fix python formats and compile messages 2014-04-14 10:05:51 +02:00
gilsondev
6ae99ccd4d Delete temporary file 2014-04-14 10:05:51 +02:00
gilsondev
af9684146e Fix message moderation 2014-04-14 10:05:51 +02:00
gilsondev
4750d79a10 Translation to Portuguese Brazil 2014-04-14 10:05:51 +02:00
Dave Cranwell
9599f16567 breadcrumb moved to an include and added on all page editor interfaces 2014-04-11 11:30:39 +01:00
Dave Cranwell
8afd7e6088 ensuring classes are consistent 2014-04-09 12:11:53 +01:00
Dave Cranwell
e2cf9f16e4 preview buttons (and dropdowns generally) improve a little 2014-04-09 12:00:07 +01:00
Matt Westcott
2411123cd9 add Ben Emery to contributors 2014-04-08 17:14:22 +01:00
Matt Westcott
b22d9755f6 Merge branch 'master' of https://github.com/benemery/wagtail into benemery-master 2014-04-08 17:11:44 +01:00
Karl Hobley
a3d58126fd Merge pull request #191 from kaedroho/page-changes
Override a few treebeard methods to add inclusive flag
2014-04-08 17:03:17 +01:00
Karl Hobley
d569edc136 get_siblings now defaults to inclusive=True 2014-04-08 16:53:12 +01:00
Karl Hobley
95bb84dd0e Override a few treebeard methods to add inclusive flag 2014-04-08 16:44:35 +01:00
Matt Westcott
75b127a07c Support within wagtailadmin for selecting a view mode in which to preview a page.
The 'preview' option is split out from the 'save' popup menu into its own button (it was deemed appropriate to split it off since it doesn't perform any database-level actions). If the page defines multiple page modes in get_page_modes, this button becomes a popup, allowing the editor to choose a mode. Finally, preview_on_create and preview_on_edit are updated to pass the chosen mode into the page's show_as_mode method.
2014-04-08 16:14:30 +01:00
Karl Hobley
128516922f Merge pull request #185 from kaedroho/pagequery
Page QuerySet
2014-04-08 12:55:20 +01:00
Karl Hobley
e44dfee94c PageQuerySet live/type tests now check that the methods return certian objects 2014-04-08 12:48:42 +01:00
Matt Westcott
d6cab0a10e Add get_page_modes and show_as_mode methods to Page.
This abstracts out from the preview methods the details of how the page is generated.
2014-04-08 11:36:08 +01:00
benemery
c382ef6b7e Don't use URLify if a user has manually set a slug
Not a big deal, and can easily be handled by using the available js_hook,
but this has annoyed the hell out of me and others may find it useful.
2014-04-08 00:00:44 +01:00
Serafeim Papastefanos
4fc653ff9a Fix code for pep8 compatibility 2014-04-07 23:30:00 +03:00
Matt Westcott
f0aee82906 Add a dummy_request method to Page so that we can generate page previews without passing in the active request object (which may have undesirable side effects, e.g. may be a POST) 2014-04-07 20:08:33 +01:00
Karl Hobley
6c0d543423 Tweaks to PageQuerySet.not_descendant_of tests 2014-04-07 19:41:59 +01:00
Karl Hobley
d85f4c3eb5 Added changelog entry 2014-04-07 19:23:00 +01:00
Karl Hobley
d101e18109 Added unit tests for PageQuerySet 2014-04-07 19:22:45 +01:00
Karl Hobley
fe9ce7503e Add PageManager which returns PageQuerySet objects 2014-04-07 16:51:14 +01:00
Karl Hobley
0cbe15b741 Make PageQuerySet inherit from treebeards MP_NodeQuerySet 2014-04-07 16:08:07 +01:00
Matt Westcott
f971b24f96 changelog updates 2014-04-07 15:53:30 +01:00
Karl Hobley
b48d0c6fa2 PageQuerySet: renamed 'ascendant' to 'ancestor' 2014-04-07 15:47:28 +01:00
Karl Hobley
90a0695076 Added inclusive flag to ascendent_of, descendant_of and sibling_of 2014-04-07 15:38:42 +01:00
Karl Hobley
a307393c2b Added 'page' attribute to PageQuerySet 2014-04-07 15:38:02 +01:00
Karl Hobley
a8ff69a2b0 Added PageQuerySet 2014-04-07 13:54:53 +01:00
Matt Westcott
49211cd69c Set a default IMAGE_COMPRESSION_QUALITY of 85 as per @tomdyson's suggestion, and simplify image backend now that it doesn't have to check for the presence of a quality setting 2014-04-07 12:33:03 +01:00
Matt Westcott
98e4d74c80 a spot of PEP8 cleanup on pillow.py / wand.py 2014-04-07 12:33:03 +01:00
Matt Westcott
626edda50d Change slug cleaning to only happen on blur, not every keypress - fixes #132
a854c03f443083a1471dd066dece92527dbb7c7c improves the behaviour a lot, but it's
still fairly nasty for a text field to be rewriting text as you type it. It's
also unnecessary - you have to be pretty determined to submit the form without
triggering the blur event on the field, and if you do, all that happens is that
you fail server-side validation.
2014-04-07 12:33:03 +01:00
Serafeim Papastefanos
9bd91848e0 Add support for setting global image compression..
quality. Uses an IMAGE_COMPRESSION_QUALITY in the settings.py, which, if
set, will set a quality attribute in the image processing backends. Each
image processing backend then can use the quality attribute in its "save"
method.

This has been implemented in both Pillow and Wand backends. It has been
tested with image that support this setting (JPG) and images that do not
support it (GIF, PNG) and the behavior is consistent.

This is an implementation for #163.
2014-04-07 12:33:03 +01:00
Serafeim Papastefanos
b442bab7a7 Fix bug introduced by a1c9224
The a1c9224 commit allowed page editing only when their slug had been
changed!
2014-04-07 12:33:03 +01:00
Serafeim Papastefanos
c1ac89ceb7 Improve JS behavior when editing slug (fixes #132) 2014-04-07 12:33:03 +01:00
Serafeim Papastefanos
0b89334eba Add check for slug when editing page (fixes #119) 2014-04-07 12:33:03 +01:00