Wiki源代码Home

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

显示最后作者
1 == {{displayIcon name="bell"/}} 通知公告 ==
2
3
4 (% style="font-size:16px" %)内部网站,不提供注册功能。
5
6
7 == ==
8
9 == ==
10
11 == ==
12
13 (% class="col-xs-12 col-sm-6" %)
14 (((
15 === 近期更新 ===
16
17 {{velocity}}
18 ## 检查当前用户是否是访客
19 #if($xcontext.user == 'XWiki.XWikiGuest')
20 ## 如果是访客用户,显示提示信息
21 {{info width=20%}}请登录查看。{{/info}}
22 #else
23 ## 定义一级页面列表
24 #set($topLevelPages = ["Knowledge", "AI", "Automatic"])
25
26 ## 遍历每个一级页面
27 #foreach($topPage in $topLevelPages)
28 ## 查询每个一级页面下最近更新的5个页面(按日期倒序排列)
29 #set($hqlQuery = "select doc.fullName from XWikiDocument doc where doc.fullName like :spacePattern and doc.name != 'WebPreferences' order by doc.date desc")
30 #set($query = $services.query.hql($hqlQuery))
31 #set($query = $query.bindValue("spacePattern", "${topPage}.%"))
32 #set($query = $query.setLimit(5)) ## 限制结果为5条
33 #set($recentDocs = $query.execute())
34
35 ## 如果找到近期更新的页面
36 #if($recentDocs.size() > 0)
37 ## 显示一级页面的标题
38 ==== $topPage ====
39
40 ## 遍历并展示找到的页面
41 #foreach($docFullName in $recentDocs)
42 #set($document = $xwiki.getDocument($docFullName))
43 * [[${document.getDisplayTitle()}>>${document.getExternalURL('view')}]] (最后更新: $datetool.format("yyyy-MM-dd", $document.getDate()))
44 #end
45 #end
46 #end
47 #end
48 {{/velocity}}
49
50
51 )))