Änderungen von Dokument Contributors

Zuletzt geändert von Daniel Herrmann am 2025/11/08 02:47

Von Version Icon 6.1 Icon
bearbeitet von Daniel Herrmann
am 2025/07/19 16:44
Änderungskommentar: Migrated property [order] from class [XWiki.WikiMacroParameterClass]
Auf Version 1.1 Icon
bearbeitet von Daniel Herrmann
am 2025/06/22 18:48
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.26.20]

Zusammenfassung

Details

Icon XWiki.WikiMacroClass[0]
Makro-Code
... ... @@ -1,5 +1,5 @@
1 1  {{groovy output="false"}}
2 - xcontext.put("sortContributions", (contributions, key, reverse, limit) -> {
2 + xcontext.put("sortContributions", (contributions, key, reverse) -> {
3 3   def c = new ArrayList(contributions)
4 4   Collections.sort(c, new Comparator<HashMap>() {
5 5   @Override
... ... @@ -7,10 +7,6 @@
7 7   return reverse ? v2.get(key).compareTo(v1.get(key)) : v1.get(key).compareTo(v2.get(key))
8 8   }
9 9   })
10 - if (limit != null && limit > 0) {
11 - return c.take(limit)
12 - }
13 -
14 14   return c
15 15   })
16 16  {{/groovy}}
... ... @@ -125,7 +125,7 @@
125 125   #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"))
126 126   #addContributions($query, $pages)
127 127   #end
128 - #set($contributions = $xcontext.get('sortContributions').doCall($contributors.values(), $order, $reverse, $mathtool.toInteger($limit)))
124 + #set($contributions = $xcontext.get('sortContributions').doCall($contributors.values(), $order, $reverse))
129 129  
130 130  {{html clean=false}}
131 131   <div class="confluence-contributors">