Wiki source code of Snippets
Last modified by Simon Urli on 2023/10/09 16:05
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{include reference="ExtensionCode.RepositoryCode"/}} | ||
2 | |||
3 | {{include reference="ExtensionCode.CreateExtension"/}} | ||
4 | |||
5 | {{info}} | ||
6 | Snippets are reusable portions of [[scripts>>xwiki:Documentation.DevGuide.Scripting]] that you can copy paste in wiki pages. | ||
7 | {{/info}} | ||
8 | |||
9 | (% class="extension-link search-extension box" %) | ||
10 | ((( | ||
11 | ((( | ||
12 | {{velocity}} | ||
13 | === #if($services.icon)$services.icon.render('find')#end Search Snippet... === | ||
14 | {{html}} | ||
15 | <form action="$xwiki.getURL("ExtensionCode.ExtensionSearch")"> | ||
16 | <input type="hidden" name="f_space_facet" value="0/Extension." /> | ||
17 | <input type="text" name="text" value="snippet name..." size="25" class="withTip" id="searchTextInput" /> | ||
18 | <span class="buttonwrapper"> | ||
19 | <input class="btn btn-primary" type="submit" value="Search" id="searchSubmit"/> | ||
20 | </span> | ||
21 | </form> | ||
22 | {{/html}} | ||
23 | |||
24 | {{/velocity}} | ||
25 | ))) | ||
26 | ))) | ||
27 | |||
28 | (% class="extension-link add-extension box" %) | ||
29 | ((( | ||
30 | ((( | ||
31 | {{velocity}} | ||
32 | === #if($services.icon)$services.icon.render('add')#end Contribute Snippet... === | ||
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" /> | ||
41 | <input class="withTip" type="text" name="name" value="snippet name..." size="25" id="contributeNameInput"/> | ||
42 | <span class="buttonwrapper"> | ||
43 | <input class="btn btn-success" type="submit" value="Add" id="contributeSubmit"/> | ||
44 | </span> | ||
45 | </form> | ||
46 | {{/html}} | ||
47 | |||
48 | #end | ||
49 | {{/velocity}} | ||
50 | ))) | ||
51 | ))) | ||
52 | |||
53 | (% class="clearfloats" %) | ||
54 | ((( | ||
55 | |||
56 | ))) | ||
57 | |||
58 | |||
59 | {{velocity}} | ||
60 | #set($columns = ["name", "summary", "authors", "doc.creationDate", "doc.date", "rating"]) | ||
61 | #set($columnsProperties = { | ||
62 | "name" : { "type" : "text", "link" : "view" }, | ||
63 | "summary" : { "type" : "text" }, | ||
64 | "authors" : {"type" : "text", 'html': true}, | ||
65 | "doc.creationDate" : { "type" : "date" }, | ||
66 | "doc.date" : { "type" : "date" }, | ||
67 | "rating" : { 'html' : true, 'filterable' : false, 'sortable' : false} | ||
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 | }) | ||
77 | #livetable("extensions" $columns $columnsProperties $options) | ||
78 | |||
79 | (% class="hidden" %) ((( | ||
80 | Temporary provide a link for robots to index all extension. | ||
81 | In the future, this link will be provided via a sitemap. | ||
82 | [[ExtensionCode.AllExtensionsList]] | ||
83 | ))) | ||
84 | {{/velocity}} |