Исходный код вики Постановления
Версия 3.1 от Admin Admin на 2024/05/28 11:01
Скрыть последних авторов
| author | version | line-number | content |
|---|---|---|---|
| |
3.1 | 1 | Постановления Правительства Российской Федерации (в обратном хронологическом порядке): |
| |
2.2 | 2 | |
| |
2.1 | 3 | {{velocity}} |
| 4 | #set($pubRefs = $doc.getChildrenReferences()) | ||
| |
3.1 | 5 | #set($entries = []) |
| |
2.1 | 6 | #foreach($pubRef in $pubRefs) |
| 7 | #set($pub = $xwiki.getDocument($pubRef)) | ||
| 8 | #set($title = $pub.getTitle()) | ||
| |
3.1 | 9 | #set($start = $title.indexOf("от ") + 3) |
| 10 | #set($end = $title.indexOf(" №")) | ||
| 11 | #if($start >= 0 && $end > $start) | ||
| 12 | #set($dateStr = $title.substring($start, $end)) | ||
| 13 | #set($date = $datetool.toDate("dd.MM.yyyy", $dateStr)) | ||
| 14 | #set($map = {"date": $date, "ref": $pubRef, "doc": $pub}) | ||
| 15 | #set($discard = $entries.add($map)) | ||
| 16 | #end | ||
| |
2.1 | 17 | #end |
| |
3.1 | 18 | #foreach($entry in $collectiontool.sort($entries, "date:desc")) |
| 19 | #set($pubRef = $entry.ref) | ||
| 20 | #set($pub = $entry.doc) | ||
| 21 | #set($title = $pub.getTitle()) | ||
| 22 | #set($content = $pub.getContent()) | ||
| 23 | #set($firstParagraph = $stringtool.substringBefore($content, "{")) | ||
| 24 | * [[**$title**>>$pubRef]] | ||
| 25 | $firstParagraph | ||
| 26 | ##Ниже перенос строки для дополнительного отступа | ||
| 27 | |||
| 28 | #end | ||
| |
2.1 | 29 | {{/velocity}} |