Last modified by Thomas Mortagne on 2020/01/28
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-blog-ui-6.2.2]
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. mflorea1 +XWiki.VincentMassol - Content
-
... ... @@ -1,9 +1,8 @@ 1 -{{include document="Blog.BlogCode"/}}1 +{{include reference="Blog.BlogCode"/}} 2 2 3 -{{include document="Blog.CategoriesCode"/}}3 +{{include reference="Blog.CategoriesCode"/}} 4 4 5 5 {{velocity}} 6 -{{html clean="false" wiki="true"}} 7 7 $xwiki.jsx.use('Blog.ManageCategories', {'mode' : 'select'})## 8 8 $xwiki.ssx.use('Blog.ManageCategories')## 9 9 #getEntryObject($doc $entryObj) ... ... @@ -24,8 +24,19 @@ 24 24 ; {{translation key='xe.blog.sheet.summary'/}} 25 25 : $doc.display('extract', 'edit', $entryObj) 26 26 ; {{translation key='xe.blog.sheet.category'/}} 27 - : (((#displayCategoryManagementTree('' 'selectable') (% class="clearfloats" %)((()))))) 28 - #isPublished($entryObj $isPublished) 26 + : ((({{html clean="false" wiki="true"}}#displayCategoryManagementTree('' 'selectable'){{/html}} (% class="clearfloats" %)((()))))) 27 + #if ($doc.isNew()) 28 + ## We're creating a new blog post. We handle this case differently because #isPublished returns true when the 29 + ## property is not set (object missing) and thus the new blog post will appear as published. See also the comment 30 + ## from the else branch below. 31 + #set ($isPublished = false) 32 + #else 33 + ## We're editing an existing blog post. We need to check the original document because the current one can have 34 + ## unsaved changes, which happens for instance after returning from preview. 35 + #set ($originalDocument = $xwiki.getDocument($doc.documentReference)) 36 + #getEntryObject($originalDocument $originalEntryObj) 37 + #isPublished($originalEntryObj $isPublished) 38 + #end 29 29 #if($isPublished) 30 30 #if($doc.creator == $xcontext.user) 31 31 #publishMessageBox($services.localization.render('xe.blog.sheet.publicationdate', [${doc.display('publishDate', 'view', $entryObj)}])) ... ... @@ -38,8 +38,9 @@ 38 38 ## The publish date was not set, force it to be the creation date 39 39 $entryObj.set('publishDate', $doc.creationDate) 40 40 #end 51 + {{html clean="false" wiki="true"}} 41 41 #publishMessageBox("$services.localization.render('xe.blog.sheet.notpublished') <label>**$services.localization.render('xe.blog.sheet.publish') ${doc.display('published', 'edit', $entryObj)}**</label>\\<label>$services.localization.render('xe.blog.sheet.setdate') ${doc.display('publishDate', 'edit', $entryObj)}</label>") 53 + {{/html}} 42 42 #end 43 43 #end 44 -{{/html}} 45 45 {{/velocity}}