mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
allows pages to have draft status, like articles
This commit is contained in:
parent
ee24ad1821
commit
576229ad19
12 changed files with 108 additions and 17 deletions
|
|
@ -444,10 +444,14 @@ class Content(object):
|
|||
|
||||
class Page(Content):
|
||||
mandatory_properties = ('title',)
|
||||
allowed_statuses = ('published', 'hidden')
|
||||
allowed_statuses = ('published', 'hidden', 'draft')
|
||||
default_status = 'published'
|
||||
default_template = 'page'
|
||||
|
||||
def _expand_settings(self, key):
|
||||
klass = 'draft_page' if self.status == 'draft' else None
|
||||
return super(Page, self)._expand_settings(key, klass)
|
||||
|
||||
|
||||
class Article(Content):
|
||||
mandatory_properties = ('title', 'date', 'category')
|
||||
|
|
@ -472,7 +476,7 @@ class Article(Content):
|
|||
self.date = SafeDatetime.max
|
||||
|
||||
def _expand_settings(self, key):
|
||||
klass = 'article' if self.status == 'published' else 'draft'
|
||||
klass = 'draft' if self.status == 'draft' else 'article'
|
||||
return super(Article, self)._expand_settings(key, klass)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue