Änderungen von Dokument Contributors
Zuletzt geändert von Daniel Herrmann am 2025/11/08 02:47
Von Version 1.1
bearbeitet von Daniel Herrmann
am 2025/06/22 18:48
am 2025/06/22 18:48
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.26.20]
Auf Version
10.1
bearbeitet von Daniel Herrmann
am 2025/11/08 02:47
am 2025/11/08 02:47
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.28.4]
Zusammenfassung
Details
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -1,16 +14,3 @@ 1 -{{groovy output="false"}} 2 - xcontext.put("sortContributions", (contributions, key, reverse) -> { 3 - def c = new ArrayList(contributions) 4 - Collections.sort(c, new Comparator<HashMap>() { 5 - @Override 6 - public int compare(HashMap<String, Object> v1, HashMap<String, Object> v2) { 7 - return reverse ? v2.get(key).compareTo(v1.get(key)) : v1.get(key).compareTo(v2.get(key)) 8 - } 9 - }) 10 - return c 11 - }) 12 -{{/groovy}} 13 - 14 14 {{velocity output="false"}} 15 15 #macro (datemax $d1 $d2) 16 16 #if ($d1.compareTo($d2))## ... ... @@ -20,7 +20,7 @@ 20 20 #end 21 21 #end 22 22 #macro (showContribution $contribution) 23 - <a class="contributor-name" href="$escapetool.xml($xwiki.getURL($contribution['name']))">$xwiki.get LocalUserName($contribution['name'])</a>10 + <a class="contributor-name" href="$escapetool.xml($xwiki.getURL($contribution['name']))">$xwiki.getUserName($contribution['name'], false)</a> 24 24 #if ($showCount) 25 25 <span class="contributor-contribution-count"> $contribution['count'] </span> 26 26 #end ... ... @@ -121,7 +121,11 @@ 121 121 #set($query = $services.query.xwql("select comment.author, max(comment.date), count(distinct comment) from Document doc, doc.object('XWiki.XWikiComments') comment where doc.fullName in (:d) group by comment.author")) 122 122 #addContributions($query, $pages) 123 123 #end 124 - #set($contributions = $xcontext.get('sortContributions').doCall($contributors.values(), $order, $reverse)) 111 + #set ($limit = $numbertool.toNumber($limit).intValue()) 112 + #if (!$limit) 113 + #set ($limit = -1) 114 + #end 115 + #set ($contributions = $services.contributors.sortContributors($contributors.values(), $order, $reverse, $numbertool.toNumber($limit).intValue())) 125 125 126 126 {{html clean=false}} 127 127 <div class="confluence-contributors"> ... ... @@ -133,7 +133,7 @@ 133 133 #foreach ($page in $pages) 134 134 #if (!$foreach.first), #end## 135 135 #set($d = $xwiki.getDocument($page)) 136 - <a href="$escapetool.xml($d.getURL())">## 127 + <a class="contributors-page" href="$escapetool.xml($d.getURL())">## 137 137 #set($title = "$!d.getRenderedTitle($xwiki.currentContentSyntaxId)") 138 138 #if ($title != "") 139 139 $escapetool.xml($title)## ... ... @@ -159,7 +159,7 @@ 159 159 </ul> 160 160 #else 161 161 #foreach($contribution in $contributions) 162 - #if(!$foreach.first), #end153 + #if(!$foreach.first),#end 163 163 #showContribution($contribution) 164 164 #end 165 165 #end ... ... @@ -178,7 +178,7 @@ 178 178 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 179 179 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 180 180 ## don't have view right on those pages. 181 -#if ($services.licensing. licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))172 +#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 182 182 #executeMacro 183 183 #else 184 184 {{missingLicenseMessage extensionName="proMacros.extension.name"/}}