Modifications pour le document XWikiGroupSheet

Modifié par Florent Charton le 2025/07/04 23:28

Depuis la version 3.1
modifié par Florent Charton
sur 2025/07/04 23:28
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-administration-ui/16.10.9]
À la version 2.1
modifié par Florent Charton
sur 2024/08/08 18:43
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-administration-ui/15.10.11]

Résumé

Détails

Propriétés de la Page
Contenu
... ... @@ -35,50 +35,34 @@
35 35   </div>
36 36   </$wrapperTag>
37 37  #end
38 -#set ($properties = ['member', 'type'])
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'])
39 39  #if (!$xcontext.isMainWiki() && $services.wiki.user.userScope != 'LOCAL_ONLY')
40 - #set ($discard = $properties.add('scope'))
53 + #set ($discard = $columns.add('scope'))
41 41  #end
42 42  ## Keep testing the inline action for backward compatibility with existing groups.
43 43  #if ($xcontext.action == 'edit' || $xcontext.action == 'inline')
44 - #set ($discard = $properties.add('_actions'))
57 + #set ($discard = $columns.add('_actions'))
45 45  #end
46 46  <div class="medium-avatars">
47 - #set ($sourceParameters = {
48 - 'template': 'getgroupmembers.vm',
60 + #livetable('groupusers' $columns $columnOptions {
61 + 'url': $doc.getURL('view', 'xpage=getgroupmembers'),
49 49   'translationPrefix': 'xe.admin.groups.',
50 - '$doc': $doc.documentReference
63 + 'javascriptName': 'editgrouptable',
64 + 'outputOnlyHtml': true
51 51   })
52 - $services.liveData.render({
53 - 'id': 'groupusers',
54 - 'source': 'liveTable',
55 - 'properties': $stringtool.join($properties, ','),
56 - 'sourceParameters': $escapetool.url($sourceParameters)
57 - }, {
58 - 'meta': {
59 - 'propertyDescriptors': [
60 - {
61 - 'id': 'member',
62 - 'displayer': 'html',
63 - 'editable': false
64 - }
65 - ],
66 - 'actions': [
67 - {
68 - 'id': 'edit',
69 - 'allowProperty': '-'
70 - }, {
71 - 'id': 'delete',
72 - 'async': {
73 - 'httpMethod': 'POST',
74 - 'loadingMessage': $services.localization.render('administration.section.groups.deleteUserFromGroup.loading'),
75 - 'successMessage': $services.localization.render('administration.section.groups.deleteUserFromGroup.success'),
76 - 'failureMessage': $services.localization.render('administration.section.groups.deleteUserFromGroup.failure')
77 - }
78 - }
79 - ]
80 - }
81 - })
82 82  </div>
83 83  {{/html}}
84 84  {{/velocity}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,4 +1,9 @@
1 -require(['jquery'], function($) {
1 +require(['jquery', 'xwiki-meta'], function($, xm) {
2 + // The livetable is refreshed after each action (add/remove).
3 + // Refresh the document version to avoid conflicts if we try to save afterwards
4 + $(document).on('xwiki:livetable:displayComplete', function (event) {
5 + xm.refreshVersion();
6 + });
2 2   $(document).on('click', '#addMembers', function(event) {
3 3   event.preventDefault();
4 4   var addMembersButton = $(event.target);
... ... @@ -24,7 +24,7 @@
24 24   $('#userInput')[0].selectize.clear(true);
25 25   $('#groupInput')[0].selectize.clear(true);
26 26   // Reload the live table.
27 - $("#groupusers").data('liveData').updateEntries();
32 + editgrouptable.refresh();
28 28   // Show notification message.
29 29   if(response.hasIgnored) {
30 30   new XWiki.widgets.Notification(response.ignoredMessage, 'warning', {timeout: 5});
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,3 +1,5 @@
1 +#template('colorThemeInit.vm')
2 +
1 1  /* Make sure the selectize dropdown is displayed on top of the Bootstrap modal. */
2 2  body > .selectize-dropdown {
3 3   z-index: 1051;
... ... @@ -9,13 +9,13 @@
9 9  
10 10  #groupusers {
11 11   margin-top: 20px;
14 +}
12 12  
13 - td.cell div.view {
14 - vertical-align: middle;
15 - }
16 +#groupusers td[data-title] {
17 + vertical-align: middle;
18 +}
16 16  
17 - [data-livedata-property-id="type"],
18 - [data-livedata-property-id="scope"] {
19 - color: @text-muted;
20 - }
20 +#groupusers td.type,
21 +#groupusers td.scope {
22 + color: $theme.textSecondaryColor;
21 21  }
Content Type
... ... @@ -1,1 +1,1 @@
1 -LESS
1 +CSS
Parser le contenu
... ... @@ -1,1 +1,1 @@
1 -Non
1 +Oui