Modifications pour le document Fichiers joints

Modifié par Florent Charton le 2024/08/08 18:43

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-index-ui/15.10.11]
À la version 1.1
modifié par superadmin
sur 2022/06/20 08:48
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-index-ui/13.10.6]

Résumé

Détails

Propriétés de la Page
Auteur du document
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.fcharton
1 +XWiki.superadmin
Contenu
... ... @@ -1,31 +1,24 @@
1 1  {{velocity}}
2 -#set ($discard = $xwiki.ssfx.use('js/xwiki/viewers/attachments.css', true))
3 -#set ($sourceParameters = $escapetool.url({
4 - 'className': 'XWiki.AllAttachments',
2 +#set ($discard = $xwiki.ssx.use('XWiki.AllAttachments'))
3 +#set ($discard = $xwiki.jsx.use('XWiki.AllAttachments'))
4 +#set ($columns = ['mimeType', 'filename', 'doc.fullName', 'filesize', 'date', 'author'])
5 +#set ($columnsProperties = {
6 + 'mimeType': {'type': 'list', 'class': 'XWiki.AllAttachments'},
7 + 'filename': {'type': 'text'},
8 + 'doc.fullName': {'type': 'text'},
9 + 'filesize': {'type': 'list', 'class': 'XWiki.AllAttachments'},
10 + 'date': {'type': 'date'},
11 + 'author': {'type': 'text'}
12 +})
13 +#set ($options = {
5 5   'resultPage': 'XWiki.AllAttachmentsResults',
6 - 'translationPrefix': 'platform.index.attachments.'
7 -}))
8 -#set ($liveDataConfig = {
9 - 'meta': {
10 - 'propertyDescriptors': [
11 - { 'id': 'mimeType', 'displayer': 'html'},
12 - { 'id': 'filename', 'displayer': { 'id': 'link', 'propertyHref': 'fileurl' } },
13 - { 'id': 'doc.fullName', 'displayer': 'html' },
14 - { 'id': 'filesize', 'displayer': 'html' },
15 - { 'id': 'date', 'filter': 'date'},
16 - { 'id': 'author', 'displayer': 'html' }
17 - ],
18 - 'actions': [
19 - {'id': 'view', 'allowProperty': 'acclev'}
20 - ]
21 - }
15 + 'callback': 'XWiki.index.displayAttachmentEntry',
16 + 'translationPrefix': 'platform.index.attachments.',
17 + 'selectedColumn': 'filename'
22 22  })
23 -
24 -{{liveData
25 - id='allattachments'
26 - source='liveTable'
27 - sourceParameters="$sourceParameters"
28 - properties='mimeType,filename,doc.fullName,filesize,date,author'
29 - sort='filename:asc'
30 -}}$jsontool.serialize($liveDataConfig){{/liveData}}
19 +#livetable('allattachments' $columns $columnsProperties $options)
31 31  {{/velocity}}
21 +
22 +(% id="inaccessibleDocsMessage" class="hidden" %)(((
23 + {{info}}{{translation key="rightsmanager.documentrequireviewrights" /}}{{/info}}
24 +)))
XWiki.JavaScriptExtension[0]
Mode de mise en cache
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,25 @@
1 +(function() {
2 + var XWiki = window.XWiki || {};
3 + XWiki.index = XWiki.index || {};
4 + XWiki.index.displayAttachmentEntry = function (row, i, table) {
5 + var tr = new Element('tr');
6 + if (row.acclev == true) {
7 + tr.appendChild(new Element('td').update(row.mimeType));
8 + var fileLink = new Element('a', {'href': row.fileurl}).update(row.filename.escapeHTML());
9 + tr.appendChild(new Element('td').update(fileLink));
10 + tr.appendChild(new Element('td', {'class': 'location'}).update(row.fullName));
11 + tr.appendChild(new Element('td').update(row.filesize));
12 + tr.appendChild(new Element('td').update(row.date.escapeHTML()));
13 + tr.appendChild(new Element('td').update(row.author));
14 + } else {
15 + tr.appendChild(new Element('td'));
16 + tr.appendChild(new Element('td'));
17 + tr.appendChild(new Element('td', {'class': 'location'}).update(row.fullName + '*'));
18 + tr.appendChild(new Element('td'));
19 + tr.appendChild(new Element('td'));
20 + tr.appendChild(new Element('td'));
21 + $('inaccessibleDocsMessage').removeClassName('hidden');
22 + }
23 + return tr;
24 + }
25 +})();
Parser le contenu
... ... @@ -1,0 +1,1 @@
1 +Oui
Utiliser cette extension
... ... @@ -1,0 +1,1 @@
1 +onDemand
XWiki.StyleSheetExtension[0]
Mode de mise en cache
... ... @@ -1,0 +1,1 @@
1 +long
Code
... ... @@ -1,0 +1,14 @@
1 +#template('colorThemeInit.vm')
2 +
3 +#allattachments .mime {
4 + color: $theme.textSecondaryColor;
5 + font-size: 32px;
6 + height: 32px;
7 + line-height: 32px;
8 + text-align: center;
9 +}
10 +
11 +#allattachments .mime img {
12 + max-height: 32px;
13 + max-width: 48px;
14 +}
Content Type
... ... @@ -1,0 +1,1 @@
1 +CSS
Parser le contenu
... ... @@ -1,0 +1,1 @@
1 +Oui
Utiliser cette extension
... ... @@ -1,0 +1,1 @@
1 +onDemand