Changes for page Browse Wikis

on 2020-04-11 15:52


on 2021-06-29 11:38
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1,37 +1,80 @@ 1 1 {{velocity}} 2 2 {{html}} 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> 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> 6 6 #end 7 7 {{/html}} 8 8 #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 -}) 22 22 #if(!$isGuest) 23 23 #set($discard = $columns.add('_actions')) 24 - #set($discard = $columnsProperties.put('_actions', { 17 +#end 18 + 19 +#set ($liveDataConfig = { 20 + 'meta': { 21 + 'propertyDescriptors': [ 22 + { 'id': 'wikiprettyname', 'displayer': { 'id': 'link', 'propertyHref': 'wikiprettyname_url' } }, 23 + { 'id': 'membershipType', 'sortable': false, 'filterable': false }, 24 + { 25 + 'id': '_actions', 26 + 'displayer': { 27 + 'id': 'actions', 28 + 'actions': ['join', 'leave', 'requestJoin', 'cancelJoinRequest', 'viewInvitation', 'edit', 'delete'] 29 + } 30 + } 31 + ], 25 25 'actions': [ 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' 33 + { 34 + 'id': 'join', 35 + 'icon': 'user_add', 36 + 'allowProperty': 'doc.hasjoin', 37 + 'urlProperty': 'doc.join_url' 38 + }, 39 + { 40 + 'id': 'leave', 41 + 'icon': 'user_delete', 42 + 'allowProperty': 'doc.hasleave', 43 + 'urlProperty': 'doc.leave_url' 44 + }, 45 + { 46 + 'id': 'requestJoin', 47 + 'icon': 'bell', 48 + 'allowProperty': 'doc.hasrequestJoin', 49 + 'urlProperty': 'doc.requestJoin_url' 50 + }, 51 + { 52 + 'id': 'cancelJoinRequest', 53 + 'icon': 'bell_delete', 54 + 'allowProperty': 'doc.hascancelJoinRequest', 55 + 'urlProperty': 'doc.cancelJoinRequest_url' 56 + }, 57 + { 58 + 'id': 'viewInvitation', 59 + 'icon': 'envelope', 60 + 'allowProperty': 'doc.hasviewInvitation', 61 + 'urlProperty': 'doc.viewInvitation_url' 62 + } 32 32 ] 33 - })) 34 -#end 35 -#livetable('wikis', $columns, $columnsProperties, $options) 64 + } 65 +}) 66 +#set ($sourceParameters = $escapetool.url({ 67 + 'className' : 'XWiki.XWikiServerClass', 68 + 'resultPage' : 'WikiManager.WikisLiveTableResults', 69 + 'translationPrefix' : 'platform.wiki.browse.' 70 + 71 +})) 72 +{{liveData 73 + id='wikis' 74 + source='liveTable' 75 + sourceParameters="$sourceParameters" 76 + properties="$stringtool.join($columns, ',')" 77 + limit=10 78 +}}$jsontool.serialize($liveDataConfig){{/liveData}} 36 36 #set($docextras=[]) 37 37 {{/velocity}}