Changes for page Spaces

Last modified by superadmin on 2017/11/28 14:52
From empty
To version 1.1
edited by superadmin
on 2017/11/28 14:52
Change comment: Install extension [org.xwiki.platform:xwiki-platform-index-ui/9.9]

Summary

Details

Page properties
Title
... ... @@ -1,0 +1,1 @@
1 +$services.localization.render('index.spacesMacro.title')
Parent
... ... @@ -1,0 +1,1 @@
1 +Main.WebHome
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.XWikiGuest
1 +xwiki:XWiki.superadmin
Hidden
... ... @@ -1,1 +1,1 @@
1 -false
1 +true
Content
... ... @@ -1,0 +1,1 @@
1 +{{spaces /}}
XWiki.RequiredRightClass[0]
level
... ... @@ -1,0 +1,1 @@
1 +edit
XWiki.StyleSheetExtension[0]
Caching policy
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,37 @@
1 +#template('colorThemeInit.vm')
2 +#spSpaceCreateItem {
3 + background-image: url("$xwiki.getSkinFile('icons/silk/folder_add.png')");
4 +}
5 +
6 +ul.xlist li.space div.spSpaceName {
7 + float: left;
8 +}
9 +
10 +#spSpaceCreateLabel a {
11 + color: $theme.textSecondaryColor;
12 + text-decoration: none;
13 +}
14 +
15 +#spSpaceCreateForm {
16 + background-color: $theme.highlightColor;
17 + border-top: 1px dashed $theme.borderColor;
18 + padding: .5em 0;
19 +}
20 +
21 +/* Hidden elements in lists that are show on hover */
22 +
23 +ul.xlist li.xitem div.xshowonhover {
24 + display: none;
25 + float: right;
26 + font-size: .8em;
27 + padding: 0 .5em 0 0;
28 +}
29 +
30 +ul.xlist li.xitem:hover div.xshowonhover {
31 + display: block;
32 +}
33 +
34 +ul.xlist li.xitem div.xshowonhover img {
35 + float: right;
36 + padding: 0 .2em;
37 +}
Name
... ... @@ -1,0 +1,1 @@
1 +Spaces list CSS
Parse content
... ... @@ -1,0 +1,1 @@
1 +Yes
Use this extension
... ... @@ -1,0 +1,1 @@
1 +onDemand
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,0 +1,67 @@
1 +{{velocity}}
2 +##
3 +## List spaces within the wiki.
4 +##
5 +$xwiki.ssx.use('Main.Spaces')##
6 +#set($spaceList = $services.query.xwql('select distinct doc.space from Document doc order by doc.space').addFilter('hidden').execute())
7 +{{html}}
8 +<ul class="xlist">
9 + ##
10 + ## List spaces.
11 + ##
12 + #foreach($space in $spaceList)
13 + ## Display space only if the user has view right on space home and if the space is not blacklisted.
14 + ## $blacklistedSpaces is set in xwikivars.vm
15 + #set ($spaceHomeDocumentReference = $services.model.resolveSpace($space))
16 + #if($xwiki.hasAccessLevel('view', $services.model.serialize($spaceHomeDocumentReference)) && !$blacklistedSpaces.contains($space))
17 + <li class="xitem xunderline xhighlight space">
18 + <div class="xitemcontainer">
19 + <div class="spSpaceName"><a href="$xwiki.getURL($spaceHomeDocumentReference)">${escapetool.xml($space)}</a></div>
20 + <div class="xshowonhover spSpaceActions">
21 + ## Link to the space index.
22 + <a href="$xwiki.getURL('Main.SpaceIndex', 'view', "space=$escapetool.url($space)")" title="$services.localization.render('index.spacesMacro.spaceIndex.title')">
23 + <img src="$xwiki.getSkinFile('icons/silk/book_open.png')" alt="$services.localization.render('index.spacesMacro.spaceIndex.alt')"/>
24 + </a>
25 + ## If the user has admin right on the space display links to administration and delete.
26 + #set ($spacePreferencesDocumentReference = $services.model.createEntityReference('WebPreferences', 'DOCUMENT', $spaceHomeDocumentReference))
27 + #if($xwiki.hasAccessLevel('admin', $services.model.serialize($spacePreferencesDocumentReference)))
28 + <a href="$xwiki.getURL($spacePreferencesDocumentReference, 'admin', '')" title="$services.localization.render('index.spacesMacro.spaceAdministration.title')">
29 + <img src="$xwiki.getSkinFile('icons/silk/wrench.png')" alt="$services.localization.render('index.spacesMacro.spaceAdministration.alt')"/>
30 + </a>
31 + #end
32 + </div>
33 + <div class="xspacer">&nbsp;</div>
34 + </div>
35 + </li>
36 + #end
37 + #end
38 + ##
39 + ## Space creation.
40 + ##
41 + ## Only if the current user has the right to create spaces and the current action is not inline.
42 + ## If it's inline, then there is already a form, and if we render the second, nested one, the DOM is messed up in IE.
43 + #if($hasCreateSpace && "$!xcontext.action" != "inline" && "$!xcontext.action" != "edit")
44 + <li id="spSpaceCreateItem" class="xitem space">
45 + <div class="xitemcontainer">
46 + <div id="spSpaceCreateLabel" class="spSpaceName"><a href="$xwiki.getURL('XWiki.CreatePage', 'view', 'tocreate=space')" onclick="toggleClass($('spSpaceCreateForm'), 'hidden'); return false;">$services.localization.render('index.spacesMacro.createSpace.link')</a></div>
47 + <div class="spacer">&nbsp;</div>
48 + <div id="spSpaceCreateForm" class="hidden">
49 + <form method="post" action="$doc.getURL('create')" class="xformInline">
50 + <div>
51 + <input name="tocreate" type="hidden" value="space" />
52 + #set($newSpaceName = $escapetool.xml($services.localization.render('index.spacesMacro.createSpace.defaultSpaceName')))
53 + <label class="hidden" for="spSpaceCreateTextInput">$newSpaceName</label>
54 + <input id="spSpaceCreateTextInput" type="text" name="space" value="$newSpaceName" class="panelinput withTip" />
55 + <span class="buttonwrapper">
56 + <input type="submit" value="$services.localization.render('index.spacesMacro.createSpace.submit')" class="button" />
57 + </span>
58 + </div>
59 + </form>
60 + </div>
61 + <div class="spacer">&nbsp;</div>
62 + </div>
63 + </li>
64 + #end
65 +</ul>
66 +{{/html}}
67 +{{/velocity}}
Macro content type
... ... @@ -1,0 +1,1 @@
1 +No content
Default category
... ... @@ -1,0 +1,1 @@
1 +Deprecated
Macro description
... ... @@ -1,0 +1,1 @@
1 +Displays all the spaces in this wiki.
Macro id
... ... @@ -1,0 +1,1 @@
1 +spaces
Macro name
... ... @@ -1,0 +1,1 @@
1 +Spaces
Supports inline mode
... ... @@ -1,0 +1,1 @@
1 +No
Macro visibility
... ... @@ -1,0 +1,1 @@
1 +Current Wiki