Code source wiki de Results
Version 1.1 par Administrator le 2009/01/30 14:32
Afficher les derniers auteurs
author | version | line-number | content |
---|---|---|---|
1 | #set($showdata = 0) | ||
2 | #set($formatDate = "yyyy MMMM dd, HH:mm") | ||
3 | |||
4 | ## WARNING: Do not add any empty line inside the table element. This will potentially break | ||
5 | ## the Javascript we're using for filtering/sorting columns. It might work in FF but will break | ||
6 | ## in other browsers like IE. This is because empty lines add <p class="paragraph"></p> elements | ||
7 | ## when rendered. | ||
8 | $xwiki.ssfx.use("js/xwiki/table/table.css") | ||
9 | $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true) | ||
10 | <table id="searchTableUnique" class="grid sortable filterable doOddEven"> | ||
11 | <tr class="sortHeader"> | ||
12 | <th>Page</th> | ||
13 | <th style="width:150px" class="selectFilter">Space</th> | ||
14 | #if($xwiki.isVirtualMode()) | ||
15 | <th style="width:150px" class="selectFilter">Wiki</th> | ||
16 | #end | ||
17 | <th style="width:150px">Date</th> | ||
18 | <th style="width:150px">Last Author</th> | ||
19 | #if($isScored) | ||
20 | <th style="width:150px" class="noFilter">Score</th> | ||
21 | #end | ||
22 | #if($xwiki.hasAdminRights()) | ||
23 | <th style="width:210px" class="unsortable noFilter">Actions</th> | ||
24 | #end | ||
25 | </tr> | ||
26 | #foreach ($item in $list) | ||
27 | #set($troubi = "non") | ||
28 | #if($item.class == "class com.xpn.xwiki.plugin.lucene.SearchResult") | ||
29 | #set($itemfullname = "${item.wiki}:${item.web}.${item.name}") | ||
30 | #else | ||
31 | #set($itemfullname = "${context.database}:${item}") | ||
32 | #end | ||
33 | #if ($xwiki.hasAccessLevel("view", $context.user, $itemfullname)) | ||
34 | #if ($item.class == "class java.lang.String") | ||
35 | #set($bentrydoc = $xwiki.getDocument($item)) | ||
36 | #elseif ($item.class == "class com.xpn.xwiki.plugin.lucene.SearchResult") | ||
37 | #set($bentrydoc = $item) | ||
38 | #end | ||
39 | #set($cclass = $xwiki.getDocument("XWiki.XWikiComments").getxWikiClass()) | ||
40 | #set($comment = $cclass.newObject()) | ||
41 | #if($xwiki.getWebPreferenceAsInt("commentsorder",1)==0) | ||
42 | #set($comments = $bentrydoc.getComments()) | ||
43 | #else | ||
44 | #set($comments = $bentrydoc.getComments(false)) | ||
45 | #end | ||
46 | #set($createur = $xwiki.getUserName($bentrydoc.author)) | ||
47 | #set($ptitle = $bentrydoc.getDisplayTitle()) | ||
48 | <tr><td style="text-align:left"> | ||
49 | ## LUCENE : entries are typed | ||
50 | #if ($bentrydoc.type) | ||
51 | #set ($ptitle = $xwiki.getDocument($itemfullname).getDisplayTitle()) | ||
52 | #if ($bentrydoc.type == "attachment") | ||
53 | <a href="${bentrydoc.url}" target="_blank"><img src="${xwiki.getSkinFile("icons/silk/attach.gif")}" ALT="download" /> ${bentrydoc.filename}</a>\\ | ||
54 | Attachment of | ||
55 | #end | ||
56 | #end | ||
57 | #if($comments && $comments.size()>0) | ||
58 | #set($i = 0) | ||
59 | #set($cobj = $comments.get($i)) | ||
60 | #set($comment = $bentrydoc.display("comment", "view", $cobj)) | ||
61 | #set($date = $cobj.getXWikiObject().get("date").value) | ||
62 | #if($date) | ||
63 | #set($date2 = $!xwiki.formatDate($date,"yyyy MM dd HH:mm:ss") ) | ||
64 | #end | ||
65 | #if($bentrydoc) | ||
66 | #set($date1 = $!xwiki.formatDate($!bentrydoc.date,"yyyy MM dd HH:mm:ss") ) | ||
67 | #end | ||
68 | #if($date1.equals($date2) ) | ||
69 | [$ptitle>$itemfullname] <em>- 1 new comment</em> | ||
70 | #set($troubi ="oui") | ||
71 | #set($desc = $cobj.getXWikiObject().get("comment").value) | ||
72 | #else | ||
73 | [$bentrydoc.name>$itemfullname] #if ($ptitle != $bentrydoc.name) <em>- $ptitle</em>#end | ||
74 | #end | ||
75 | #else | ||
76 | #set($comment = "") | ||
77 | [$bentrydoc.name>$itemfullname] #if ($ptitle != $bentrydoc.name) <em>- $ptitle</em>#end | ||
78 | #end | ||
79 | </td> | ||
80 | <td style="text-align:left"> | ||
81 | [$bentrydoc.space>${bentrydoc.wiki}:${bentrydoc.space}.WebHome] | ||
82 | </td> | ||
83 | #if($xwiki.isVirtualMode()) | ||
84 | <td style="text-align:left"> | ||
85 | [$bentrydoc.wiki>${bentrydoc.wiki}:Main.WebHome] | ||
86 | </td> | ||
87 | #end | ||
88 | <td style="text-align:left"> | ||
89 | $xwiki.formatDate($bentrydoc.date,"yyyy MMM dd") at $xwiki.formatDate($bentrydoc.date,"HH:mm")</td><td style="text-align:center"> | ||
90 | #if($troubi =="oui") | ||
91 | #set($createur = $xwiki.getUserName($cobj.author) ) | ||
92 | #end | ||
93 | #if ($createur == "XWikiGuest") | ||
94 | Guest | ||
95 | #else | ||
96 | $createur | ||
97 | #end | ||
98 | </td> | ||
99 | #if ($isScored) | ||
100 | <td style="text-align:left"> | ||
101 | #set($resval=$bentrydoc.score*100) | ||
102 | #set($starurl=$xwiki.getSkinFile("icons/silk/star.gif")) | ||
103 | #set($star = "<img src='$starurl' alt='$resval' />") | ||
104 | <span class="hidden">$bentrydoc.score</span> | ||
105 | #if($resval>10) $star #end | ||
106 | #if($resval>20) $star #end | ||
107 | #if($resval>40) $star #end | ||
108 | #if($resval>60) $star #end | ||
109 | #if($resval>90) $star #end | ||
110 | #set ($perc = $resval.toString()) | ||
111 | ${perc.substring(0, $perc.indexOf("."))}% | ||
112 | </td> | ||
113 | #set ($bentrydoc = $xwiki.getDocument($itemfullname)) | ||
114 | #end | ||
115 | #if($xwiki.hasAdminRights()) | ||
116 | <td> | ||
117 | <a href="$xwiki.getURL("XWiki.CopyDocument", "view", "sourcedoc=${util.encodeURI($itemfullname)}")">Copy</a> - <a href="$bentrydoc.getURL("delete")">Delete</a> - <a href="$bentrydoc.getURL("view", "xpage=rename&step=1")">Rename</a> - <a href="$bentrydoc.getURL("edit", "editor=rights")">Rights</a> | ||
118 | </td> | ||
119 | #end | ||
120 | </tr> | ||
121 | #end | ||
122 | #end | ||
123 | </table> |