Wiki source code of Snippets
Last modified by Simon Urli on 2023/10/09 16:05
Hide last authors
author | version | line-number | content |
---|---|---|---|
1.1 | 1 | {{include reference="ExtensionCode.RepositoryCode"/}} | |
2 | |||
3 | {{include reference="ExtensionCode.CreateExtension"/}} | ||
4 | |||
3.4 | 5 | {{info}} | |
10.1 | 6 | Snippets are reusable portions of [[scripts>>xwiki:Documentation.DevGuide.Scripting]] that you can copy paste in wiki pages. | |
3.4 | 7 | {{/info}} | |
8 | |||
10.1 | 9 | (% class="extension-link search-extension box" %) | |
1.1 | 10 | ((( | |
10.1 | 11 | ((( | |
1.1 | 12 | {{velocity}} | |
3.1 | 13 | === #if($services.icon)$services.icon.render('find')#end Search Snippet... === | |
1.1 | 14 | {{html}} | |
15 | <form action="$xwiki.getURL("ExtensionCode.ExtensionSearch")"> | ||
8.1 | 16 | <input type="hidden" name="f_space_facet" value="0/Extension." /> | |
2.1 | 17 | <input type="text" name="text" value="snippet name..." size="25" class="withTip" id="searchTextInput" /> | |
1.1 | 18 | <span class="buttonwrapper"> | |
3.1 | 19 | <input class="btn btn-primary" type="submit" value="Search" id="searchSubmit"/> | |
1.1 | 20 | </span> | |
21 | </form> | ||
22 | {{/html}} | ||
23 | |||
24 | {{/velocity}} | ||
25 | ))) | ||
26 | ))) | ||
27 | |||
10.1 | 28 | (% class="extension-link add-extension box" %) | |
1.1 | 29 | ((( | |
10.1 | 30 | ((( | |
1.1 | 31 | {{velocity}} | |
3.1 | 32 | === #if($services.icon)$services.icon.render('add')#end Contribute Snippet... === | |
1.1 | 33 | {{html}} | |
34 | #if ($isGuest) | ||
35 | You need first to <a href="${escapetool.xml($xwiki.getURL('Main.WebHome', 'login', "xredirect=$doc.externalURL"))}">log in</a> or <a href="${escapetool.xml($xwiki.getURL($services.model.resolveDocument('', 'default'), "register", "xredirect=$doc.externalURL"))}">register</a>. | ||
36 | #else | ||
37 | <form action="$doc.getURL()" id="createextension"> | ||
38 | <input type="hidden" name="parent" value="Extension.WebHome" /> | ||
39 | <input type="hidden" name="template" value="ExtensionCode.ExtensionTemplate" /> | ||
40 | <input type="hidden" name="createExtension" value="true" /> | ||
2.1 | 41 | <input class="withTip" type="text" name="name" value="snippet name..." size="25" id="contributeNameInput"/> | |
1.1 | 42 | <span class="buttonwrapper"> | |
3.1 | 43 | <input class="btn btn-success" type="submit" value="Add" id="contributeSubmit"/> | |
1.1 | 44 | </span> | |
45 | </form> | ||
46 | {{/html}} | ||
47 | |||
48 | #end | ||
49 | {{/velocity}} | ||
50 | ))) | ||
51 | ))) | ||
52 | |||
10.1 | 53 | (% class="clearfloats" %) | |
54 | ((( | ||
55 | |||
56 | ))) | ||
1.1 | 57 | ||
10.1 | 58 | ||
1.1 | 59 | {{velocity}} | |
3.1 | 60 | #set($columns = ["name", "summary", "authors", "doc.creationDate", "doc.date", "rating"]) | |
1.1 | 61 | #set($columnsProperties = { | |
62 | "name" : { "type" : "text", "link" : "view" }, | ||
63 | "summary" : { "type" : "text" }, | ||
4.1 | 64 | "authors" : {"type" : "text", 'html': true}, | |
1.1 | 65 | "doc.creationDate" : { "type" : "date" }, | |
3.1 | 66 | "doc.date" : { "type" : "date" }, | |
67 | "rating" : { 'html' : true, 'filterable' : false, 'sortable' : false} | ||
1.1 | 68 | }) | |
69 | #set($options = { | ||
70 | "tagCloud":true, | ||
71 | "className":"ExtensionCode.ExtensionClass", | ||
72 | "selectedColumn":"doc.creationDate", | ||
73 | "defaultOrder":"desc", | ||
74 | "translationPrefix" : "extension.repository.", | ||
75 | "rowCount": 30 | ||
76 | }) | ||
3.1 | 77 | #livetable("extensions" $columns $columnsProperties $options) | |
1.1 | 78 | ||
79 | (% class="hidden" %) ((( | ||
3.1 | 80 | Temporary provide a link for robots to index all extension. | |
1.1 | 81 | In the future, this link will be provided via a sitemap. | |
82 | [[ExtensionCode.AllExtensionsList]] | ||
83 | ))) | ||
84 | {{/velocity}} |