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