Исходный код вики Приказы

Версия 8.1 от Admin Admin на 2024/05/13 02:07

Скрыть последних авторов
Admin Admin 2.1 1 {{velocity}}
2 #set($pubRefs = $doc.getChildrenReferences())
Admin Admin 6.4 3 #set($entries = [])
Admin Admin 4.1 4 #foreach($pubRef in $pubRefs)
Admin Admin 2.1 5 #set($pub = $xwiki.getDocument($pubRef))
6 #set($title = $pub.getTitle())
Admin Admin 8.1 7 ##set($dateStr = $title.substring(10, 20))
8 #set($start = $title.indexOf("от ") + 3)
9 #set($end = $title.indexOf(" №"))
10 #if($start >= 0 && $end > $start)
11 #set($dateStr = $title.substring($start, $end))
12 #set($date = $datetool.toDate("dd.MM.yyyy", $dateStr))
13 #set($map = {"date": $date, "ref": $pubRef, "doc": $pub})
14 #set($discard = $entries.add($map))
15 #end
Admin Admin 4.1 16 #end
Admin Admin 6.4 17 #foreach($entry in $collectiontool.sort($entries, "date:desc"))
18 #set($pubRef = $entry.ref)
Admin Admin 7.1 19 #set($pub = $entry.doc)
Admin Admin 4.1 20 #set($title = $pub.getTitle())
Admin Admin 7.1 21 #set($content = $pub.getContent())
22 #set($firstParagraph = $stringtool.substringBefore($content, "{"))
Admin Admin 8.1 23 * [[**$title**>>$pubRef]]
Admin Admin 7.1 24 $firstParagraph
Admin Admin 8.1 25
Admin Admin 2.1 26 #end
27 {{/velocity}}