Last modified by Ludovic Dubost on 2019/06/17 20:28
From version 1.1
edited by Ludovic Dubost
on 2017/01/07 20:30
on 2017/01/07 20:30
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-blog-ui-8.4.3]
To version 2.1
edited by Ludovic Dubost
on 2019/06/17 20:28
on 2019/06/17 20:28
Change comment:
Install extension [org.xwiki.contrib.blog:application-blog-ui/9.10.1]
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (0 modified, 3 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -7,14 +7,17 @@ 7 7 $xwiki.ssx.use('Blog.ManageCategories')## 8 8 #getEntryObject($doc $entryObj) 9 9 #if("$!entryObj" == '') 10 - {{warning}}{{translation key=' xe.blog.sheet.notpost'/}}{{/warning}}10 + {{warning}}{{translation key='blog.sheet.notpost'/}}{{/warning}} 11 11 ## Keep testing the inline action for backward compatibility with older blog posts. 12 12 #elseif($xcontext.action != 'edit' && $xcontext.action != 'inline') 13 13 ## View mode 14 - #isPublished($entryObj $isPublished) 15 - #isHidden($entryObj $isHidden) 16 - ## displayBlog requires a list of documents, and whether to display only an extract or the full entry. 17 - #displayBlog([$tdoc] 'single' false false) 14 + #getBlogDocument ($doc.space $blogDoc) 15 + #getBlogPostsLayout($blogDoc $postsLayout) 16 + #set ($layoutParams="useSummary=false|displayTitle=false") 17 + #if ($postsLayout != 'full') 18 + #set ($layoutParams="$!{layoutParams}|displayCalendar=false") 19 + #end 20 + {{blogPostLayoutFull reference="$doc.fullName.replaceAll('~', '~~').replaceAll('"', '~"')" params="$!layoutParams.replaceAll('~', '~~').replaceAll('"', '~"')" /}} 18 18 #else 19 19 #if ("$!request.title" != '') 20 20 ## Use the page title specified on the request, if available, as blog post title. This is needed for instance when ... ... @@ -22,14 +22,46 @@ 22 22 ## the page title). 23 23 #set ($discard = $entryObj.set('title', $request.title)) 24 24 #end 25 - ; {{translation key='xe.blog.sheet.title'/}} 28 + #getBlogCategoriesLocation($doc.space $categoriesLocation) 29 + #set ($defaultPostCategory = "${categoriesLocation}.WebHome") 30 + #if ($categoriesLocation == 'Blog') 31 + #set ($defaultPostCategory = "Blog.Categories.WebHome") 32 + #end 33 + #set($discard = $xwiki.jsx.use('Blog.BlogPostSheet')) 34 + #set($discard = $xwiki.ssx.use('Blog.BlogPostSheet')) 35 + (% class="xform" %)((( 36 + {{html clean="false" wiki="true"}} 37 + ; <label>{{translation key='blog.sheet.title'/}}</label> 26 26 : $doc.display('title', 'edit', $entryObj) 27 - ; {{translation key=' xe.blog.sheet.content'/}}39 + ; <label>{{translation key='blog.sheet.content'/}}</label> 28 28 : $doc.display('content', 'edit', $entryObj) 29 - ; {{translation key=' xe.blog.sheet.summary'/}}41 + ; <label>{{translation key='blog.sheet.summary'/}}</label> 30 30 : $doc.display('extract', 'edit', $entryObj) 31 - ; {{translation key='xe.blog.sheet.category'/}} 32 - : ((({{html clean="false" wiki="true"}}#displayCategoryManagementTree('' 'selectable'){{/html}} (% class="clearfloats" %)((()))))) 43 + 44 + <div class="row"> 45 + <div class="col-xs-12 col-sm-4 col-lg-3"> 46 + <dl> 47 + <dt><label>$services.localization.render('blog.sheet.image') <a href="javascript:;" title="${escapetool.xml($services.localization.render('blog.sheet.image.info'))}"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a> :</label></dt> 48 + <dd> 49 +{{/html}} 50 + 51 +{{attachmentSelector classname="Blog.BlogPostClass" property="image" filter="png,jpg,gif" displayImage="true" buttontext="$services.localization.render('blog.sheet.choose_image')" width="300" cssClass="blogImageSelector"/}} 52 + 53 +{{html clean="false" wiki="true"}} 54 + </dd> 55 + </dl> 56 + </div> 57 + <div class="col-xs-12 col-sm-8 col-lg-9"> 58 + <dl> 59 + <dt><label>{{translation key='blog.sheet.category'/}}</label></dt> 60 + <dd> 61 + #displayCategoryManagementTree($categoriesLocation 'selectable') <input type="hidden" name="Blog.BlogPostClass_0_category" id="defaultPostCategory"/><input type="hidden" id="blogCategoriesWebHome" value="${escapetool.xml($defaultPostCategory)}"/> 62 + </dd> 63 + </dl> 64 + </div> 65 + </div> 66 + {{/html}} 67 +))) 33 33 #if ($doc.isNew()) 34 34 ## We're creating a new blog post. We handle this case differently because #isPublished returns true when the 35 35 ## property is not set (object missing) and thus the new blog post will appear as published. See also the comment ... ... @@ -43,10 +43,12 @@ 43 43 #isPublished($originalEntryObj $isPublished) 44 44 #end 45 45 #if($isPublished) 46 - #if($doc.creator == $xcontext.user) 47 - #publishMessageBox($services.localization.render('xe.blog.sheet.publicationdate', [${doc.display('publishDate', 'view', $entryObj)}])) 81 + #if($hasEdit) 48 48 #set($hideArticle = ${doc.display('hidden', 'edit', $entryObj)}) 49 - #hideMessageBox($services.localization.render('xe.blog.sheet.hidearticle', [${hideArticle}])) 83 + (% class="post-state-blk plainmessage" %)((( 84 + (% class="publish-message" %)((($services.icon.render('world') $services.localization.render('blog.sheet.publicationdate', [${doc.display('publishDate', 'view', $entryObj)}])))) 85 + (% class="hide-message" %)((($services.icon.render('unlock') $services.localization.render('blog.sheet.hidearticle', [${hideArticle}])))) 86 + ))) 50 50 #end 51 51 #else 52 52 #set($defaultDate = $xwiki.getDocument($blogPostTemplate).getObject($blogPostClassname).getProperty('publishDate').value.time) ... ... @@ -55,7 +55,7 @@ 55 55 $entryObj.set('publishDate', $doc.creationDate) 56 56 #end 57 57 {{html clean="false" wiki="true"}} 58 - #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>")95 + #publishMessageBox("$services.localization.render('blog.sheet.notpublished') <label>**$services.localization.render('blog.sheet.publish') ${doc.display('published', 'edit', $entryObj)}**</label>\\<label>$services.localization.render('blog.sheet.setdate') ${doc.display('publishDate', 'edit', $entryObj)}</label>") 59 59 {{/html}} 60 60 #end 61 61 #end
- XWiki.JavaScriptExtension[0]
-
- Caching policy
-
... ... @@ -1,0 +1,1 @@ 1 +long - Code
-
... ... @@ -1,0 +1,36 @@ 1 +require(['jquery'], function($){ 2 + function hasCategories () { 3 + return $('div.blog-categories-list input:checkbox:checked').length > 0 ? true: false; 4 + } 5 + 6 + function setDefaultCategory () { 7 + $("input[type='hidden']#defaultPostCategory").val($("input[type='hidden']#blogCategoriesWebHome").val()); 8 + } 9 + 10 + if (!hasCategories()) { 11 + setDefaultCategory(); 12 + } 13 + 14 + $( "body" ).on( "click", "div.blog-categories-list input:checkbox", function() { 15 + if(!hasCategories()){ 16 + setDefaultCategory(); 17 + } 18 + else 19 + { 20 + $("input[type='hidden']#defaultPostCategory").val(''); 21 + } 22 + }); 23 + // Reset the "dirty state" of the CKEDITOR editors 24 + $("body").on("click", "form#uploadAttachment input[name='action_upload']", function(event){ 25 + if( typeof(CKEDITOR) !== "undefined" ) { 26 + var contentEditor = CKEDITOR.instances['Blog.BlogPostClass_0_content']; 27 + var extractEditor = CKEDITOR.instances['Blog.BlogPostClass_0_extract']; 28 + if (contentEditor) { 29 + contentEditor.resetDirty(); 30 + } 31 + if (extractEditor) { 32 + extractEditor.resetDirty(); 33 + } 34 + } 35 + }); 36 +}); - Use this extension
-
... ... @@ -1,0 +1,1 @@ 1 +onDemand
- XWiki.SheetClass[0]
-
- XWiki.StyleSheetExtension[0]
-
- Caching policy
-
... ... @@ -1,0 +1,1 @@ 1 +long - Code
-
... ... @@ -1,0 +1,4 @@ 1 +.thumbnail-col { 2 + margin-bottom: 10px; 3 + margin-left: -15px; 4 +} - Use this extension
-
... ... @@ -1,0 +1,1 @@ 1 +onDemand - Content Type
-
... ... @@ -1,0 +1,1 @@ 1 +CSS