Bug 11709: revisions to Bootstrap OPAC lists interface
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-tags.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3
4 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Tags
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %]
7     <style type="text/css">
8         fieldset { padding : .3em;margin:.3em 0;}
9         #tagcloud    {background-color: #F3F3F3; text-align: justify;padding:7px;}
10         .tag a       {text-decoration: none;}
11         .tag a:hover {text-decoration: underline;}
12         .tag         {display: block; padding-left: 1em;}
13         .tagcount    {display: none;}
14         .cloudweight {display: none;}
15         .tagweight {
16             display: none;
17             position: relative;
18             bottom: 0.4em;
19             color: red;
20             font-size: 12px;
21         }
22     </style>
23 [% END %]
24 </head>
25 [% IF ( loggedinusername ) %]<body id="opac-usertags" class="scrollto">[% ELSE %]<body id="opac-tags" class="scrollto">[% END %]
26 [% INCLUDE 'masthead.inc' %]
27
28 <div class="main">
29     <ul class="breadcrumb">
30         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
31         <li><a href="#">Tags</a></li>
32     </ul>
33
34     <div class="container-fluid">
35         <div class="row-fluid">
36             [% IF ( OpacNav||loggedinusername ) %]
37                 <div class="span2">
38                     <div id="navigation">
39                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
40                     </div>
41                 </div>
42                 <div class="span10">
43             [% ELSE %]
44                 <div class="span12">
45             [% END %]
46
47                     <div id="usertags" class="maincontent">
48                         [% IF ( ERRORS ) %]
49                             [% FOREACH ERROR IN ERRORS %]
50                                 <div class="alert">
51                                     There was a problem with this operation:
52                                     [% IF ( ERROR.tagsdisabled ) %]
53                                         Sorry, tags are not enabled on this system.
54                                     [% ELSIF ( ERROR.badparam ) %]
55                                         ERROR: illegal parameter [% ERROR.badparam %]
56                                     [% ELSIF ( ERROR.login ) %]
57                                         ERROR: You must log in to complete that action.
58                                     [% ELSIF ( ERROR.failed_delete ) %]
59                                         ERROR: You cannot delete the tag [% ERROR.failed_delete %].
60                                         <br />Note: you can only delete your own tags.
61                                     [% ELSIF ( ERROR.scrubbed ) %]
62                                         Note: your tag contained markup code that was removed.
63                                         <br />The tag was added as &quot;[% ERROR.scrubbed %]&quot;.
64                                     [% ELSIF ( ERROR.scrubbed_all_bad ) %]
65                                         Note: your tag was entirely markup code.  It was NOT added.
66                                         <br />Please try again with plain text.
67                                     [% ELSE %]Unrecognized error.
68                                     [% END %]
69                                 </div>
70                             [% END %]
71                         [% END # /IF ERRORS %]
72                         <h1>All Tags</h1>
73
74                         <form method="get" action="opac-tags.pl" class="form-inline">
75                             <fieldset>
76                                 <label>
77                                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
78                                         Tags to show from other users
79                                     [% ELSE %]
80                                         Tags to show
81                                     [% END %]:
82                                 </label>
83                                 <div class="input-append">
84                                     <input type="text" name="limit" style="text-align: right;" maxlength="4" size="4" value="[% limit or "100" %]" />
85                                     <input type="submit" value="OK" class="btn" />
86                                 </div>
87                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
88                                     [% UNLESS ( loggedinusername ) %]
89                                         <p><a class="loginModal-trigger" href="/cgi-bin/koha/opac-user.pl">Log in to see your own saved tags.</a></p>
90                                     [% END %]
91                                 [% END %]
92                             </fieldset>
93                         </form>
94
95                         [% IF ( TAGLOOP ) %]
96                             <div id="tagcloud">
97                                 [% FOREACH TAGLOO IN TAGLOOP %]
98                                     <span class="tag tagweight[% TAGLOO.stratum %]" id="tag[% loop.count %]" style="display:inline;">
99                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% TAGLOO.term |url %]&amp;q=[% TAGLOO.term |url %]">[% TAGLOO.term |html %]</a>
100                                     <span class="tagweight">[% TAGLOO.weight_total %]</span>
101                                     </span>
102                                 [% END %]
103                             </div>
104                         [% END # / TAGLOOP%]
105                         [% IF ( add_op ) %]
106                             [% IF ( added_count ) %]
107                                 <div class="dialog message">[% added_count %] [% IF ( added_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully added.</div>
108                             [% END %]
109                             [% IF ( deleted_count ) %]
110                             <div class="dialog message">[% deleted_count %][% IF ( deleted_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully deleted.</div>
111                             [% END %]
112                         [% END # /add_op %]
113
114                         [% IF ( MY_TAGS ) %]
115                         <form method="post" action="opac-tags.pl">
116                             <h2>My Tags</h2>
117                             <table id="mytagst" class="table table-bordered table-striped">
118                                 <thead><tr><th>Term</th><th>Title</th><th>Date added</th><th>Delete</th></tr></thead>
119                                 <tbody>
120                                     [% FOREACH MY_TAG IN MY_TAGS %]
121                                         <tr>
122                                             <td class="tagterm">
123                                                 <span class="tdlabel">Tag:</span>
124                                                 <a href="/cgi-bin/koha/opac-search.pl?tag=[% MY_TAG.term |url %]&amp;q=[% MY_TAG.term |url %]">
125                                             [% MY_TAG.term |html %]</a></td>
126                                             <td>
127                                                 <span class="tdlabel">Title:</span>
128                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% MY_TAG.biblionumber %]">
129                                                 [% MY_TAG.bib_summary |html %]</a></td>
130                                             <td>
131                                                 <span title="[% MY_TAG.date_created %]">
132                                                     <span class="tdlabel">Date added:</span>
133                                                     [% MY_TAG.date_created | $KohaDates %]
134                                                 </span>
135                                             </td>
136                                             <td><input type="submit" name="del[% MY_TAG.tag_id %]" value="Delete" class="btn btn-danger btn-mini" /></td>
137                                         </tr>
138                                     [% END %]
139                                 </tbody>
140                             </table>
141                         </form>
142                         [% END # /MY_TAGS %]
143                     </div> <!-- / .usertags -->
144                 </div> <!-- / .span10/12 -->
145             </div> <!-- / .row-fluid -->
146         </div> <!-- / .container-fluid -->
147     </div> <!-- / .main -->
148
149 [% INCLUDE 'opac-bottom.inc' %]
150 [% BLOCK jsinclude %]
151 [% INCLUDE 'datatables.inc' %]
152 <script type="text/javascript">
153 //<![CDATA[
154     $(document).ready(function(){
155         $("#mytagst").dataTable($.extend(true, {}, dataTablesDefaults, {
156             "aaSorting": [[ 2, "asc" ]],
157             "aoColumnDefs": [
158               { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
159             ],
160             "aoColumns": [
161                 null,
162                 { "sType": "anti-the" },
163                 { "sType": "title-string" },
164                 null
165             ]
166         }));
167     });
168 //]]>
169 </script>
170 [% END %]