Code source wiki de XWikiGroupSheet
Version 1.1 par superadmin le 2022/06/20 08:48
Masquer les derniers auteurs
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 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': [{ | ||
| 44 | 'id': 'delete', | ||
| 45 | 'async': true, | ||
| 46 | 'callback': 'table.deleteRow(i);' | ||
| 47 | }], | ||
| 48 | 'filterable': false | ||
| 49 | } | ||
| 50 | }) | ||
| 51 | #set ($columns = ['member', 'type']) | ||
| 52 | #if (!$xcontext.isMainWiki() && $services.wiki.user.userScope != 'LOCAL_ONLY') | ||
| 53 | #set ($discard = $columns.add('scope')) | ||
| 54 | #end | ||
| 55 | ## Keep testing the inline action for backward compatibility with existing groups. | ||
| 56 | #if ($xcontext.action == 'edit' || $xcontext.action == 'inline') | ||
| 57 | #set ($discard = $columns.add('_actions')) | ||
| 58 | #end | ||
| 59 | <div class="medium-avatars"> | ||
| 60 | #livetable('groupusers' $columns $columnOptions { | ||
| 61 | 'url': $doc.getURL('view', 'xpage=getgroupmembers'), | ||
| 62 | 'translationPrefix': 'xe.admin.groups.', | ||
| 63 | 'javascriptName': 'editgrouptable', | ||
| 64 | 'outputOnlyHtml': true | ||
| 65 | }) | ||
| 66 | </div> | ||
| 67 | {{/html}} | ||
| 68 | {{/velocity}} |