Code source wiki de XWikiGroupSheet
Modifié par Thomas Mortagne le 2020/05/20 07:47
Masquer les derniers auteurs
author | version | line-number | content |
---|---|---|---|
1.1 | 1 | {{velocity}} | |
9.1 | 2 | {{html clean="false"}} | |
3 | #set ($discard = $xwiki.ssx.use('XWiki.XWikiGroupSheet')) | ||
6.1 | 4 | ## Keep testing the inline action for backward compatibility with existing groups. | |
9.1 | 5 | #if ($xcontext.action == 'edit' || $xcontext.action == 'inline') | |
6.1 | 6 | #if ($request.xpage == 'plain') | |
7 | ## AJAX request. | ||
8 | #set ($wrapperTag = 'form') | ||
9 | <form class="xform" action="$doc.getURL('preview')"> | ||
9.1 | 10 | <input type="hidden" name="form_token" value="$!services.csrf.token" /> | |
6.1 | 11 | #else | |
12 | #set ($discard = $xwiki.jsx.use('XWiki.XWikiGroupSheet')) | ||
13 | ## The form is generated in the edit template. | ||
9.1 | 14 | #set ($wrapperTag = 'div') | |
6.1 | 15 | <div class="xform"> | |
16 | #end | ||
17 | <dl> | ||
18 | <dt><label for="userInput">$services.localization.render('xe.admin.groups.addUser')</label></dt> | ||
19 | <dd> | ||
8.1 | 20 | #set ($parameters = {'id': 'userInput', 'name': 'name'}) | |
21 | #userPicker(true $parameters) | ||
6.1 | 22 | </dd> | |
23 | <dt><label for="groupInput">$services.localization.render('xe.admin.groups.addGroup')</label></dt> | ||
24 | <dd> | ||
8.1 | 25 | #set ($parameters = {'id': 'groupInput', 'name': 'name'}) | |
26 | #groupPicker(true $parameters) | ||
6.1 | 27 | </dd> | |
28 | </dl> | ||
29 | <div class="buttons"> | ||
30 | <span class="buttonwrapper"> | ||
9.1 | 31 | <button type="submit" id="addMembers" name="xpage" value="adduorg"> | |
32 | $services.localization.render('xe.admin.groups.addUser.submit') | ||
33 | </button> | ||
6.1 | 34 | </span> | |
35 | </div> | ||
36 | </$wrapperTag> | ||
37 | #end | ||
9.1 | 38 | #set ($columnOptions = { | |
39 | 'member': {'type': 'text', 'html': true}, | ||
40 | 'type': {'filterable': false, 'sortable': false}, | ||
41 | 'scope': {'filterable': false, 'sortable': false}, | ||
42 | '_actions': { | ||
1.1 | 43 | 'actions': ['delete'], | |
44 | 'actionCallbacks': {'delete': 'table.deleteRow(i);'}, | ||
9.1 | 45 | 'ajaxActions': {'delete': true}, | |
46 | 'filterable': false | ||
1.1 | 47 | } | |
48 | }) | ||
9.1 | 49 | #set ($columns = ['member', 'type']) | |
50 | #if (!$xcontext.isMainWiki() && $services.wiki.user.userScope != 'LOCAL_ONLY') | ||
51 | #set ($discard = $columns.add('scope')) | ||
52 | #end | ||
6.1 | 53 | ## Keep testing the inline action for backward compatibility with existing groups. | |
9.1 | 54 | #if ($xcontext.action == 'edit' || $xcontext.action == 'inline') | |
55 | #set ($discard = $columns.add('_actions')) | ||
1.1 | 56 | #end | |
9.1 | 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}} | ||
1.1 | 66 | {{/velocity}} |