Changes for page Users
From version 9.1
edited by Andrea Omicini
on 2026/08/29 01:11
on 2026/08/29 01:11
Change comment:
There is no comment for this version
To version 15.1
edited by Andrea Omicini
on 2026/08/29 18:06
on 2026/08/29 18:06
Change comment:
restore the translated title lost in the rename
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -14,6 +14,11 @@ 14 14 ## 15 15 ## the groups, in class order, and the people, from the users themselves 16 16 #set( $statusList = $xwiki.getDocument('XWiki.XWikiUsers').getxWikiClass().get('status').getListValues() ) 17 +## an optional ?status=<value> filter. The value is validated against the list the 18 +## class itself declares, so no status value is written down here: change the class 19 +## and both the grouping and the filter follow. 20 +#set( $wanted = "$!request.getParameter('status')" ) 21 +#set( $known = ( $wanted == '' || $statusList.contains($wanted) ) ) 17 17 #set( $people = {} ) 18 18 #foreach( $s in $statusList ) 19 19 #set( $discard = $people.put($s, []) ) ... ... @@ -55,16 +55,27 @@ 55 55 #end 56 56 #end 57 57 ## 58 -#### CURRENT PEOPLE — every status except students and past members 59 -#foreach( $s in $statusList ) 60 - #if( $s != 'Student' && $s != 'Gone' ) 61 - #apiceGroup($s) 63 +#if( !$known ) 64 +#### the class does not declare this value — say so, and show what it does declare 65 +>{{stringEngIta eng="Unknown status" ita="Stato sconosciuto"/}}: **$escapetool.xml($wanted)** 66 + 67 + #foreach( $s in $statusList )[[$services.localization.render("XWiki.XWikiUsers_status_${s}")>>path:$doc.getURL('view', "status=${s}")]]#if( !$foreach.last ) • #end#end 68 + 69 +#elseif( $wanted != '' ) 70 +#### ONE GROUP, ASKED FOR BY ?status= — students included, like any other value 71 + #if( $people.get($wanted).isEmpty() ) 72 + 73 +>{{stringEngIta eng="Nobody has this status" ita="Nessuno ha questo stato"/}} 74 + 75 + #else 76 + #apiceGroup($wanted) 62 62 #end 78 +#else 79 +#### EVERY GROUP THE CLASS DECLARES, in the class's own order 80 +#foreach( $s in $statusList ) 81 + #apiceGroup($s) 63 63 #end 64 64 ## 65 -#### PAST MEMBERS 66 -#apiceGroup('Gone') 67 -## 68 68 #### anyone whose status is not among those declared by the class — should be empty 69 69 #set( $strays = [] ) 70 70 #foreach( $ref in $rows ) ... ... @@ -79,5 +79,6 @@ 79 79 #foreach( $stray in $strays )$stray#if( !$foreach.last ) • #end#end 80 80 81 81 #end 98 +#end 82 82 {{/velocity}} 83 83