Skip to content

Commit

Permalink
XWIKI-19041: Replace the Livetable from DocumentsMacro with a Live Da…
Browse files Browse the repository at this point in the history
…ta macro

- definition of a description parameter for the documents macro
- the generic description is not provided by default
  - no description provided for the page index
  - the text displayed before the space index table is now used as the description (also fix the alignemnt issue)
- likes column now before the actions (i.e., actions always last)
  • Loading branch information
manuelleduc committed Jan 17, 2024
1 parent b213cc0 commit 0f9a4a1
Show file tree
Hide file tree
Showing 2 changed files with 260 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,20 @@
<syntaxId>xwiki/2.0</syntaxId>
<hidden>true</hidden>
<content>{{velocity}}
#if("$!request.space" != "") #set($space=$request.space) #else #set($space = $doc.space) #end
$services.localization.render('platform.index.spaceIndexDescription', [$space])
#if("$!request.space" != "")
#set($space=$request.space)
#else
#set($space = $doc.space)
#end
## Since we display the space index, we do not display page titles and locations, but the old columns name and space
## (old behavior consistent with this old macro)...

{{documents space="$space.replaceAll('["~]', '~$0')" id="spaceindex" columns="doc.name, doc.space, doc.date, doc.author"/}}
{{documents
space="$space.replaceAll('["~]', '~$0')"
id="spaceindex"
columns="doc.name,doc.space,doc.date,doc.author"
description="$services.localization.render('platform.index.spaceIndexDescription', [$space])"
/}}
#set($docextras=[])
{{/velocity}}
</content>
Expand Down Expand Up @@ -86,7 +94,7 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<separators>|, </separators>
<size>5</size>
<unmodifiable>0</unmodifiable>
<values>action=Action|doc.reference=Document|icon.theme=Icon theme|locale=Language|rendering.defaultsyntax=Default syntax|rendering.restricted=Restricted|rendering.targetsyntax=Target syntax|request.base=Request base URL|request.cookies|request.parameters=Request parameters|request.url=Request URL|request.wiki=Request wiki|user=User|wiki=Wiki</values>
<values>action=Action|doc.reference=Document|doc.revision|icon.theme=Icon theme|locale=Language|rendering.defaultsyntax=Default syntax|rendering.restricted=Restricted|rendering.targetsyntax=Target syntax|request.base=Request base URL|request.cookies|request.headers|request.parameters=Request parameters|request.remoteAddr|request.session|request.url=Request URL|request.wiki=Request wiki|sheet|user=User|wiki=Wiki</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</async_context>
<async_enabled>
Expand All @@ -106,6 +114,7 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<name>code</name>
<number>10</number>
<prettyName>Macro code</prettyName>
<restricted>0</restricted>
<rows>20</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
Expand All @@ -118,6 +127,7 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<name>contentDescription</name>
<number>9</number>
<prettyName>Content description (Not applicable for "No content" type)</prettyName>
<restricted>0</restricted>
<rows>5</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
Expand Down Expand Up @@ -186,6 +196,7 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<name>description</name>
<number>3</number>
<prettyName>Macro description</prettyName>
<restricted>0</restricted>
<rows>5</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
Expand Down Expand Up @@ -377,6 +388,7 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<name>description</name>
<number>2</number>
<prettyName>Parameter description</prettyName>
<restricted>0</restricted>
<rows>5</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
Expand All @@ -402,13 +414,24 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</name>
<type>
<cache>0</cache>
<defaultValue>Unknown</defaultValue>
<disabled>0</disabled>
<displayType>input</displayType>
<freeText>allowed</freeText>
<largeStorage>1</largeStorage>
<multiSelect>0</multiSelect>
<name>type</name>
<number>5</number>
<picker>1</picker>
<prettyName>Parameter type</prettyName>
<size>60</size>
<relationalStorage>0</relationalStorage>
<separator>|</separator>
<separators>|</separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
<values>Unknown|Wiki</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</type>
</class>
<property>
Expand Down Expand Up @@ -455,6 +478,7 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<name>description</name>
<number>2</number>
<prettyName>Parameter description</prettyName>
<restricted>0</restricted>
<rows>5</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
Expand All @@ -480,13 +504,24 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</name>
<type>
<cache>0</cache>
<defaultValue>Unknown</defaultValue>
<disabled>0</disabled>
<displayType>input</displayType>
<freeText>allowed</freeText>
<largeStorage>1</largeStorage>
<multiSelect>0</multiSelect>
<name>type</name>
<number>5</number>
<picker>1</picker>
<prettyName>Parameter type</prettyName>
<size>60</size>
<relationalStorage>0</relationalStorage>
<separator>|</separator>
<separators>|</separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
<values>Unknown|Wiki</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</type>
</class>
<property>
Expand Down Expand Up @@ -533,6 +568,7 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<name>description</name>
<number>2</number>
<prettyName>Parameter description</prettyName>
<restricted>0</restricted>
<rows>5</rows>
<size>40</size>
<unmodifiable>0</unmodifiable>
Expand All @@ -558,13 +594,24 @@ $services.localization.render('platform.index.spaceIndexDescription', [$space])
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</name>
<type>
<cache>0</cache>
<defaultValue>Unknown</defaultValue>
<disabled>0</disabled>
<displayType>input</displayType>
<freeText>allowed</freeText>
<largeStorage>1</largeStorage>
<multiSelect>0</multiSelect>
<name>type</name>
<number>5</number>
<picker>1</picker>
<prettyName>Parameter type</prettyName>
<size>60</size>
<relationalStorage>0</relationalStorage>
<separator>|</separator>
<separators>|</separators>
<size>1</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
<values>Unknown|Wiki</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</type>
</class>
<property>
Expand Down
Loading

0 comments on commit 0f9a4a1

Please sign in to comment.