<
From version < 53.3 >
edited by Vincent Massol
on 2010/11/29
To version < 54.1 >
edited by Vincent Massol
on 2011/10/06
>
Change comment: Rewrite news page using syntax 2.0 and new activity stream macro

Summary

Details

Page properties
Title
... ... @@ -1,0 +1,1 @@
1 +News
Syntax
... ... @@ -1,1 +1,1 @@
1 -XWiki 1.0
1 +XWiki 2.0
Content
... ... @@ -1,152 +4,14 @@
1 -$context.setCacheDuration(300)
2 -1 News
3 -
4 4  Find below all the recent news from the site blog and from the list of pages that have been changed recently.
5 5  
6 -<style>
7 -.warningmessage {
8 - display:none;
9 -}
10 -#newBlogPost {
11 - display:none;
12 -}
13 -</style>
14 -#set($wikinames = ["xwiki", "code", "enterprise", "manager", "watch", "platform", "dev", "xeclipse"])
15 -<div>
16 - <div id="webhomeblogdisplay" style="float:left; width: 50%;">
17 - <div style="padding-right:20px;">
18 - <h2 class="heading-1-1-1">Blog <a href="$xwiki.getURL("Blog.GlobalBlogRss", "view", "xpage=plain")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" alt="rss icon"/></a></h2>
19 - #includeForm("Blog.BlogSheet")
20 - </div>
21 - </div>
22 - <div id="webhomeNewsdisplay" style="float:left; width: 50%;">
23 - <div style="padding-left: 20px;">
24 - <h2 class="heading-1-1-1">Recent Pages Changed <a href="$xwiki.getURL("Main.WebRss", "view", "xpage=rdf")" style=""><img src="$xwiki.getSkinFile("icons/black-rss.png")" alt="rss icon"/></a></h2>
25 - #if(!$xwiki.hasMinorEdit() || $request.getParameter("showminor"))
26 - #set ($sql = "where 1=1 and doc.comment <> 'Created user' and doc.name not like 'WatchListJob%' order by doc.date desc")
27 - #else
28 - #set ($sql = ", XWikiRCSNodeInfo as ni where doc.id=ni.id.docId and ni.id.version2=1 and doc.comment <> 'Created user' and doc.name not like 'WatchListJob%' group by doc.web, doc.name order by max(ni.date) desc")
29 - #end
30 - #set($showdata = 1)
31 - #if(!$nb)
32 - #set($nb = 30)
33 - #end
34 - #set($formatDate = "yyyy MMMM dd, HH:mm")
35 - #includeMacros("Main.Macros")
36 - #getDocumentsModifs($list $sql $wikinames $nb)
37 - <ul>
38 - #foreach ($bentrydoc in $list)
39 - #set($troubi ="non")
40 - #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName))
41 - #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
42 - #set($comment = $cclass.newObject())
43 - #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0)
44 - #set($comments = $bentrydoc.getComments())
45 - #else
46 - #set($comments = $bentrydoc.getComments(false))
47 - #end
48 - #set($createur = $xwiki.getUserName($bentrydoc.author))
49 - <li>
50 - #if($comments.size()>0)
51 - #set($i = 0)
52 - #set($cobj = $comments.get($i))
53 - #set($comment = $bentrydoc.display("comment", "view", $cobj))
54 - #set($date = $cobj.getXWikiObject().get("date").value)
55 - #if($date)
56 - #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss"))
57 - #end
58 - #if($bentrydoc)
59 - #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") )
60 - #end
61 - #if($date1.equals($date2) )
62 - [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em>
63 - #set($troubi ="oui")
64 - #set($desc = $cobj.getXWikiObject().get("comment").value)
65 - #else
66 - [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName]
67 - #end
68 - #else
69 - #set($comment = "")
70 - [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName.replaceAll("@","%40")]
71 - #end
72 - $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")
73 - #if($troubi =="oui")
74 - #set($createur = $xwiki.getUserName($cobj.author))
75 - #end
76 - #if ($createur == "XWikiGuest")
77 - Guest
78 - #else
79 - $createur
80 - #end
81 - </li>
82 - #end
83 - #end
84 - </ul>
85 - #if($xwiki.hasMinorEdit())
86 - #if($request.getParameter("showminor"))
87 - <a href="$xwiki.getURL($tdoc.getFullName(), "view", "")">Hide minor edits</a>
88 - #else
89 - <a href="$xwiki.getURL($tdoc.getFullName(), "view", "showminor")">Show minor edits</a>
90 - #end
3 +{{container layoutStyle="columns"}}
4 +(((
5 += Blog =
6 +{{include document="Blog.BlogSheet"/}}
7 +)))
8 +(((
9 += Activity =
10 +{{activity /}}
11 +)))
12 +{{/container}}
91 91  
92 92  
93 - #end
94 - <h2 class="heading-1-1-1">Recent Users Added</h2>
95 - #set ($sql = "where 1=1 and doc.comment = 'Created user' order by doc.date desc")
96 - #set($showdata = 1)
97 - #set($nb = 10)
98 - #set($formatDate = "yyyy MMMM dd, HH:mm")
99 - #getDocumentsModifs($list $sql $wikinames $nb)
100 - <ul>
101 - #foreach ($bentrydoc in $list)
102 - #set($troubi ="non")
103 - #if ($xwiki.hasAccessLevel("view", $context.user, $bentrydoc.prefixedFullName))
104 - #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass())
105 - #set($comment = $cclass.newObject())
106 - #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0)
107 - #set($comments = $bentrydoc.getComments())
108 - #else
109 - #set($comments = $bentrydoc.getComments(false))
110 - #end
111 - #set($createur = $xwiki.getUserName($bentrydoc.author))
112 - <li>
113 - #if($comments.size()>0)
114 - #set($i = 0)
115 - #set($cobj = $comments.get($i))
116 - #set($comment = $bentrydoc.display("comment", "view", $cobj))
117 - #set($date = $cobj.getXWikiObject().get("date").value)
118 - #if($date)
119 - #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss"))
120 - #end
121 - #if($bentrydoc)
122 - #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") )
123 - #end
124 - #if($date1.equals($date2) )
125 - [$bentrydoc.name>$bentrydoc.prefixedFullName] <em>- 1 new comment</em>
126 - #set($troubi ="oui")
127 - #set($desc = $cobj.getXWikiObject().get("comment").value)
128 - #else
129 - [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName]
130 - #end
131 - #else
132 - #set($comment = "")
133 - [$bentrydoc.name in $bentrydoc.space>$bentrydoc.prefixedFullName.replaceAll("@","%40")]
134 - #end
135 - $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")
136 - #if($troubi =="oui")
137 - #set($createur = $xwiki.getUserName($cobj.author))
138 - #end
139 - #if ($createur == "XWikiGuest")
140 - Guest
141 - #else
142 - $createur
143 - #end
144 - </li>
145 - #end
146 - #end
147 - </ul>
148 - </div>
149 - </div>
150 - <div style="clear:both; margin-bottom: 40px;"><!-- --></div>
151 -</div>
152 -

Get Connected