Bug 29349: (follow-up) Fix width of item level dropdowns
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tags / review.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( do_it ) %]Review[% ELSE %]Review tags[% END %] &rsaquo; Tags &rsaquo; Tools &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style>
9 .setlabel {width: 6em; font-family: courier; background-color:#E8E8E8;}
10 .rejected { color: #CC0033; }
11 .approved { color: #339900; }
12 .pending { color: #CCC; font-style: italic; }
13 tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
14 </style>
15 </head>
16
17 <body id="tags_review" class="tools">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'cat-search.inc' %]
20
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22     <ol>
23         <li>
24             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
28         </li>
29         <li>
30             <a href="#" aria-current="page">
31                 Tags
32             </a>
33         </li>
34     </ol>
35 </nav>
36
37 <div class="main container-fluid">
38     <div class="row">
39         <div class="col-sm-12">
40             <main>
41
42 <div class="row">
43 <div class="col-sm-8 col-sm-push-2">
44 <h1>Tags</h1>
45 <form method="post" action="/cgi-bin/koha/tags/review.pl">
46   <h4>Displaying 
47         [% IF ( filter_approved_all ) %]all[% END %]
48         [% IF ( filter_approved_ok ) %]approved[% END %]
49         [% IF ( filter_approved_pending ) %]pending[% END %]
50         [% IF ( filter_approved_rej ) %]rejected[% END %]
51         terms
52   </h4>
53
54   [% IF ( op_count ) %]
55   <div class="dialog message" id="main_status">
56                 [% IF ( op == 'approve' ) %]            Approved
57                 [% ELSIF ( op == 'reject' ) %]  Rejected
58                 [% ELSIF ( op == 'test' ) %]            Tested
59         [% ELSE %]Unknown operation ([% op | html %]) on
60                 [% END %]
61         [% op_count | html %] Term(s).
62   </div>
63   [% END %]
64   [% IF ( message_loop ) %]
65   <div class="dialog alert" id="main_error">
66     [% FOREACH message_loo IN message_loop %]
67         [% IF ( message_loo.date_from ) %]<strong>Error: </strong>"Date from" is not a legal value ("[% message_loo.date_from | html %]").
68         [% ELSIF ( message_loo.date_to ) %]<strong>Error: </strong>"Date to" is not a legal value ("[% message_loo.date_to | html %]").
69         [% ELSIF ( message_loo.failed_ok ) %]<strong>Error: </strong>Failed to approve term ([% message_loo.failed_ok | html %]).
70         [% ELSIF ( message_loo.failed_rej ) %]<strong>Error: </strong>Failed to reject term ([% message_loo.failed_rej | html %]).
71         [% ELSIF ( message_loo.approver ) %]No match for user ([% message_loo.approver | html %]). FILTER REQUIRES BORROWERNUMBER (not name).
72         [% ELSIF ( message_loo.approved_by ) %]<strong>Error: </strong>No match for borrowernumber ([% message_loo.approved_by | html %]).
73         [% ELSIF ( message_loo.op_zero ) %]<strong>Error: </strong> The root koha user in your KOHA_CONF file
74             (default: kohaadmin) is not a valid tag moderator. These actions are logged
75             by borrowernumber, so the moderator must exist in your borrowers table.
76             Please log in as a different authorized staff user to moderate tags.
77         [% ELSE %]Unrecognized error!
78         [% END %]
79             <br />
80         [% END %]
81   </div>
82   [% END %]
83   [% IF ( pagination_bar ) %]
84   <div class="pages" id="pagination_top">
85     [% pagination_bar | $raw %]
86   </div>
87   [% END %]
88   [% IF ( tagloop ) %]
89   <p class="check"></p>
90   <table id="tagst">
91     <thead>
92         <tr>
93             <th class="NoSort">&nbsp;</th>
94                 <th>Status</th>
95                 <th>Term</th>
96                 <th>Weight</th>
97             <th class="NoSort noExport">Actions</th>
98             [% UNLESS ( filter_approved_pending ) %]<th>Reviewer</th>[% END %]
99         <th>Date</th>
100         </tr>
101     </thead>
102     <tbody>
103     [% FOREACH tagloo IN tagloop %]
104         <tr>
105             <td>
106                 [% IF ( tagloo.approved == 0 ) %]
107                     <input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="pending" />
108                 [% ELSIF ( tagloo.approved == 1 ) %]
109                     <input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="approved" />
110                 [% ELSE %]
111                     <input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="rejected" />
112                 [% END %]
113             </td>
114             <td>
115                 [% IF ( tagloo.approved == -1 ) %]
116                     <label for="checkbox[% offset + loop.count | html %]">
117                         <span class="rejected status[% offset + loop.count | html %]">Rejected</span>
118                     </label>
119                 [% ELSIF ( tagloo.approved == 1 ) %]
120                     <label for="checkbox[% offset + loop.count | html %]">
121                         <span class="approved status[% offset + loop.count | html %]">Approved</span>
122                     </label>
123                 [% ELSE %]
124                     <label for="checkbox[% offset + loop.count | html %]">
125                         <span class="pending status[% offset + loop.count | html %]">Pending</span>
126                     </label>
127                 [% END %]
128             </td>
129             <td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term|uri %]">[% tagloo.term | html %]</a>
130             </td>
131             <td>[% tagloo.weight_total | html %]
132             </td>
133             [% IF ( tagloo.approved ) %]
134             <td class="actions"><span class="ajax_buttons" style="visibility:hidden">
135                 [% IF ( tagloo.approved == -1 ) %]
136                     <button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
137                     <button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Rejected" name="reject"><i class="fa fa-remove"></i> Rejected</button>
138                 [% ELSE %]
139                     <button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs"  disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Approved" name="approve"><i class="fa fa-check"></i> Approved</button>
140                     <button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
141                 [% END %]
142                 </span>
143             </td>
144             <td>[% IF ( tagloo.approved_by_name ) %]<a href="/cgi-bin/koha/tags/review.pl?approved_by=[% tagloo.approved_by | uri %]&amp;approved=all">[% tagloo.approved_by_name | html %]</a>[% ELSE %]&nbsp;[% END %]
145             </td>
146             [% ELSE %]
147             <td class="actions"><span class="ajax_buttons" style="visibility:hidden">
148                 <button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs"  type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
149                 <button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
150                 </span>
151             </td>
152             [% UNLESS ( filter_approved_pending ) %]<td>&nbsp;</td>[% END %]
153             [% END %]
154             <td data-order="[% tagloo.date_approved | html %]">
155                 [% tagloo.date_approved | $KohaDates %]
156             </td>
157         </tr>
158     [% END %]
159     </tbody>
160   </table>
161   [% END %]
162     [% IF ( tagloop ) %]<fieldset class="action">
163    <button type="submit" value="Approve" class="btn btn-default" id="approve_button" name="op-approve"><i class="fa fa-check"></i> Approve</button>
164    <button type="submit" value="Reject" class="btn btn-default"  id="reject_button" name="op-reject"><i class="fa fa-remove"></i> Reject</button>
165   </fieldset>[% END %]
166   </form>
167 </div>
168 <div class="col-sm-2 col-sm-push-2">
169     <aside>
170  <fieldset class="brief">
171   <h4>Terms summary</h4>
172   <ul>
173     <li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved</a>:
174         <span id="terms_summary_approved_count">[% approved_count | html %]</span>
175         </li>
176     <li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected</a>:
177         <span id="terms_summary_rejected_count">[% rejected_count | html %]</span>
178     </li>
179     <li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending</a>:
180     <span id="terms_summary_unapproved_count">[% unapproved_count | html %]</span>
181     </li>
182     <li><a href="/cgi-bin/koha/tags/review.pl?approved=all">Total</a>:
183         <span id="terms_summary_approved_total">[% approved_total | html %]</span>
184     </li>
185   </ul>
186   <span id="terms_summary_status">&nbsp;</span>
187   </fieldset>
188   <fieldset class="brief">
189    <h4>Check lists</h4>
190    <div class="description">Enter a word or phrase to check against approved/rejected lists: </div>
191    <form method="post" action="/cgi-bin/koha/tags/review.pl">
192    <input type="text" size="14" name="test" id="test" />
193    <fieldset class="action"><button type="submit" value="Test" class="approval_btn btn btn-default btn-sm" id="test_button" name="op-test"><i class="fa fa-check-square-o" aria-hidden="true"></i> Test</button></fieldset>
194    <div id="verdict">
195         [% IF ( test_term ) %]
196         [% IF ( verdict_ok ) %]
197                 &quot;[% test_term | html %]&quot; is permitted.
198         [% ELSIF ( verdict_rej ) %]
199                 &quot;[% test_term | html %]&quot; is prohibited.
200         [% ELSIF ( verdict_indeterminate ) %]
201                 &quot;[% test_term | html %]&quot; is neither permitted nor prohibited.
202         [% END %]
203         [% END %]
204    </div>
205    </form>
206   </fieldset>
207     </aside>
208 </div>
209 <div class="col-sm-2 col-sm-pull-10">
210     <aside>
211 <form method="post" action="/cgi-bin/koha/tags/review.pl">
212 <fieldset class="brief">
213   <h4>Filters</h4>
214         <ol>
215             <li><label for="tag">Term:</label> <input type="text" name="tag" id="tag" value="[% filter_tag | html %]" />
216             </li>
217             <li><label for="approved">Status:</label>
218             <select name="approved" id="approved">
219             [% IF ( filter_approved_all ) %]<option selected="selected" value="all">all</option>
220             [% ELSE %]<option value="all">all</option>[% END %]
221             [% IF ( filter_approved_ok ) %]<option selected="selected" value="1">approved</option>
222             [% ELSE %]<option value="1">approved</option>[% END %]
223             [% IF ( filter_approved_pending ) %]<option selected="selected" value="0">pending</option>
224             [% ELSE %]<option value="0">pending</option>[% END %]
225             [% IF ( filter_approved_rej ) %]<option selected="selected" value="-1">rejected</option>
226             [% ELSE %]<option value="-1">rejected</option>[% END %]
227                         </select>
228             </li>
229             <li><label for="approver">Reviewer:</label> <input type="text" name="approver" id="approver" value="[% filter_approver | html %]" />
230             </li>
231             <li>
232                         <label for="from">Date: from </label>
233             <input type="text" size="10" id="from" name="from" value="[% filter_date_approved_from | html %]" class="flatpickr" data-date_to="to" />
234                         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
235
236                         <label for="to">...to </label>
237             <input type="text" size="10" id="to" name="to" value="[% filter_date_approved_to | html %]" class="flatpickr" />
238                         <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
239             </li>
240   </ol>
241  <fieldset class="action"><button type="submit" class="btn btn-default btn-sm"><i class="fa fa-filter" aria-hidden="true"></i> Apply filter(s)</button></fieldset>
242 </fieldset>
243 </form>
244 </aside>
245 </div>
246 </div>
247 </main>
248 </div>
249 </div>
250
251 [% MACRO jsinclude BLOCK %]
252     [% INCLUDE 'datatables.inc' %]
253     [% INCLUDE 'calendar.inc' %]
254     [% Asset.js("js/pages/tags-review.js") | $raw %]
255 [% END %]
256
257 [% INCLUDE 'intranet-bottom.inc' %]