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