Wiki源代码GitHub Commit Application
由 xu yang 于 2021/11/30 11:14 最后修改
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | {{velocity}} |
| 2 | #if($request.title) | ||
| 3 | #if($request.title=="") | ||
| 4 | {{warning}}$msg.get("github.createnewgithubconfig.error.titlemissing"){{/warning}} | ||
| 5 | #else | ||
| 6 | #set($docname = $xwiki.getUniquePageName($doc.web, $request.title)) | ||
| 7 | #set($newdoc = $xwiki.getDocument("${doc.web}.${docname}")) | ||
| 8 | #set($ok = $newdoc.setTitle($request.title)) | ||
| 9 | #set($ok = $newdoc.setContent('{{include document="GitHubCode.GitHubConfigSheet" /}}')) | ||
| 10 | #set($ok = $newdoc.setParent("GitHub.WebHome")) | ||
| 11 | #set($ok = $newdoc.newObject("GitHubCode.GitHubConfigClass")) | ||
| 12 | #set($ok = $newdoc.save()) | ||
| 13 | $response.sendRedirect($newdoc.getURL()) | ||
| 14 | #end | ||
| 15 | #else | ||
| 16 | $msg.get("github.description") | ||
| 17 | |||
| 18 | == $msg.get("github.currentconfigs.title") == | ||
| 19 | |||
| 20 | #set($list = $xwiki.searchDocuments(", BaseObject as obj where doc.fullName=obj.name and obj.className='GitHubCode.GitHubConfigClass' and doc.fullName<>'GitHubCode.GitHubConfigTemplate'")) | ||
| 21 | #if($list.size()==0) | ||
| 22 | $msg.get("github.currentconfigs.noconfigs") | ||
| 23 | #else | ||
| 24 | #foreach($item in $list) | ||
| 25 | #set($itemTitle = $xwiki.getDocument($item).getDisplayTitle()) | ||
| 26 | * [[$itemTitle>>$item]] | ||
| 27 | #end | ||
| 28 | #end | ||
| 29 | #end | ||
| 30 | |||
| 31 | == $msg.get("github.createnewconfig") == | ||
| 32 | |||
| 33 | {{html}} | ||
| 34 | <form action=""> | ||
| 35 | $msg.get("github.title"): | ||
| 36 | <input type="text" name="title" size="60" value="" /> | ||
| 37 | |||
| 38 | <input type="submit" value="$msg.get("github.createnewconfig")" /> | ||
| 39 | </form> | ||
| 40 | {{/html}} | ||
| 41 | {{/velocity}} |