文档更改Home

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

从版本 212.1
Yang Sheng编辑
在2025-02-42,18:54上
修改评论: 该版本没有评论
到版本
Yang Sheng编辑
在2025-02-42,18:00上
修改评论: 该版本没有评论

摘要

细节

页面属性
内容
... ... @@ -13,12 +13,13 @@
13 13  (% class="col-xs-12 col-sm-6" %)
14 14  (((
15 15  === 近期更新 ===
16 -
17 17  {{velocity}}
18 18  ## 检查当前用户是否是访客
19 19  #if($xcontext.user == 'XWiki.XWikiGuest')
20 20   ## 如果是访客用户,显示提示信息
21 - {{info width=20%}}请登录查看。{{/info}}
20 + {{info}}
21 + 请登录查看。
22 + {{/info}}
22 22  #else
23 23   ## 定义一级页面列表
24 24   #set($topLevelPages = ["Knowledge", "AI", "Automatic"])
... ... @@ -40,8 +40,11 @@
40 40   ## 遍历并展示找到的页面
41 41   #foreach($docFullName in $recentDocs)
42 42   #set($document = $xwiki.getDocument($docFullName))
43 - * [[${document.getDisplayTitle()}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd", $document.getDate()))
44 + * [[${document.getDisplayTitle()}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd HH:mm", $document.getDate()))
44 44   #end
46 +
47 + ## 添加分隔符
48 + ----
45 45   #end
46 46   #end
47 47  #end
... ... @@ -49,53 +49,3 @@
49 49  
50 50  
51 51  )))
52 -
53 -{{velocity}}
54 -## 检查当前用户是否是访客
55 -#if($xcontext.user == 'XWiki.XWikiGuest')
56 - {{info}}请登录查看。{{/info}}
57 -#else
58 - #set($topLevelPages = ["Knowledge", "AI", "Automatic"])
59 -
60 - #foreach($topPage in $topLevelPages)
61 - #set($hqlQuery = "select doc.fullName from XWikiDocument doc where doc.fullName like :spacePattern and doc.name != 'WebPreferences' order by doc.date desc")
62 - #set($query = $services.query.hql($hqlQuery))
63 - #set($query = $query.bindValue("spacePattern", "${topPage}.%"))
64 - #set($query = $query.setLimit(5))
65 - #set($recentDocs = $query.execute())
66 -
67 - ----
68 - ==== $topPage ====
69 - #if($recentDocs.size() > 0)
70 - #foreach($docFullName in $recentDocs)
71 - #set($document = $xwiki.getDocument($docFullName))
72 -
73 - #set($title = $document.getTitle())
74 - #if($title == '' || $title == $null)
75 - #set($title = $document.getName())
76 - #end
77 -
78 - #set($pathParts = $docFullName.split("\\.")) ## 分割路径
79 - #set($displayPath = "")
80 - #if($pathParts.size() > 2)
81 - ## 提取二级页面名称
82 - #set($displayPath = $pathParts[1])
83 - ## 如果有更多级别,提取后续部分
84 - #set($additionalPath = $pathParts.subList(2, $pathParts.size() - 1).join("."))
85 - #if($additionalPath != "")
86 - #set($displayPath = "${displayPath}.${additionalPath}")
87 - #end
88 - #else
89 - #set($displayPath = $title)
90 - #end
91 -
92 - ## 确保正确显示路径和标题
93 - * [[${displayPath}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd HH:mm", $document.getDate()))
94 - #end
95 - #else
96 - **此分类暂无内容**
97 - #end
98 - ----
99 - #end
100 -#end
101 -{{/velocity}}