Bug 2780 - Capitalize strings consistently (OPAC pages)
[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         var fontsizes = new Array (12,14,16,18,20,22,24,26,28,30);
25         var fontcount = fontsizes.length;
26         var maxcloudweight = 1;
27         $(document).ready(function() {
28                 // $('#tagcloud').css('background-color','lightgrey');
29                 // $('#tagcloud .tag').css('border','1px solid black');
30                 $('#tagcloud .tag').each(function() {
31                         if (maxcloudweight < this.title) { maxcloudweight = this.title; }
32                         // have to run through the set of tags once to get the max: cannot be combined w/ 2nd pass
33                 });
34                 $('#tagcloud .tag').each(function(i) {
35                         var pos = this.id;
36                         var weight = this.title;        // "cloudweight"
37                         weight = (! weight) ? 1 : (weight > maxcloudweight) ? maxcloudweight : weight ;
38                         var index = Math.round(fontcount * weight/maxcloudweight) - 1;
39                         index  = (! index ) ? 0 : ( index > fontcount     ) ? fontcount      : index  ;
40                         var newsize = fontsizes[index];
41                         // alert(pos+ " (" +i+ ") weight = " +weight+ " of " +maxcloudweight+ ", fontsize[" +index+ " of " +fontcount+ "] = " +newsize);
42                         $('#' + pos).css({"font-size":(newsize + 'px'), display:"inline"});
43                 });
44                 $("#mytagst").tablesorter({[% IF ( dateformat == 'metric' ) %]
45     dateFormat: 'uk',[% END %]
46             widgets : ['zebra'],
47                         headers: { 3: { sorter: false }},
48             sortList: [[2,0]]
49         });
50         });
51 //]]>
52 </script>
53 </head>
54 [% IF ( loggedinusername ) %]<body id="opac-usertags">[% ELSE %]<body id="opac-tags">[% END %]
55 [% IF ( OpacNav||loggedinusername ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
56 <div id="bd">
57 [% INCLUDE 'masthead.inc' %]
58
59 <div id="yui-main">
60   <div class="yui-b"><div class="yui-g">
61         <div id="usertags" class="container">
62         [% IF ( ERRORS ) %]
63         [% FOREACH ERROR IN ERRORS %]
64                 <div class="dialog alert">There was a problem with this operation:
65                 [% IF ( ERROR.tagsdisabled ) %]Sorry, tags are not enabled on this system.
66                 [% ELSIF ( ERROR.badparam ) %]ERROR: illegal parameter [% ERROR.badparam %]
67                 [% ELSIF ( ERROR.login ) %]ERROR: You must log in to complete that action.
68                 [% ELSIF ( ERROR.failed_delete ) %]ERROR: You cannot delete the tag [% ERROR.failed_delete %].
69                                         <br />Note: you can only delete your own tags.
70                 [% ELSIF ( ERROR.scrubbed ) %]Note: your tag contained markup code that was removed. 
71                                         <br />The tag was added as &quot;[% ERROR.scrubbed %]&quot;.
72                 [% ELSIF ( ERROR.scrubbed_all_bad ) %]Note: your tag was entirely markup code.  It was NOT added.
73                                         <br />Please try again with plain text.
74                 [% ELSE %]Unrecognized error.
75                 [% END %]
76                 </div>
77         [% END %]
78         [% END %]
79         <h1>All Tags</h1>
80         
81                 <form method="get" action="opac-tags.pl">
82                 <fieldset>Show up to <input type="text" name="limit" style="text-align: right;" maxlength="4" size="4" value="[% limit or "100" %]" />
83                         tags[% IF ( opacuserlogin ) %] from other users[% END %].
84                         <input type="submit" value="OK" />
85             [% IF ( opacuserlogin ) %][% UNLESS ( loggedinusername ) %]
86             <a href="/cgi-bin/koha/opac-user.pl">Log in</a> to see your own saved tags.
87             [% END %][% END %]</fieldset>
88                 </form>
89         
90         [% IF ( TAGLOOP ) %]
91         <div id="tagcloud">
92         [% FOREACH TAGLOO IN TAGLOOP %]
93         <span class="tag" id="tag[% loop.count %]" title="[% TAGLOO.cloudweight %]">
94                 <a href="/cgi-bin/koha/opac-search.pl?tag=[% TAGLOO.term |url %]&amp;q=[% TAGLOO.term |url %]">
95                 [% TAGLOO.term |html %]</a>
96                         <span class="tagweight">[% TAGLOO.weight_total %]</span>
97         </span>
98         [% END %]
99         </div>
100         [% END %]
101         [% IF ( add_op ) %]
102           [% IF ( added_count ) %]
103                 <div class="dialog message">[% added_count %] [% IF ( added_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully added.</div>
104           [% END %]
105           [% IF ( deleted_count ) %]
106                 <div class="dialog message">[% deleted_count %][% IF ( deleted_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully deleted.</div>
107           [% END %]
108         [% END %]
109
110         [% IF ( MY_TAGS ) %]
111                 <form method="post" action="opac-tags.pl">
112                 <h2>My Tags</h2>
113                 <table id="mytagst">
114         <thead><tr><th>Term</th><th>Title</th><th>Date added</th><th>Delete</th>
115                 </tr></thead>
116         <tbody>[% FOREACH MY_TAG IN MY_TAGS %]
117                 <tr><td><a href="/cgi-bin/koha/opac-search.pl?tag=[% MY_TAG.term |url %]&amp;q=[% MY_TAG.term |url %]">
118                                 [% MY_TAG.term |html %]</a>
119                         </td>
120                         <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% MY_TAG.biblionumber %]">
121                                 [% MY_TAG.bib_summary |html %]</a></td>
122                         <td>[% MY_TAG.date_created | $KohaDates %]</td>
123                         <td><input type="submit" name="del[% MY_TAG.tag_id %]" value="Delete" /></td>
124                 </tr>
125         [% END %]</tbody>
126                 </table>
127                 </form>
128         [% END %]
129
130 </div>
131 </div>
132 </div>
133 </div>
134 [% IF ( OpacNav||loggedinusername ) %]
135 <div class="yui-b"><div id="leftmenus" class="container">
136 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
137 </div></div>
138 [% END %]
139 </div>
140 [% INCLUDE 'opac-bottom.inc' %]
141