Changes for page ИТ Отдел

Last modified by Алексей Александрович Иванов on 2025/10/31 08:32

From version 3.1
edited by root_xwiki
on 2025/10/08 08:09
Change comment: There is no comment for this version
To version 2.1
edited by root_xwiki
on 2025/10/08 08:07
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,21 +19,3 @@
1 -{{velocity}}
2 -## Получаем текущее пространство (для nested spaces)
3 -#set($currentDocRef = $doc.documentReference)
4 -#set($currentSpaceRef = $currentDocRef.lastSpaceReference)
5 -
6 -## Запрос всех дочерних страниц (nested pages в XWiki 14+)
7 -#set($query = "select doc.fullName from XWikiDocument as doc where doc.space like '${doc.space}.%' and doc.name = 'WebHome' order by doc.title")
8 -#set($childPages = $services.query.hql($query).execute())
9 -
10 -## Альтернатива для плоской структуры (если nested spaces не используются):
11 -## #set($childPages = $services.query.xwql("where doc.space = '${doc.space}' and doc.name <> 'WebHome' order by doc.title").execute())
12 -
13 -#set($hasInstructions = false)
14 -#if($childPages && $childPages.size() > 0)
15 - #set($hasInstructions = true)
16 -#end
17 -{{/velocity}}
18 -
19 19  = IT отдел
20 20  
21 21  Добро пожаловать в раздел инструкций IT отдела. Ниже представлены все доступные инструкции:
... ... @@ -23,53 +23,39 @@
23 23  == Инструкции отдела
24 24  
25 25  {{velocity}}
26 -#if($hasInstructions)
27 - {{html clean="false"}}
28 - <div class="row justify-content-start">
29 - #foreach($childPageFullName in $childPages)
30 - #set($childDoc = $xwiki.getDocument($childPageFullName))
8 +#set($currentSpace = $doc.space)
9 +#set($childPages = $services.query.xwql("where doc.space = '$currentSpace' and doc.name <> 'WebHome' order by doc.title").execute())
10 +
11 +#if($childPages.size() > 0)
12 + (%class="row"%)
13 + #foreach($childPageRef in $childPages)
14 + #set($childDoc = $xwiki.getDocument($childPageRef))
31 31   #set($childTitle = $childDoc.getPlainTitle())
32 32   #set($childURL = $childDoc.getURL())
33 - #set($childDescription = "Нажмите для просмотра инструкции")
17 + #set($childDescription = $childDoc.getObject("XWiki.TagClass").getProperty("tags").value)
18 + #if(!$childDescription || $childDescription == "")
19 + #set($childDescription = "Нажмите для просмотра инструкции")
20 + #end
34 34  
35 - <div class="col-md-6 col-lg-4 mb-4">
36 - <div class="card shadow-sm border-0 rounded-3 card-hover" style="transition: transform 0.3s ease, box-shadow 0.3s ease;">
37 - <div class="card-body p-4 text-center">
38 - <div class="icon-wrapper mb-3 mx-auto rounded-circle bg-info bg-opacity-10 p-3" style="width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(23,162,184,0.2);">
39 - <i class="fas fa-file-alt" style="font-size: 28px; color: #17a2b8;"></i>
40 - </div>
41 - <h4 class="h5 fw-semibold mb-2">$childTitle</h4>
42 - <p class="text-muted mb-3" style="font-size: 0.9rem;">$childDescription</p>
43 - <a href="$childURL" class="btn btn-info rounded-pill px-4 py-2" style="background-color: #17a2b8; border-color: #17a2b8; color: white; text-decoration: none; display: inline-block;">
44 - <i class="fas fa-arrow-right me-2"></i>Открыть инструкцию
45 - </a>
46 - </div>
22 + (%class="col-md-6 col-lg-4 mb-4"%)
23 + {{{
24 + <div class="card shadow-sm border-0 rounded-3" style="transition: transform 0.3s;">
25 + <div class="card-body p-4">
26 + <h4>$childTitle</h4>
27 + <p class="text-muted">$childDescription</p>
28 + <a href="$childURL" class="btn btn-primary rounded-pill px-4 py-2">Открыть инструкцию</a>
47 47   </div>
48 48   </div>
31 + }}}
32 + (%/)
49 49   #end
50 - </div>
51 - {{/html}}
34 + (%/)
52 52  #else
53 - {{info}}В этом разделе пока нет инструкций. Создайте новую страницу через кнопку Create.{{/info}}
36 + <div class="alert alert-info">В этом разделе пока нет инструкций. Создайте новую страницу.</div>
54 54  #end
55 55  {{/velocity}}
56 56  
57 57  == Добавить новую инструкцию
58 58  
59 -Для создания новой инструкции нажмите **Create** в меню выше и выберите родительское пространство **"ИТ Отдел"**.
42 +Для создания новой инструкции нажмите [[Create>>$xwiki.getURL($doc.documentReference, 'create')]]
60 60  
61 -{{velocity}}
62 -<style>
63 - .card-hover:hover {
64 - transform: translateY(-5px);
65 - box-shadow: 0 8px 20px rgba(23,162,184,0.2) !important;
66 - }
67 - .btn:hover {
68 - opacity: 0.9;
69 - }
70 - .icon-wrapper i {
71 - font-size: 28px;
72 - }
73 -</style>
74 -{{/velocity}}
75 -