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