Modifications pour le document XWikiGroupSheet

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

Depuis 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]
À 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]

Résumé

Détails

Propriétés de la Page
Contenu
... ... @@ -35,34 +35,50 @@
35 35   </div>
36 36   </$wrapperTag>
37 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'])
38 +#set ($properties = ['member', 'type'])
52 52  #if (!$xcontext.isMainWiki() && $services.wiki.user.userScope != 'LOCAL_ONLY')
53 - #set ($discard = $columns.add('scope'))
40 + #set ($discard = $properties.add('scope'))
54 54  #end
55 55  ## Keep testing the inline action for backward compatibility with existing groups.
56 56  #if ($xcontext.action == 'edit' || $xcontext.action == 'inline')
57 - #set ($discard = $columns.add('_actions'))
44 + #set ($discard = $properties.add('_actions'))
58 58  #end
59 59  <div class="medium-avatars">
60 - #livetable('groupusers' $columns $columnOptions {
61 - 'url': $doc.getURL('view', 'xpage=getgroupmembers'),
47 + #set ($sourceParameters = {
48 + 'template': 'getgroupmembers.vm',
62 62   'translationPrefix': 'xe.admin.groups.',
63 - 'javascriptName': 'editgrouptable',
64 - 'outputOnlyHtml': true
50 + '$doc': $doc.documentReference
65 65   })
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 + })
66 66  </div>
67 67  {{/html}}
68 68  {{/velocity}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,9 +1,4 @@
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 - });
1 +require(['jquery'], function($) {
7 7   $(document).on('click', '#addMembers', function(event) {
8 8   event.preventDefault();
9 9   var addMembersButton = $(event.target);
... ... @@ -29,7 +29,7 @@
29 29   $('#userInput')[0].selectize.clear(true);
30 30   $('#groupInput')[0].selectize.clear(true);
31 31   // Reload the live table.
32 - editgrouptable.refresh();
27 + $("#groupusers").data('liveData').updateEntries();
33 33   // Show notification message.
34 34   if(response.hasIgnored) {
35 35   new XWiki.widgets.Notification(response.ignoredMessage, 'warning', {timeout: 5});
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,5 +3,3 @@
1 -#template('colorThemeInit.vm')
2 -
3 3  /* Make sure the selectize dropdown is displayed on top of the Bootstrap modal. */
4 4  body > .selectize-dropdown {
5 5   z-index: 1051;
... ... @@ -11,13 +11,13 @@
11 11  
12 12  #groupusers {
13 13   margin-top: 20px;
14 -}
15 15  
16 -#groupusers td[data-title] {
17 - vertical-align: middle;
18 -}
13 + td.cell div.view {
14 + vertical-align: middle;
15 + }
19 19  
20 -#groupusers td.type,
21 -#groupusers td.scope {
22 - color: $theme.textSecondaryColor;
17 + [data-livedata-property-id="type"],
18 + [data-livedata-property-id="scope"] {
19 + color: @text-muted;
20 + }
23 23  }
Parser le contenu
... ... @@ -1,1 +1,1 @@
1 -Oui
1 +Non
Content Type
... ... @@ -1,1 +1,1 @@
1 -CSS
1 +LESS