Changes for page LiveTable View Sheet

Last modified by Martin Výlet on 19.03.2025 21:26

From version 2.1
edited by superadmin
on 06.01.2023 13:11
Change comment: Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/14.10.2]
To version 6.1
edited by Martin Výlet
on 19.03.2025 21:26
Change comment: Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/17.1.0]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.superadmin
1 +XWiki.vyl0022
Content
... ... @@ -11,16 +11,8 @@
11 11   ## Display the live table only if it was generated.
12 12   #if ($doc.content.length() > 0)
13 13   = $services.localization.render('platform.appwithinminutes.appLiveTableHeading') =
14 - ## We don't use the Include macro (with empty reference) because we want the content to be executed with the rights
15 - ## of the current document rather than the rights of the sheet. This is important because the user can modify the
16 - ## content of the application home page which means we could execute untrusted content with the rights of the sheet.
17 - ## Ideally we should use the Display macro with a parameter to disable the sheet, but we don't have this parameter.
18 - ## We don't clean the HTML content because getRenderedContent() should produce clean HTML, unless the user has
19 - ## disabled the HTML cleaning, in which case he will get what he asked for. Note that one good reason to disable
20 - ## HTML cleaning is to preserve the whitespaces in the attribute values.
21 - ## Escape {{ in the rendered content to be sure that the HTML macro is not closed unintentionally.
22 - {{html clean="false"}}$doc.getRenderedContent($doc.content,
23 - $doc.syntax.toIdString()).replace('{{', '{{'){{/html}}
14 +
15 + {{include reference="" author="target"/}}
24 24   #end
25 25  #end
26 26  
... ... @@ -59,7 +59,7 @@
59 59   (((
60 60   = $services.localization.render('platform.appwithinminutes.appHomePageActionsHeading') =
61 61   #if ($hasCreateData)
62 - * [[$services.localization.render('platform.appwithinminutes.appHomePageAddEntryHint')>>||anchor="AddNewEntry" class="action add"]]##
54 + * [[{{displayIcon name="add"/}} $services.localization.render('platform.appwithinminutes.appHomePageAddEntryHint')>>||anchor="AddNewEntry" class="action add"]]##
63 63   #if ("$!templateProvider.getValue('terminal')" == '1')
64 64   #set ($entryReference = $services.model.createDocumentReference('__entryName__', $dataSpaceRef))
65 65   #else
... ... @@ -68,6 +68,7 @@
68 68   #end
69 69   ## We need to set the title if we want to be able to sort or filter the doc.title live table column.
70 70   #set ($params = {
63 + 'form_token': $services.csrf.token,
71 71   'template': "${className}Template",
72 72   'title': '__entryName__',
73 73   'parent': $services.model.serialize($doc.documentReference, 'local')
... ... @@ -91,10 +91,10 @@
91 91   'appName': $doc.space,
92 92   'resolve': true
93 93   }))
94 - * [[$services.localization.render('platform.appwithinminutes.appHomePageEditAppLabel')>>AppWithinMinutes.CreateApplication||queryString="$queryString" class="action edit"]]
87 + * [[{{displayIcon name="edit"/}} $services.localization.render('platform.appwithinminutes.appHomePageEditAppLabel')>>AppWithinMinutes.CreateApplication||queryString="$queryString" class="action edit"]]
95 95   #end
96 96   #if ($hasEditTranslations)
97 - * [[$services.localization.render('platform.appwithinminutes.appHomePageTranslateAppLabel')>>path:${xwiki.getURL($translationsRef, 'edit', 'editor=wiki')}||class="action translate"]]
90 + * [[{{displayIcon name="translate"/}} $services.localization.render('platform.appwithinminutes.appHomePageTranslateAppLabel')>>path:${xwiki.getURL($translationsRef, 'edit', 'editor=wiki')}||class="action translate"]]
98 98   #end
99 99   #if ($hasDeleteData)
100 100   #set ($deleteDataURL = $xwiki.getURL('AppWithinMinutes.DeleteApplication', 'view', $escapetool.url({
... ... @@ -103,7 +103,7 @@
103 103   'scope': 'entries',
104 104   'xredirect': $doc.getURL()
105 105   })))
106 - * [[$services.localization.render('platform.appwithinminutes.appHomePageDeleteEntriesLabel')>>path:${deleteDataURL}||class="action deleteData"]]
99 + * [[{{displayIcon name="cross"/}} $services.localization.render('platform.appwithinminutes.appHomePageDeleteEntriesLabel')>>path:${deleteDataURL}||class="action deleteData"]]
107 107   #end
108 108   #if ($hasDeleteApplication)
109 109   #set ($deleteAppURL = $xwiki.getURL('AppWithinMinutes.DeleteApplication', 'view', $escapetool.url({
... ... @@ -111,7 +111,7 @@
111 111   'resolve': true,
112 112   'xredirect': $doc.getURL()
113 113   })))
114 - * [[$services.localization.render('platform.appwithinminutes.appHomePageDeleteAppLabel')>>path:${deleteAppURL}||class="action delete"]]
107 + * [[{{displayIcon name="trash"/}} $services.localization.render('platform.appwithinminutes.appHomePageDeleteAppLabel')>>path:${deleteAppURL}||class="action delete"]]
115 115   #end
116 116   )))
117 117   #end
... ... @@ -211,7 +211,7 @@
211 211   #set ($classFullName = $doc.getValue('class'))
212 212   #if ("$!classFullName" == '' || !$xwiki.exists($classFullName))
213 213   {{warning}}
214 - $services.icon.render('warning') {{translation key="platform.appwithinminutes.appHomePageMovedWarning"/}}
207 + {{translation key="platform.appwithinminutes.appHomePageMovedWarning"/}}
215 215   {{/warning}}
216 216  
217 217   #end
locate.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Admin
Size
... ... @@ -1,1 +1,0 @@
1 -746 bytes
Content
XWiki.JavaScriptExtension[0]
Code
... ... @@ -59,7 +59,8 @@
59 59   * Rename Application
60 60   */
61 61  require(['jquery', 'bootstrap', 'xwiki-form-validation-async'], function($) {
62 - #set ($currentDocReference = $xwiki.getDocument($request.currentApp).getDocumentReference())
62 + ## Note: if not currentApp request param is not passed, we default to the wiki home page reference to avoid a NPE
63 + #set ($currentDocReference = $xwiki.getDocument("$!request.currentApp").getDocumentReference())
63 63   // if we cannot find any extension related to this page app, it's not part of an extension.
64 64   var isNotAnExtension = $services.extension.xar.getInstalledExtensions($currentDocReference).isEmpty();
65 65  
XWiki.StyleSheetExtension[0]
Code
... ... @@ -16,30 +16,10 @@
16 16   background: none no-repeat scroll 0 center transparent;
17 17   display: block;
18 18   font-size: .8em;
19 - padding: .3em .3em .3em 20px;
19 + padding: .3em .3em .3em .3em;
20 20   text-transform: uppercase;
21 21  }
22 22  
23 -#actionBox .action.edit {
24 - background-image: url("$xwiki.getSkinFile('icons/silk/application_edit.png')");
25 -}
26 -
27 -#actionBox .action.translate {
28 - background-image: url("$doc.getAttachmentURL('locate.png')");
29 -}
30 -
31 -#actionBox .action.delete {
32 - background-image: url("$xwiki.getSkinFile('icons/silk/application_delete.png')");
33 -}
34 -
35 -#actionBox .action.deleteData {
36 - background-image: url("$xwiki.getSkinFile('icons/silk/application_form_delete.png')");
37 -}
38 -
39 -#actionBox .action.add {
40 - background-image: url("$xwiki.getSkinFile('icons/silk/add.png')");
41 -}
42 -
43 43  #entryNamePopup {
44 44   margin-right: 20px;
45 45  }