Изменения документа 02. Деятельность СЗН
Редактировал(а) Мария Дужая 2024/08/15 14:18
От версии 2.2
отредактировано Admin Admin
на 2024/05/18 00:57
на 2024/05/18 00:57
Изменить комментарий:
К данной версии нет комментариев
К версии 4.1
отредактировано Admin Admin
на 2024/05/21 02:10
на 2024/05/21 02:10
Изменить комментарий:
К данной версии нет комментариев
Сводка
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -18,16 +18,11 @@ 18 18 ul.button-list { 19 19 padding: 0; 20 20 list-style-type: none; 21 + display: flex; 22 + flex-wrap: wrap; 21 21 } 22 22 23 - .button-list li { 24 - display: inline-block; 25 - vertical-align: top; 26 - margin: 10px; 27 - } 28 - 29 29 .button-link { 30 - display: inline-block; 31 31 a:link, a:active, a:visited { 32 32 display: flex; 33 33 align-items: center; ... ... @@ -34,7 +34,7 @@ 34 34 justify-content: center; 35 35 width: 280px; 36 36 height: 75px; 37 - font-family: 'Montserrat', sans-serif !important;32 + font-family: 'Montserrat', sans-serif; 38 38 font-size: 14px; 39 39 font-weight: 600; 40 40 cursor: pointer; ... ... @@ -45,7 +45,7 @@ 45 45 border: none; 46 46 border-radius: 10px; 47 47 box-shadow: 0 0 9px rgba(0, 0, 0, 0.25); 48 - margin: 10px; 43 + margin: 0 10px 10px 10px; 49 49 padding: 0 10px; 50 50 } 51 51 } ... ... @@ -55,20 +55,53 @@ 55 55 background-color: rgba(0, 0, 0, 0.03); 56 56 } 57 57 } 53 + 54 + .button-link.small-font { 55 + a:link, a:active, a:visited { 56 + font-size: 13px; 57 + } 58 + } 58 58 </style> 59 59 </head> 60 60 {{/html}} 61 61 62 62 {{velocity}} 63 -{{html wiki="true"}} 64 -(% <ul class="button-list"> %) 64 +{{html clean="false"}} 65 + <b>Подразделы:</b><br><br> 66 + <ul class="button-list"> 67 +{{/html}} 68 +#set($maxUncutTitle = 100) 69 +#set($maxTitleWithoutFontReduction = 80) 70 + 65 65 #set($pubRefs = $doc.getChildrenReferences()) 72 +#set($entries = []) 66 66 #foreach($pubRef in $pubRefs) 67 67 #set($pub = $xwiki.getDocument($pubRef)) 68 68 #set($title = $pub.getTitle()) 69 - (% class="button-link" %) 70 - (% <li> %)[[$title>>$pubRef]](% </li> %) 76 + #if($title.length() > $maxUncutTitle) 77 + #set($shortTitle = $title.substring(0, $maxUncutTitle)) 78 + #set($shortTitle = $shortTitle + "...") 79 + #else 80 + #set($shortTitle = $title) 81 + #end 82 + #set($map = {"title": $shortTitle, "ref": $pubRef, "doc": $pub}) 83 + #set($discard = $entries.add($map)) 71 71 #end 72 -{{/html}} 73 -(% </ul> %) 85 + 86 +#foreach($entry in $collectiontool.sort($entries, "title:asc")) 87 + #set($pubRef = $entry.ref) 88 + #set($pub = $entry.doc) 89 + #set($title = $entry.title) 90 + 91 + #if($title.length() > $maxTitleWithoutFontReduction) 92 + ## При передаче в class переменной почему-то из неё берётся значение до первого пробела 93 + ## поэтому случай, когда два CSS-класса, прописывается вручную 94 + (% class="button-link small-font" %) 95 + [[$title>>$pubRef]] 96 + #else 97 + (% class="button-link" %) 98 + [[$title>>$pubRef]] 99 + #end 100 +#end 101 +{{html clean="false"}} </ul> {{/html}} 74 74 {{/velocity}}