<
From version < 7.1 >
edited by Vincent Massol
on 2012/10/16 17:09
To version < 8.1 >
edited by Marius Dumitru Florea
on 2013/03/22 14:56
>
Change comment: Import

Summary

Details

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

Get Connected