Изменения документа Марафон "ТОП-5 советов, как..."

Редактировал(а) Мария Дужая 2024/11/11 16:56

От версии 9.1
отредактировано Admin Admin
на 2024/02/26 21:14
Изменить комментарий: К данной версии нет комментариев
К версии 5.17
отредактировано Мария Дужая
на 2024/02/26 18:51
Изменить комментарий: Update document after refactoring.

Сводка

Подробности

Свойства страницы
Автор документа
... ... @@ -1,1 +1,1 @@
1 -XWiki.admin
1 +XWiki.mvduzhaya
Содержимое
... ... @@ -1,19 +1,37 @@
1 1  {{velocity}}
2 +#set($sortLetter = 'A')
3 +#set($isFirstPub = true)
2 2  #set($pubRefs = $doc.getChildrenReferences())
3 3  #set($sortedMap = $collectiontool.getSortedMap())
4 4  #foreach($pubRef in $pubRefs)
5 5   #set($pub = $xwiki.getDocument($pubRef))
6 6   #set($title = $pub.getTitle())
7 - #set($foo = $sortedMap.put($title, $pubRef))
9 + #if($title)
10 + #set($foo = $sortedMap.put($title, $pubRef))
11 + #end
8 8  #end
9 9  #foreach($key in $sortedMap.keySet())
10 10   #set($title = $key)
11 11   #set($ref = $sortedMap.get($key))
12 - * [[$title>>$ref]]
16 + #if(!$title.length().equals(0))
17 + #if($title.charAt(0).equals($sortLetter))
18 + #if($isFirstPub)
19 + * $sortLetter
20 + #set($isFirstPub = false)
21 + #end
22 + ** [[$title>>$ref]]
23 + #else
24 + #set($sortLetter = $title.charAt(0))
25 + #set($isFirstPub = false)
26 + * $sortLetter
27 + ** [[$title>>$ref]]
28 + #end
29 + #end
13 13  #end
14 14  {{/velocity}}
15 15  
16 16  
34 +
17 17  ----
18 18  
19 19  ==== ** Правила ТОП-5 СОВЕТОВ, КАК...** ====