Merge remote-tracking branch 'origin/new/bug_8623'
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-tags.tt
1 [% USE KohaDates %]
2
3 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Tags
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6 <style type="text/css">
7         fieldset { padding : .3em;margin:.3em 0;}
8         #tagcloud    {background-color: #F3F3F3; text-align: justify;padding:7px;}
9         .tag a       {text-decoration: none;}
10         .tag a:hover {text-decoration: underline;}
11         .tag         {display: block; padding-left: 1em;}
12         .tagcount    {display: none;}
13         .cloudweight {display: none;}
14         .tagweight {
15                 display: none;
16                 position: relative;
17                 bottom: 0.4em;
18                 color: red;
19                 font-size: 12px;
20         }
21 </style>
22 <script type="text/javascript">
23 //<![CDATA[
24                 $("#mytagst").tablesorter({[% IF ( dateformat == 'metric' ) %]
25     dateFormat: 'uk',[% END %]
26             widgets : ['zebra'],
27                         headers: { 3: { sorter: false }},
28             sortList: [[2,0]]
29         });
30         });
31 //]]>
32 </script>
33 </head>
34 [% IF ( loggedinusername ) %]<body id="opac-usertags">[% ELSE %]<body id="opac-tags">[% END %]
35 [% IF ( OpacNav||loggedinusername ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
36 <div id="bd">
37 [% INCLUDE 'masthead.inc' %]
38
39 <div id="yui-main">
40   <div class="yui-b"><div class="yui-g">
41         <div id="usertags" class="container">
42         [% IF ( ERRORS ) %]
43         [% FOREACH ERROR IN ERRORS %]
44                 <div class="dialog alert">There was a problem with this operation:
45                 [% IF ( ERROR.tagsdisabled ) %]Sorry, tags are not enabled on this system.
46                 [% ELSIF ( ERROR.badparam ) %]ERROR: illegal parameter [% ERROR.badparam %]
47                 [% ELSIF ( ERROR.login ) %]ERROR: You must log in to complete that action.
48                 [% ELSIF ( ERROR.failed_delete ) %]ERROR: You cannot delete the tag [% ERROR.failed_delete %].
49                                         <br />Note: you can only delete your own tags.
50                 [% ELSIF ( ERROR.scrubbed ) %]Note: your tag contained markup code that was removed. 
51                                         <br />The tag was added as &quot;[% ERROR.scrubbed %]&quot;.
52                 [% ELSIF ( ERROR.scrubbed_all_bad ) %]Note: your tag was entirely markup code.  It was NOT added.
53                                         <br />Please try again with plain text.
54                 [% ELSE %]Unrecognized error.
55                 [% END %]
56                 </div>
57         [% END %]
58         [% END %]
59         <h1>All Tags</h1>
60         
61                 <form method="get" action="opac-tags.pl">
62                 <fieldset>Show up to <input type="text" name="limit" style="text-align: right;" maxlength="4" size="4" value="[% limit or "100" %]" />
63                         tags[% IF ( opacuserlogin ) %] from other users[% END %].
64                         <input type="submit" value="OK" />
65             [% IF ( opacuserlogin ) %][% UNLESS ( loggedinusername ) %]
66             <a href="/cgi-bin/koha/opac-user.pl">Log in</a> to see your own saved tags.
67             [% END %][% END %]</fieldset>
68                 </form>
69         
70         [% IF ( TAGLOOP ) %]
71         <div id="tagcloud">
72         [% FOREACH TAGLOO IN TAGLOOP %]
73             <span class="tag tagweight[% TAGLOO.stratum %]" id="tag[% loop.count %]" style="display:inline;">
74                 <a href="/cgi-bin/koha/opac-search.pl?tag=[% TAGLOO.term |url %]&amp;q=[% TAGLOO.term |url %]">
75                 [% TAGLOO.term |html %]</a>
76                         <span class="tagweight">[% TAGLOO.weight_total %]</span>
77         </span>
78         [% END %]
79         </div>
80         [% END %]
81         [% IF ( add_op ) %]
82           [% IF ( added_count ) %]
83                 <div class="dialog message">[% added_count %] [% IF ( added_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully added.</div>
84           [% END %]
85           [% IF ( deleted_count ) %]
86                 <div class="dialog message">[% deleted_count %][% IF ( deleted_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully deleted.</div>
87           [% END %]
88         [% END %]
89
90         [% IF ( MY_TAGS ) %]
91                 <form method="post" action="opac-tags.pl">
92                 <h2>My Tags</h2>
93                 <table id="mytagst">
94         <thead><tr><th>Term</th><th>Title</th><th>Date added</th><th>Delete</th>
95                 </tr></thead>
96         <tbody>[% FOREACH MY_TAG IN MY_TAGS %]
97         <tr><td class="tagterm"><a href="/cgi-bin/koha/opac-search.pl?tag=[% MY_TAG.term |url %]&amp;q=[% MY_TAG.term |url %]">
98                                 [% MY_TAG.term |html %]</a>
99                         </td>
100                         <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% MY_TAG.biblionumber %]">
101                                 [% MY_TAG.bib_summary |html %]</a></td>
102                         <td>[% MY_TAG.date_created | $KohaDates %]</td>
103                         <td><input type="submit" name="del[% MY_TAG.tag_id %]" value="Delete" /></td>
104                 </tr>
105         [% END %]</tbody>
106                 </table>
107                 </form>
108         [% END %]
109
110 </div>
111 </div>
112 </div>
113 </div>
114 [% IF ( OpacNav||loggedinusername ) %]
115 <div class="yui-b"><div id="leftmenus" class="container">
116 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
117 </div></div>
118 [% END %]
119 </div>
120 [% INCLUDE 'opac-bottom.inc' %]
121