Show last authors
1 {{include reference="ReleaseNotes.Code.ChangesVelocityMacros"/}}
2
3 {{velocity}}
4 #set ($topSpace = $doc.documentReference.extractFirstReference('SPACE').getName())
5 $!xwiki.jsx.use("${topSpace}.Code.HomeReleaseNotes")
6 #if ($hasEdit)
7 #set ($configDoc = $xwiki.getDocument("${topSpace}.Code.ReleaseNotesConfig"))
8 #set ($defaultProduct = $configDoc.getValue('product'))
9 #set ($defaultTemplateReferenceString = $configDoc.getValue('template'))
10 #if ($request.action == 'addReleaseNotes')
11 #set ($product = $!request.product)
12 #set ($version = $!request.version)
13 #getShortVersion($version $shortVersion)
14 ## Create page if it doesn't exist
15 #set ($rnPageReference = $services.model.createDocumentReference('', ["$topSpace", 'Data', $product, $shortVersion], 'WebHome'))
16 #set ($rnDoc = $xwiki.getDocument($rnPageReference))
17 #if ($rnDoc.isNew())
18 #set ($rnObject = $rnDoc.newObject("${topSpace}.Code.ReleaseNoteClass"))
19 #set ($discard = $rnObject.set('product', $product))
20 #set ($discard = $rnObject.set('version', $version))
21 #set ($discard = $rnObject.set('released', '0'))
22 ## We set an empty release date so that the LiveTable can see entries. For some reasons, otherwise, it won't
23 ## display entries that have no date set (this is related to the fact that we're sorting the LT by dates).
24 #set ($discard = $rnObject.set('date', ''))
25 ## Copy the template content + title
26 #set ($templateDoc = $xwiki.getDocument($defaultTemplateReferenceString))
27 ## Run Velocity on the template to evaluate the velocity code in the template
28 #define($evaluatedContent)
29 #evaluate($templateDoc.content)
30 #end
31 #set ($discard = $rnDoc.setContent($evaluatedContent))
32 #define($evaluatedTitle)
33 #evaluate($templateDoc.title)
34 #end
35 #set ($discard = $rnDoc.setTitle($evaluatedTitle))
36 #set ($discard = $rnDoc.save('New Release note'))
37 ## Redirect in edit mode to edit the RN
38 $response.sendRedirect($xwiki.getURL($services.model.serialize($rnPageReference)))
39 #else
40
41 {{error}}That release notes already exists!{{/error}}
42
43 #end
44 #end
45 {{html}}
46 <form>
47 <input type="hidden" name="action" value="addReleaseNotes"/>
48 <input id="product" type="text" name="product" value="$defaultProduct" size="32"/>
49 <input id="version" type="text" name="version" value="Version e.g. 8.3-milestone-1..." size="32" class="withTip"/>
50 <span class="buttonwrapper">
51 <input class="button" type="submit" value="Add Release Note"/>
52 </span>
53 </form>
54 {{/html}}
55 #end
56 {{/velocity}}
57
58 {{velocity}}
59 #set($columns = ['product', 'version', 'released', 'date'])
60 #set($columnsProperties = {
61 'product' : { 'type' : 'text' },
62 'version' : { 'type' : 'text', 'link' : true },
63 'released' : { 'type' : 'boolean' },
64 'date' : { 'type' : 'date' }
65 })
66 #set($options = {
67 'className' : "${topSpace}.Code.ReleaseNoteClass",
68 'selectedColumn' : 'date',
69 'defaultOrder' : 'desc',
70 'translationPrefix' : 'releasenotes.releases.livetable.',
71 'rowCount' : 15
72 })
73 #livetable('releasenotes' $columns $columnsProperties $options)
74 {{/velocity}}

Get Connected