Changes for page Tags

Last modified by Ecaterina Valica on 2018/10/30 12:14

From version 8.1
edited by Sergiu Dumitriu
on 2009/09/09 08:50
Change comment: There is no comment for this version
To version 9.1
edited by Administrator
on 2010/07/24 13:01
Change comment: Imported from XAR

Summary

Details

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