Changes for page Browse Wikis

Last modified by Scott Gagan on 2022/07/06 18:30

From version < 2.1 >
edited by Scott Gagan
on 2021/09/10 23:53
To version 1.1 >
edited by admin
on 2021/04/30 23:08
>
Change comment: Install extension [org.xwiki.platform:xwiki-platform-wiki-ui-mainwiki/13.3]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.scottg
1 +XWiki.admin
Content
... ... @@ -1,81 +1,37 @@
1 1  {{velocity}}
2 2  {{html}}
3 -#set ($createWikiDocReference = $services.model.createDocumentReference($services.wiki.mainWikiId,
4 - 'WikiManager', 'CreateWiki'))
5 -#if ($hasCreateWiki && $xwiki.exists($createWikiDocReference)
6 - && $services.security.authorization.hasAccess('view', $createWikiDocReference))
7 - <p>
8 - <a href="$xwiki.getURL('WikiManager.CreateWiki')" class="button button-success" id="tmCreateWiki">
9 - $services.icon.renderHTML('add') $services.localization.render('platform.wiki.create.button')
10 - </a>
11 - </p>
3 +#set ($createWikiDocReference = $services.model.createDocumentReference($services.wiki.mainWikiId, 'WikiManager', 'CreateWiki'))
4 +#if ($hasCreateWiki&& $xwiki.exists($createWikiDocReference)&& $services.security.authorization.hasAccess('view', $createWikiDocReference))
5 + <p><a href="$xwiki.getURL('WikiManager.CreateWiki')" class="button button-success" id="tmCreateWiki">$services.icon.renderHTML('add') $services.localization.render('platform.wiki.create.button')</a></p>
12 12  #end
13 13  {{/html}}
14 14  #set($columns = ['wikiprettyname', 'description', 'owner', 'doc.creationDate', 'membershipType'])
9 +#set($columnsProperties = {
10 + 'wikiprettyname' : { 'type' : 'text', 'link' : 'field' },
11 + 'description' : { 'type' : 'text' , 'size' : 50, 'html' : 'true' },
12 + 'owner' : { 'html' : 'true' },
13 + 'membershipType' : { 'sortable': false, 'filterable': false},
14 + 'doc.creationDate' : { 'type' : 'date', 'size' : 10, 'html' : 'false' }
15 +})
16 +#set($options = {
17 + 'className' : 'XWiki.XWikiServerClass',
18 + 'rowCount' : 10,
19 + 'resultPage' : 'WikiManager.WikisLiveTableResults',
20 + 'translationPrefix' : 'platform.wiki.browse.'
21 +})
15 15  #if(!$isGuest)
16 16   #set($discard = $columns.add('_actions'))
17 -#end
18 -
19 -#set ($liveDataConfig = {
20 - 'meta': {
21 - 'propertyDescriptors': [
22 - { 'id': 'wikiprettyname', 'displayer': { 'id': 'link', 'propertyHref': 'wikiprettyname_url' } },
23 - { 'id': 'owner', 'editable': false},
24 - { 'id': 'membershipType', 'sortable': false, 'filterable': false, 'editable': false },
25 - {
26 - 'id': '_actions',
27 - 'displayer': {
28 - 'id': 'actions',
29 - 'actions': ['join', 'leave', 'requestJoin', 'cancelJoinRequest', 'viewInvitation', 'edit', 'delete']
30 - }
31 - }
32 - ],
24 + #set($discard = $columnsProperties.put('_actions', {
33 33   'actions': [
34 - {
35 - 'id': 'join',
36 - 'icon': 'user_add',
37 - 'allowProperty': 'doc.hasjoin',
38 - 'urlProperty': 'doc.join_url'
39 - },
40 - {
41 - 'id': 'leave',
42 - 'icon': 'user_delete',
43 - 'allowProperty': 'doc.hasleave',
44 - 'urlProperty': 'doc.leave_url'
45 - },
46 - {
47 - 'id': 'requestJoin',
48 - 'icon': 'bell',
49 - 'allowProperty': 'doc.hasrequestJoin',
50 - 'urlProperty': 'doc.requestJoin_url'
51 - },
52 - {
53 - 'id': 'cancelJoinRequest',
54 - 'icon': 'bell_delete',
55 - 'allowProperty': 'doc.hascancelJoinRequest',
56 - 'urlProperty': 'doc.cancelJoinRequest_url'
57 - },
58 - {
59 - 'id': 'viewInvitation',
60 - 'icon': 'envelope',
61 - 'allowProperty': 'doc.hasviewInvitation',
62 - 'urlProperty': 'doc.viewInvitation_url'
63 - }
26 + {'id': 'join', 'icon': 'user_add'},
27 + {'id': 'leave', 'icon': 'user_delete'},
28 + {'id': 'requestJoin', 'icon': 'bell'},
29 + {'id': 'cancelJoinRequest', 'icon': 'bell_delete'},
30 + {'id': 'viewInvitation', 'icon': 'envelope'},
31 + 'edit', 'delete'
64 64   ]
65 - }
66 -})
67 -#set ($sourceParameters = $escapetool.url({
68 - 'className' : 'XWiki.XWikiServerClass',
69 - 'resultPage' : 'WikiManager.WikisLiveTableResults',
70 - 'translationPrefix' : 'platform.wiki.browse.'
71 -
72 -}))
73 -{{liveData
74 - id='wikis'
75 - source='liveTable'
76 - sourceParameters="$sourceParameters"
77 - properties="$stringtool.join($columns, ',')"
78 - limit=10
79 -}}$jsontool.serialize($liveDataConfig){{/liveData}}
33 + }))
34 +#end
35 +#livetable('wikis', $columns, $columnsProperties, $options)
80 80  #set($docextras=[])
81 81  {{/velocity}}
iSymphony