Última modificación por Administrator el 2014/10/29 07:38
Mostrar los últimos autores
author | version | line-number | content |
---|---|---|---|
1 | {{include reference="Blog.BlogCode"/}} | ||
2 | |||
3 | {{include reference="Blog.CategoriesCode"/}} | ||
4 | |||
5 | {{velocity}} | ||
6 | $xwiki.jsx.use('Blog.ManageCategories', {'mode' : 'select'})## | ||
7 | $xwiki.ssx.use('Blog.ManageCategories')## | ||
8 | #getEntryObject($doc $entryObj) | ||
9 | #if("$!entryObj" == '') | ||
10 | {{warning}}{{translation key='xe.blog.sheet.notpost'/}}{{/warning}} | ||
11 | ## Keep testing the inline action for backward compatibility with older blog posts. | ||
12 | #elseif($xcontext.action != 'edit' && $xcontext.action != 'inline') | ||
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) | ||
18 | #else | ||
19 | ; {{translation key='xe.blog.sheet.title'/}} | ||
20 | : $doc.display('title', 'edit', $entryObj) | ||
21 | ; {{translation key='xe.blog.sheet.content'/}} | ||
22 | : $doc.display('content', 'edit', $entryObj) | ||
23 | ; {{translation key='xe.blog.sheet.summary'/}} | ||
24 | : $doc.display('extract', 'edit', $entryObj) | ||
25 | ; {{translation key='xe.blog.sheet.category'/}} | ||
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 | ||
39 | #if($isPublished) | ||
40 | #if($doc.creator == $xcontext.user) | ||
41 | #publishMessageBox($services.localization.render('xe.blog.sheet.publicationdate', [${doc.display('publishDate', 'view', $entryObj)}])) | ||
42 | #set($hideArticle = ${doc.display('hidden', 'edit', $entryObj)}) | ||
43 | #hideMessageBox($services.localization.render('xe.blog.sheet.hidearticle', [${hideArticle}])) | ||
44 | #end | ||
45 | #else | ||
46 | #set($defaultDate = $xwiki.getDocument($blogPostTemplate).getObject($blogPostClassname).getProperty('publishDate').value.time) | ||
47 | #if($entryObj.getProperty('publishDate').value.time == $defaultDate) | ||
48 | ## The publish date was not set, force it to be the creation date | ||
49 | $entryObj.set('publishDate', $doc.creationDate) | ||
50 | #end | ||
51 | {{html clean="false" wiki="true"}} | ||
52 | #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}} | ||
54 | #end | ||
55 | #end | ||
56 | {{/velocity}} |