Show last authors
1 {{include reference="ReleaseNotes.Code.EntryVelocityMacros"/}}
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 #set ($discard = $rnDoc.setContent($templateDoc.content))
28 #set ($discard = $rnDoc.setTitle($templateDoc.title))
29 #set ($discard = $rnDoc.save('New Release note'))
30 ## Redirect in edit mode to edit the RN
31 $response.sendRedirect($xwiki.getURL($services.model.serialize($rnPageReference)))
32 #else
33
34 {{error}}That release notes already exists!{{/error}}
35
36 #end
37 #end
38 {{html}}
39 <form>
40 <input type="hidden" name="action" value="addReleaseNotes"/>
41 <input id="product" type="text" name="product" value="$defaultProduct" size="32"/>
42 <input id="version" type="text" name="version" value="Version e.g. 8.3-milestone-1..." size="32" class="withTip"/>
43 <span class="buttonwrapper">
44 <input class="button" type="submit" value="Add Release Note"/>
45 </span>
46 </form>
47 {{/html}}
48 #end
49 {{/velocity}}
50
51 {{velocity}}
52 #set($columns = ['product', 'version', 'released', 'date'])
53 #set($columnsProperties = {
54 'product' : { 'type' : 'text' },
55 'version' : { 'type' : 'text', 'link' : true },
56 'released' : { 'type' : 'boolean' },
57 'date' : { 'type' : 'date' }
58 })
59 #set($options = {
60 'className' : "${topSpace}.Code.ReleaseNoteClass",
61 'selectedColumn' : 'date',
62 'defaultOrder' : 'desc',
63 'translationPrefix' : 'releasenotes.releases.livetable.',
64 'rowCount' : 15
65 })
66 #livetable('releasenotes' $columns $columnsProperties $options)
67 {{/velocity}}

Get Connected