Changes for page Tags

Last modified by Vincent Massol on 2022/07/06 09:12

From version 3.1
edited by Vincent Massol
on 2013/06/27 15:06
Change comment: Import
To version 1.1
edited by Admin
on 2010/12/22 14:21
Change comment: Copied from massol:Main.Tags

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -$services.localization.render("xe.tag.tags")
1 +$msg.get("xe.tag.tags")
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.Admin
Syntax
... ... @@ -1,1 +1,1 @@
1 -XWiki 2.1
1 +XWiki 2.0
Content
... ... @@ -8,117 +8,123 @@
8 8  ## - Delete a tag.
9 9  ##
10 10  $xwiki.ssx.use('Main.Tags')##
11 +$xwiki.ssx.use('Main.Dashboard')##
11 11  ##
12 12  ## Set application variables (action and tag) from URL parameters.
13 13  ##
14 -#set ($do = "$!{request.get('do')}")
15 -#set ($tag = "$!{request.get('tag')}")
16 -#set ($urlEscapedTag = $escapetool.url($tag))
17 -#set ($htmlEscapedTag = $escapetool.xml($tag))
15 +#set($do = "$!{request.get('do')}")
16 +#set($tag = "$!{request.get('tag')}")
17 +#set($urlEscapedTag = $escapetool.url($tag))
18 +#set($htmlEscapedTag = $escapetool.xml($tag))
18 18  ##
19 19  ## Macro displayTagAppTitle. Display level1 title of this app.
20 20  ##
21 -#macro (displayTagAppTitle $urlEscapedTag $htmlEscapedTag $displayButtons)
22 - (% class="xapp" %)
23 - = (% class="highlight tag" %)${tag}##
24 - #if ($xwiki.hasAdminRights() && $displayButtons) ##
25 - [[$services.localization.render('xe.tag.rename.link')>>||queryString="do=prepareRename&tag=${urlEscapedTag}" class="button rename" rel="nofollow"]] [[$services.localization.render('xe.tag.delete.link')>>||queryString="do=prepareDelete&tag=${urlEscapedTag}" class="button delete" rel="nofollow"]]##
22 +#macro(displayTagAppTitle $urlEscapedTag $htmlEscapedTag $displayButtons)
23 + <h1 class="xapp">
24 + <span class="highlight tag">
25 + <a href="$doc.getURL('view', "do=viewTag&amp;tag=${urlEscapedTag}")">$htmlEscapedTag</a>
26 + #if($xwiki.hasAdminRights() && $displayButtons)
27 + <a href="$doc.getURL('view', "do=prepareRename&amp;tag=${urlEscapedTag}")" class="button rename" rel="nofollow">Rename</a>&nbsp;<a href="$doc.getURL('view', "do=prepareDelete&amp;tag=${urlEscapedTag}")" class="button delete" rel="nofollow">Delete</a>
26 26   #end
27 - (%%) =
29 + </span>
30 + </h1>
28 28  #end
29 29  ##
30 30  ## Switch between all possible actions:
31 31  ## viewTag, prepareRename, rename, prepareDelete, delete, default (Tag cloud)
32 32  ##
33 -#if ($do == 'viewTag')
36 +{{html wiki=true}}
37 +#if($do == 'viewTag')
34 34   ##
35 35   ## View tag
36 36   ##
37 37   #displayTagAppTitle($urlEscapedTag $htmlEscapedTag true)
38 - #if ("$!{request.get('renamedTag')}" != '')
39 - {{info}}$services.localization.render('xe.tag.rename.success', ["//${request.get('renamedTag')}//"]){{/info}}
40 -
42 + #if("$!{request.get('renamedTag')}" != '')
43 + #set($htmlEscapedRenamedTag = $escapetool.xml($request.get('renamedTag')))
44 + #info($msg.get('xe.tag.rename.success', [$htmlEscapedRenamedTag]))
41 41   #end
42 - #set ($list = $xwiki.tag.getDocumentsWithTag($tag))
43 - {{container layoutStyle="columns"}}
44 - (((
45 - (% class="xapp" %)
46 - === $services.localization.render('xe.tag.alldocs', ["//${tag}//"]) ===
47 -
48 - {{html}}#displayDocumentList($list true $blacklistedSpaces){{/html}}
49 - )))
50 - (((
51 - (% class="xapp" %)
52 - === $services.localization.render('xe.tag.activity', ["//${tag}//"]) ===
53 -
54 - {{activity tags="$tag" /}}
55 - )))
56 - {{/container}}
57 -#elseif ($do == 'prepareRename')
46 + #set($list = $xwiki.tag.getDocumentsWithTag($tag))
47 + <div>
48 + <div id="dashboardleft">
49 + <div id="dashboardleftcontent">
50 + <h3 class="xapp"><span>$msg.get('xe.tag.alldocs', [$htmlEscapedTag])</span></h3>
51 + #displayDocumentList($list true $blacklistedSpaces)
52 + </div>
53 + </div>
54 + <div id="dashboardright">
55 + <div id="dashboardrightcontent">
56 + <h3 class="xapp"><span>$msg.get("xe.tag.activity", [$htmlEscapedTag])</span></h3>
57 +
58 + {{activity tags="$htmlEscapedTag" /}}
59 +
60 + </div>
61 + </div>
62 + <div style="clear:both; margin-bottom: 40px;"></div>
63 +</div>
64 +#elseif($do == 'prepareRename')
58 58   ##
59 59   ## Prepare rename tag
60 60   ##
61 61   #displayTagAppTitle($urlEscapedTag $htmlEscapedTag false)
62 -{{html}}
63 63   <form id="renameForm" action="$doc.getURL()" method="post">
64 64   <div>
65 65   <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" />
66 66   <input name="do" type="hidden" value="renameTag" />
67 67   <input name="tag" type="hidden" value="$htmlEscapedTag" />
68 - $services.localization.render('xe.tag.rename.renameto', [$htmlEscapedTag]) <input type="text" name="renameTo" /> <span class="buttonwrapper"><input type="submit" value="$services.localization.render('xe.tag.rename')" class="button"/></span><span class="buttonwrapper"><a href="$doc.getURL('view', "do=viewTag&tag=${urlEscapedTag}")" class="secondary button">Cancel</a></span>
74 + $msg.get('xe.tag.rename.renameto', [$htmlEscapedTag]) <input type="text" name="renameTo" /> <span class="buttonwrapper"><input type="submit" value="$msg.get('xe.tag.rename')" class="button"/></span>
69 69   </div>
70 70   </form>
71 -{{/html}}
72 -#elseif ($do == 'renameTag')
77 +#elseif($do == 'renameTag')
73 73   ##
74 74   ## Rename tag
75 75   ##
76 - #set ($renameTo = "$!{request.get('renameTo')}")
77 - #set ($success = false)
81 + #set($renameTo = "$!{request.get('renameTo')}")
82 + #set($success = false)
78 78   #if ($renameTo != '')
79 - #set ($success = $xwiki.tag.renameTag($tag, $renameTo))
84 + #set($success = $xwiki.tag.renameTag($tag, $renameTo))
80 80   #end
81 81   #if ($success == true || $success == 'OK')
82 - #set ($urlEscapedRenameTo = $escapetool.url($renameTo))
87 + #set($urlEscapedRenameTo = $escapetool.url($renameTo))
83 83   $response.sendRedirect($doc.getURL('view', "do=viewTag&tag=${urlEscapedRenameTo}&renamedTag=${urlEscapedTag}"))
84 84   #else
85 - {{error}}$services.localization.render('xe.tag.rename.failure', ["//${tag}//", "//${renameTo}//"]){{/error}}
90 + #set($htmlEscapedRenameTo = $escapetool.xml($renameTo))
91 + #error($msg.get('xe.tag.rename.failure', [$htmlEscapedTag, $htmlEscapedRenameTo]))
86 86   #end
87 -#elseif ($do == 'prepareDelete')
93 +#elseif($do == 'prepareDelete')
88 88   ##
89 89   ## Prepare delete tag
90 90   ##
91 91   #displayTagAppTitle($urlEscapedTag $htmlEscapedTag false)
92 -{{html}}
93 93   <form id="deleteForm" action="$doc.getURL()" method="post">
94 94   <div>
95 95   <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" />
96 96   <input name="do" type="hidden" value="deleteTag" />
97 97   <input name="tag" type="hidden" value="$htmlEscapedTag" />
98 - <span class="buttonwrapper"><input type="submit" value="$services.localization.render('xe.tag.delete', [$htmlEscapedTag])" class="button"/></span><span class="buttonwrapper"><a href="$doc.getURL('view', "do=viewTag&tag=${urlEscapedTag}")" class="secondary button">Cancel</a></span>
103 + <span class="buttonwrapper"><input type="submit" value="$msg.get('xe.tag.delete', [$htmlEscapedTag])" class="button/></span>
99 99   </div>
100 100   </form>
101 -{{/html}}
102 -#elseif ($do == 'deleteTag')
106 +#elseif($do == 'deleteTag')
103 103   ##
104 104   ## Delete tag
105 105   ##
106 - #set ($success = $xwiki.tag.deleteTag($tag))
110 + #set($success = $xwiki.tag.deleteTag($tag))
107 107   #if ($success == true || $success == 'OK')
108 108   $response.sendRedirect($doc.getURL('view', "deletedTag=${urlEscapedTag}"))
109 109   #else
110 - {{error}}$services.localization.render('xe.tag.delete.failure', ["//${tag}//"]){{/error}}
114 + #error($msg.get('xe.tag.delete.failure', [$htmlEscapedTag]))
111 111   #end
112 112  #else
113 113   ##
114 114   ## View all tags (Tag Cloud)
115 115   ##
116 - #set ($title = 'All Tags')
117 - #if ("$!{request.get('deletedTag')}" != '')
118 - {{info}}$services.localization.render('xe.tag.delete.success', ["//${request.get('deletedTag')}//"]){{/info}}
119 -
120 + #set($tags = $xwiki.tag.getTags(true))
121 + #set($title = 'All Tags')
122 + #if("$!{request.get('deletedTag')}" != '')
123 + #set($htmlEscapedTag = $escapetool.xml($request.get('deletedTag')))
124 + #info($msg.get('xe.tag.delete.success', [$htmlEscapedTag]))
120 120   #end
121 - {{tagcloud/}}
126 + #set($docextras = [])
127 + #includeInContext("XWiki.TagCloud")
122 122  #end
123 -#set ($displayDocExtra = false)
129 +{{/html}}
124 124  {{/velocity}}
XWiki.StyleSheetExtension[0]
Caching policy
... ... @@ -1,1 +1,1 @@
1 -long
1 +default
Code
... ... @@ -1,47 +1,67 @@
1 1  h1.xapp {
2 - border-bottom: 0px none;
3 - margin: 0;
2 + margin-bottom: 1em;
4 4  }
5 5  
6 -h1.xapp + form {
7 - margin: 1.5em 0 1em;
5 +h1.xapp span {
6 + border:0;
7 + margin-top:0;
8 + display: inline;
8 8  }
9 9  
10 -h1.xapp * {
11 - vertical-align: middle;
12 -}
13 -
14 -h1.xapp .highlight {
15 - background: url("$xwiki.getSkinFile('icons/silk/tag_blue.png')") no-repeat 5px 50% #FFC;
16 - border: solid 1px #DDD;
17 - border-radius: 10px;
11 +h1.xapp span.highlight {
18 18   display: inline-block;
19 - font-weight: bold;
20 - padding: 2px 8px 2px 25px;
13 + background-color: lemonChiffon;
14 + border: solid 1px Gainsboro;
15 + font-weight:bold;
21 21   white-space: nowrap;
17 + padding: 2px 10px 0 25px;
18 + -moz-border-radius: 10px;
19 + -webkit-border-radius: 10px;
20 + border-radius: 10px;
21 + margin-bottom: -8px;
22 22  }
23 23  
24 -h1.xapp .button {
25 - background: no-repeat 3px 50% #FFD;
26 - border: solid 1px #DDD;
27 - border-radius: 7px;
28 - display : inline-block;
29 - font-size: 50%;
24 +h1.xapp span.tag {
25 + background: lemonChiffon url($xwiki.getSkinFile("icons/silk/tag_blue.gif")) no-repeat 5px 50%;
26 +}
27 +
28 +h1.xapp span.highlight a.button {
29 + font-size: 12px;
30 30   font-weight: normal;
31 - line-height: 1.5em;
32 - padding: 2px 5px 2px 20px;
31 + line-height: 18px;
32 + display : inline-block;
33 + background-color: lightYellow;
34 + border: solid 1px Gainsboro;
35 + -moz-border-radius: 10px;
36 + -webkit-border-radius: 10px;
37 + border-radius: 10px;
38 + padding: 2px 5px 0 5px;
39 + vertical-align: middle;
33 33  }
34 34  
35 -h1.xapp .delete {
36 - background-image: url("$xwiki.getSkinFile('icons/silk/cross.png')");
42 +h1.xapp span.highlight a.delete {
43 + background: lightYellow url($xwiki.getSkinFile("icons/silk/cross.gif")) no-repeat 3px 50%;
44 + padding: 2px 5px 0px 20px;
37 37  }
38 38  
39 -h1.xapp .rename {
40 - background-image: url("$xwiki.getSkinFile('icons/silk/textfield_rename.png')");
47 +h1.xapp span.highlight a.rename {
48 + background: lightYellow url($xwiki.getSkinFile("icons/silk/textfield_rename.gif")) no-repeat 3px 50%;
49 + padding: 2px 5px 0px 20px;
41 41  }
42 42  
43 -h1.xapp .button:hover {
44 - background-color: #EEF;
45 - text-decoration: none;
52 +h1.xapp span.highlight a:hover.button {
53 + background-color: Lavender ;
54 + border: solid 1px Gainsboro;
46 46  }
47 47  
57 +h1.xapp span.highlight span:hover.button a,
58 +h1.xapp span.highlight span:hover.button a:link,
59 +h1.xapp span.highlight span:hover.button a:active,
60 +h1.xapp span.highlight span:hover.button a:visited {
61 + text-decoration: none;
62 +}
63 +
64 +h3.xapp span {
65 + margin:0;
66 +}
67 +