Code source wiki de XWikiGroupSheet

Modifié par Thomas Mortagne le 2020/05/20 07:47

Afficher les derniers auteurs
1 {{velocity}}
2 {{html clean="false"}}
3 #set ($discard = $xwiki.ssx.use('XWiki.XWikiGroupSheet'))
4 ## Keep testing the inline action for backward compatibility with existing groups.
5 #if ($xcontext.action == 'edit' || $xcontext.action == 'inline')
6 #if ($request.xpage == 'plain')
7 ## AJAX request.
8 #set ($wrapperTag = 'form')
9 <form class="xform" action="$doc.getURL('preview')">
10 <input type="hidden" name="form_token" value="$!services.csrf.token" />
11 #else
12 #set ($discard = $xwiki.jsx.use('XWiki.XWikiGroupSheet'))
13 ## The form is generated in the edit template.
14 #set ($wrapperTag = 'div')
15 <div class="xform">
16 #end
17 <dl>
18 <dt><label for="userInput">$services.localization.render('xe.admin.groups.addUser')</label></dt>
19 <dd>
20 #set ($parameters = {'id': 'userInput', 'name': 'name'})
21 #userPicker(true $parameters)
22 </dd>
23 <dt><label for="groupInput">$services.localization.render('xe.admin.groups.addGroup')</label></dt>
24 <dd>
25 #set ($parameters = {'id': 'groupInput', 'name': 'name'})
26 #groupPicker(true $parameters)
27 </dd>
28 </dl>
29 <div class="buttons">
30 <span class="buttonwrapper">
31 <button type="submit" id="addMembers" name="xpage" value="adduorg">
32 $services.localization.render('xe.admin.groups.addUser.submit')
33 </button>
34 </span>
35 </div>
36 </$wrapperTag>
37 #end
38 #set ($columnOptions = {
39 'member': {'type': 'text', 'html': true},
40 'type': {'filterable': false, 'sortable': false},
41 'scope': {'filterable': false, 'sortable': false},
42 '_actions': {
43 'actions': ['delete'],
44 'actionCallbacks': {'delete': 'table.deleteRow(i);'},
45 'ajaxActions': {'delete': true},
46 'filterable': false
47 }
48 })
49 #set ($columns = ['member', 'type'])
50 #if (!$xcontext.isMainWiki() && $services.wiki.user.userScope != 'LOCAL_ONLY')
51 #set ($discard = $columns.add('scope'))
52 #end
53 ## Keep testing the inline action for backward compatibility with existing groups.
54 #if ($xcontext.action == 'edit' || $xcontext.action == 'inline')
55 #set ($discard = $columns.add('_actions'))
56 #end
57 <div class="medium-avatars">
58 #livetable('groupusers' $columns $columnOptions {
59 'url': $doc.getURL('view', 'xpage=getgroupmembers'),
60 'translationPrefix': 'xe.admin.groups.',
61 'javascriptName': 'editgrouptable',
62 'outputOnlyHtml': true
63 })
64 </div>
65 {{/html}}
66 {{/velocity}}