Wiki source code of Dashboard

Last modified by Administrator on 2010/05/15 13:25

Hide last authors
Administrator 1.1 1 {{velocity wiki="true"}}
2 ##
3 ## XWiki Dashboard
4 ##
5 ## This dashboard can be used for both wikis (Main.WebHome)
6 ## and spaces (*.WebHome).
7 ##
8 $xwiki.ssx.use('Main.Dashboard')##
9 #set ($isSpaceDashboard = false)
10 #if ($doc.space != "Main")
11 #set ($isSpaceDashboard = true)
12 #end
13 (% class="dashboard" %)
14 (((
15 (% class="dashboardleft" %)
16 (((
17 ##
18 ## Left column.
19 ##
20 (% class="dashboardleftcontent" %)
21 (((
22 #if (!$isSpaceDashboard)
23 ##
24 ## Wiki spaces and tags
25 ##
26 = $msg.get("xe.dashboard.wiki.spaces") =
27
28 {{include document="Main.Spaces"/}}
29
30 = $msg.get("xe.dashboard.wiki.tagcloud") =
31
32 {{include document="XWiki.TagCloud"/}}
33
34 #else
35 ##
36 ## Space documents and tags
37 ##
38 = $msg.get("xe.dashboard.space.documents", [$doc.space]) =
39
40 #set($limit = 100)## Maximum number of documents we display in the space dashboard list
superadmin 4.1 41 #set ($legacyRaw809c8c94bf_1 = $services.query.hql("where doc.space='${doc.space}' order by doc.creationDate desc").setLimit($limit).setOffset(0).execute())
42 #set ($legacyVisible809c8c94bf_1 = [])
43 #foreach ($legacyEntry809c8c94bf_1 in $legacyRaw809c8c94bf_1)
44 #if ($xwiki.hasAccessLevel('view', $xcontext.user, $legacyEntry809c8c94bf_1))
45 #set ($legacyVisibilityDiscard = $legacyVisible809c8c94bf_1.add($legacyEntry809c8c94bf_1))
46 #end
47 #end
48 #set($docNames = $legacyVisible809c8c94bf_1)
Administrator 1.1 49 {{html}}
50 #displayDocumentList($docNames false [])
51 ## Note: we pass an empty blacklistedSpaces list since we are used as a space dashboard, not a global dashboard
52 {{/html}}
53
54 #if($docNames.size() == $limit)
55 #set($docCount = $xwiki.countDocuments("where doc.space='${doc.space}'"))
56 #set($remaining = $mathtool.sub($docCount, $limit))
57 #if($remaining > 0)
58 (% class="documentListMore" %) (((
59 // $msg.get('xe.dashboard.space.remainingDocumentsInSpace', [$remaining, $doc.space])
60 [[$msg.get('xe.dashboard.space.visitSpaceIndex')>>Main.SpaceIndex?space=$doc.space]] //
61 )))
62 #end
63 #end
64 = $msg.get("xe.dashboard.wiki.tagcloud") =
65 #set ($tagCloudSpace = $doc.space)
66
67 {{include document="XWiki.TagCloud"/}}
68
69 #end
70 )))
71 )))
72 (% class="dashboardright" %)
73 (((
74 ##
75 ## Right column
76 ##
77 (% class="dashboardrightcontent" %)
78 (((
79 ##
80 ## Recent changes
81 ##
82 #if (!$isSpaceDashboard)
83 = $msg.get("xe.dashboard.wiki.recentchanges") =
84 #else
85 = $msg.get("xe.dashboard.space.recentchanges", [$doc.space]) =
86 ## Set variables to limit recent changes to the current space and 15 items.
87 #set ($rcSpace = [$doc.space])
88 #set ($rcChangesNb = 15)
89 #end
90
91 {{include document="Main.RecentChanges"/}}
92
93 )))
94 )))
95 (% class="dashboardspacer" %)
96 (((~ )))
97 )))
98 {{/velocity}}