文档更改Home

Yang Sheng 于 2025-02-42,18:57 最后修改

从版本 110.1
Yang Sheng编辑
在2025-02-42,00:22上
修改评论: 该版本没有评论
到版本
Yang Sheng编辑
在2025-02-42,01:14上
修改评论: 该版本没有评论

摘要

细节

页面属性
内容
... ... @@ -23,9 +23,28 @@
23 23  ## 定义需要忽略的页面标题列表
24 24  #set($ignoreTitles = ["页面管理", "脚本&自动化"])
25 25  
26 +{{html clean="false" wiki="false"}}
27 +<style>
28 + .recent-updates h4 {
29 + margin: 5px 0 !important; /* 强制覆盖其他样式 */
30 + padding: 0 !important;
31 + }
32 + .recent-updates h2 {
33 + margin-bottom: 5px !important; /* 减少与下一个元素间的间距 */
34 + }
35 + .recent-updates ul {
36 + margin: 5px 0 !important; /* 控制列表的上下间距 */
37 + padding-left: 20px !important; /* 确保列表有适当的缩进 */
38 + }
39 + .recent-updates ul li {
40 + margin: 3px 0 !important; /* 控制列表项的上下间距 */
41 + }
42 +</style>
43 +<div class="recent-updates">
44 +{{/html}}
45 +
26 26  ## 输出结果
27 27  #foreach($topPage in $topLevelPages)
28 - = $topPage =
29 29   ## 查询每个一级链接下所有子页面的最近更新
30 30   #set($hqlQuery = "select doc.fullName from XWikiDocument doc where doc.fullName like :spacePattern and doc.fullName not like '%:WebPreferences' and doc.fullName not like '%:WebHome' and doc.fullName not like '%:WebSearch' and doc.fullName not like '%:WebRss' and doc.fullName not like '%:WebStatistics' order by doc.date desc")
31 31   #set($query = $services.query.hql($hqlQuery))
... ... @@ -33,30 +33,52 @@
33 33   #set($query = $query.setLimit(3))
34 34   #set($recentDocs = $query.execute())
35 35  
36 - #if($recentDocs.isEmpty())
37 - No recent updates.
38 - #else
39 - #foreach($docFullName in $recentDocs)
40 - #set($document = $xwiki.getDocument($docFullName))
41 - #if($document)
42 - #set($docTitle = $document.getDisplayTitle())
43 - ## 仅当用户有查看权限时显示
44 - #if($xwiki.hasAccessLevel('view', $xcontext.user, $document.getFullName()))
45 - ## 检查页面标题是否在忽略列表中
46 - #if(!$ignoreTitles.contains($docTitle))
47 - #if($docTitle == '')
48 - #set($docTitle = "Untitled Document")
49 - #end
50 - * [[${docTitle}>>${document.getExternalURL('view')}]]
55 + #set($hasUpdates = false)
56 + #foreach($docFullName in $recentDocs)
57 + #set($document = $xwiki.getDocument($docFullName))
58 + #if($document)
59 + #set($docTitle = $document.getDisplayTitle())
60 + ## 仅当用户有查看权限时显示
61 + #if($xwiki.hasAccessLevel('view', $xcontext.user, $document.getFullName()))
62 + ## 检查页面标题是否在忽略列表中
63 + #if(!$ignoreTitles.contains($docTitle))
64 + #if($docTitle == '')
65 + #set($docTitle = "Untitled Document")
51 51   #end
67 + #if(!$hasUpdates)
68 + {{html clean="false" wiki="false"}}
69 + <h4>$topPage</h4>
70 + <ul>
71 + {{/html}}
72 + #set($hasUpdates = true)
73 + #end
74 + {{html clean="false" wiki="false"}}
75 + <li><a href="${document.getExternalURL('view')}" target="_blank">${docTitle}</a></li>
76 + {{/html}}
52 52   #end
53 53   #end
54 54   #end
55 55   #end
81 + #if($hasUpdates)
82 + {{html clean="false" wiki="false"}}
83 + </ul>
84 + {{/html}}
85 + #end
56 56  #end
87 +
88 +{{html clean="false" wiki="false"}}
89 +</div>
90 +{{/html}}
91 +
57 57  {{/velocity}}
93 +
58 58  )))
59 59  
96 +
97 +
98 +
99 +
100 +
60 60  (% class="col-xs-12 col-sm-6" %)
61 61  (((
62 62  === 相关链接 ===