Wiki source code of Duncan1
Last modified by Alexandru Colesnicov on 2018/11/06 17:06
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{velocity}} | ||
| 2 | |||
| 3 | #if("$!request.docName" != '') | ||
| 4 | ## Request for creating a new instance | ||
| 5 | #set($docName = ${request.docName}) | ||
| 6 | #set($targetDocName = "${request.spaceName}.${docName}") | ||
| 7 | #if(!$xwiki.exists($targetDocName) && $xwiki.hasAccessLevel('edit', $xcontext.user, $targetDocName)) | ||
| 8 | $response.sendRedirect($xwiki.getURL($targetDocName, 'inline', "template=${escapetool.url($request.template)}&title=${request.docName}&parent=${escapetool.url($request.parent)}")) | ||
| 9 | ## Stop processing, since we already sent a redirect. | ||
| 10 | #stop | ||
| 11 | #end | ||
| 12 | #end | ||
| 13 | |||
| 14 | = Add a new record = | ||
| 15 | |||
| 16 | #if("$!targetDocName" != '' && $xwiki.exists($targetDocName)) | ||
| 17 | {{warning}}The target document already exists. Please choose a different name, or [[view the existing document>>$targetDocName]]{{/warning}} | ||
| 18 | #elseif("$!targetDocName" != '') | ||
| 19 | {{warning}}You don't have permission to create that document{{/warning}} | ||
| 20 | #end | ||
| 21 | |||
| 22 | {{html}} | ||
| 23 | <form action="" id="newdoc" method="post"> | ||
| 24 | <div> | ||
| 25 | <input type="hidden" name="parent" value="${doc.fullName}"/> | ||
| 26 | <input type="hidden" name="template" value="Duncan1.Code.GDataTemplate"/> | ||
| 27 | <input type="hidden" name="sheet" value="1"/> | ||
| 28 | <input type="hidden" name="spaceName" value="Duncan1"/> | ||
| 29 | Document: <input type="text" name="docName" value="Enter profession name here" class="withTip" size="50"/> | ||
| 30 | <span class="buttonwrapper"><input type="submit" value="Create this record" class="button"/></span> | ||
| 31 | </div> | ||
| 32 | </form> | ||
| 33 | {{/html}} | ||
| 34 | |||
| 35 | [[Duncan Result>>Duncan1.DuncanResult.WebHome]] | ||
| 36 | |||
| 37 | #set ($columnsProperties = { | ||
| 38 | 'doc.title': {"link":"view"}, | ||
| 39 | 'QuaWoman': {"filterable":true,"sortable":true}, | ||
| 40 | 'QuaMan': {"filterable":true,"sortable":true}, | ||
| 41 | 'doc.author': {"link":"author"}, | ||
| 42 | '_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"]} | ||
| 43 | }) | ||
| 44 | #set ($options = { | ||
| 45 | 'className': 'Duncan1.Code.GDataClass', | ||
| 46 | 'translationPrefix': 'Duncan1.livetable.', | ||
| 47 | 'rowCount': 15, | ||
| 48 | 'maxPages': 10, | ||
| 49 | 'selectedColumn': 'doc.title', | ||
| 50 | 'defaultOrder': 'asc' | ||
| 51 | }) | ||
| 52 | #set ($columns = ['doc.title', 'QuaWoman', 'QuaMan', 'doc.author', '_actions']) | ||
| 53 | #livetable('Duncan1' $columns $columnsProperties $options) | ||
| 54 | {{/velocity}} |