Bug 23094: Use Bootstrap-style pagination on staged MARC records page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / manage-marc-import.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records
6     [% IF ( import_batch_id ) %]
7         &rsaquo; Batch [% import_batch_id | html %]
8     [% END %]
9 </title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 <style>
12     #jobpanel,#jobstatus,#jobfailed { display : none; }
13     span.change-status { font-style:italic; color:#666; display:none; }
14 </style>
15 </head>
16
17 <body id="tools_manage-marc-import" 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>
22         [% IF ( import_batch_id ) %]
23             &rsaquo;
24             <a href="[% script_name | url %]">Manage staged MARC records</a>
25             &rsaquo; Batch [% import_batch_id | html %]
26         [% ELSE %]
27             &rsaquo; Manage staged MARC records
28         [% END %]
29     </div>
30
31     <div class="main container-fluid">
32         <div class="row">
33             <div class="col-sm-10 col-sm-push-2">
34                 <main>
35                     <h1>Manage staged MARC records
36                         [% IF ( import_batch_id ) %]
37                             &rsaquo; Batch [% import_batch_id | html %]
38                         [% END %]
39                     </h1>
40
41                     [% IF ( label_batch_msg ) %]
42                         [% IF ( alert ) %]
43                             <div class="alert">
44                         [% ELSE %]
45                             <div class="dialog message">
46                         [% END %]
47                             <b><p>[% label_batch_msg | html %]</p></b>
48                         </div>
49                     [% END %]
50
51                     [% IF ( did_clean ) %]
52                         <div class="dialog message">Cleaned import batch #[% import_batch_id | html %]</div>
53                     [% END %]
54
55                     [% IF ( did_delete ) %]
56                         <div class="dialog message">Import batch deleted successfully</div>
57                     [% END %]
58
59                     [% UNLESS ( batch_list ) %]
60                         [% UNLESS ( batch_info ) %]
61                             <div class="dialog message">
62                                 <p>No records have been staged.</p>
63                                 <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
64                             </div>
65                         [% END %]
66                     [% END %]
67
68                     [% IF ( batch_info ) %]
69                         [% IF ( can_commit ) %]
70                             <form action="[% script_name | html %]" method="post">
71                                 <input type="hidden" name="op" value="redo-matching" />
72                                 <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
73                                 <input type="hidden" name="current_matcher_id" value="[% current_matcher_id | html %]" />
74                         [% END %]
75
76                         [% IF ( rematch_attempted ) %]
77                             [% IF ( rematch_failed ) %]
78                                 <div class="dialog alert">Failed to apply different matching rule</div>
79                             [% ELSE %]
80                                 <div class="dialog message">Applied different matching rule. Number of records matched now
81                                     [% num_with_matches | html %]
82                                 </div>
83                             [% END %]
84                         [% END %]
85
86                         [% IF ( changed_overlay_action ) %]
87                             <div class="dialog message">Changed action if matching record found</div>
88                         [% END %]
89
90                         [% IF ( changed_nomatch_action ) %]
91                             <div class="dialog message">Changed action if no match found</div>
92                         [% END %]
93
94                         [% IF ( changed_item_action ) %]
95                             <div class="dialog message">Changed item processing option</div>
96                         [% END %]
97
98                         <fieldset class="rows" id="staged-record-matching-rules">
99                             <ol>
100                                 <li><span class="label">File name:</span> [% file_name | html %]</li>
101                                 <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments | html %][% ELSE %](none)[% END %]</li>
102                                 <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
103                                 <li><span class="label">Staged:</span> [% upload_timestamp | html %]</li>
104                                 <li><span class="label">Status:</span>
105                                     [% IF ( import_status == 'cleaned' ) %]
106                                         Cleaned
107                                     [% ELSIF ( import_status == 'imported' ) %]
108                                         Imported
109                                     [% ELSIF ( import_status == 'importing' ) %]
110                                         Importing
111                                     [% ELSIF ( import_status == 'reverted' ) %]
112                                         Reverted
113                                     [% ELSIF ( import_status == 'reverting' ) %]
114                                         Reverting
115                                     [% ELSIF ( import_status == 'staged' ) %]
116                                         Staged
117                                     [% ELSE %]
118                                         [% import_status | html %]
119                                     [% END %]
120                                 </li>
121                                 <li>
122                                     [% IF ( can_commit ) %]
123                                         <label for="new_matcher_id">Matching rule applied:</label>
124                                         <select name="new_matcher_id" id="new_matcher_id">
125                                             <option value="">Do not look for matching records</option>
126                                             [% FOREACH available_matcher IN available_matchers %]
127                                                 [% IF ( available_matcher.selected ) %]
128                                                     <option value="[% available_matcher.matcher_id | html %]" selected="selected">
129                                                         [% available_matcher.code | html %] ([% available_matcher.description | html %])
130                                                     </option>
131                                                 [% ELSE %]
132                                                     <option value="[% available_matcher.matcher_id | html %]">
133                                                         [% available_matcher.code | html %] ([% available_matcher.description | html %])
134                                                     </option>
135                                                 [% END %]
136                                             [% END %]
137                                         </select>
138                                         <span class="change-status">Changed. <a href="#" class="reset" id="reset_new_matcher_id">Reset</a></span>
139                                     [% ELSE %]
140                                         <span class="label">Matching rule applied</span>
141                                         [% IF ( current_matcher_id ) %]
142                                             [% current_matcher_code | html %] ([% current_matcher_description | html %])
143                                         [% ELSE %]
144                                             No matching rule in effect
145                                         [% END %]
146                                     [% END %]
147                                 </li>
148                                 <li>
149                                     [% IF ( can_commit ) %]
150                                         <label for="overlay_action">Action if matching record found:</label>
151                                         [% INCLUDE 'tools-overlay-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_overlay_action">Reset</a></span>
152                                     [% ELSE %]
153                                         <span class="label">Action if matching record found:</span>
154                                         [% IF ( overlay_action == 'replace' ) %]
155                                             Replace existing record with incoming record
156                                         [% ELSIF ( overlay_action == 'create_new' ) %]
157                                             Add incoming record
158                                         [% ELSIF ( overlay_action == 'ignore' ) %]
159                                             Ignore incoming record (its items may still be processed)
160                                         [% ELSE %]
161                                             [% overlay_action | html %]
162                                         [% END %]
163                                     [% END %]
164                                 </li>
165                                 <li>
166                                     [% IF ( can_commit ) %]
167                                         <label for="nomatch_action">Action if no match found:</label>
168                                         [% INCLUDE 'tools-nomatch-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_nomatch_action">Reset</a></span>
169                                     [% ELSE %]
170                                         <span class="label">Action if no match found:</span>
171                                         [% IF ( nomatch_action == 'create_new' ) %]
172                                             Add incoming record
173                                         [% ELSIF ( nomatch_action == 'ignore' ) %]
174                                             Ignore incoming record (its items may still be processed)
175                                         [% ELSE %]
176                                             [% nomatch_action | html %]
177                                         [% END %]
178                                     [% END %]
179                                 </li>
180                                 [% IF ( record_type == 'biblio' ) %]
181                                     <li>
182                                         [% IF ( can_commit ) %]
183                                             <label for="item_action">Item processing:</label>
184                                             [% INCLUDE 'tools-item-action.inc' %] <span class="change-status">Changed. <a href="#" class="reset" id="reset_item_action">Reset</a></span>
185                                         [% ELSE %]
186                                             <span class="label">Item processing:</span>
187                                             [% IF ( item_action == 'always_add' ) %]
188                                                 Always add items
189                                             [% ELSIF ( item_action == 'add_only_for_matches' ) %]
190                                                 Add items only if matching bib was found
191                                             [% ELSIF ( item_action == 'add_only_for_new' ) %]
192                                                 Add items only if no matching bib was found
193                                             [% ELSIF ( item_action == 'ignore' ) %]
194                                                 Ignore items
195                                             [% ELSE %]
196                                                 [% item_action | html %]
197                                             [% END %]
198                                         [% END %]
199                                     </li>
200                                 [% END %]
201                             </ol>
202                             [% IF ( can_commit ) %]
203                                     <fieldset class="action"><input type="submit" value="Apply different matching rules" class="button" /></fieldset>
204                                 </form>
205                             [% END %]
206                         </fieldset> <!-- /#staged-record-matching-rules -->
207
208                         <div>
209                             [% IF ( can_commit ) %]
210                                 <form action="[% script_name | html %]" method="post" id="import_batch_form">
211                                     <input type="hidden" name="op" value="commit-batch" />
212                                     <input type="hidden" name="runinbackground" value="" />
213                                     <input type="hidden" name="completedJobID" value="" />
214                                     <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
215                                     <fieldset class="action">
216                                         [% IF ( record_type != 'auth' ) %]
217                                             Add new bibliographic records into this framework:
218                                             <select name="framework" id="frameworks">
219                                                 <option value="">Default</option>
220                                                 [% FOREACH framework IN frameworks %]
221                                                     <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
222                                                 [% END %]
223                                             </select>
224                                         [% END %]
225                                         <br />
226                                         <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" />
227                                     </fieldset>
228                                 </form> <!-- /#import_batch_form -->
229                                 <div id="jobpanel">
230                                     <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
231                                     <div id="jobfailed"></div>
232                                 </div>
233                             [% END # /IF can_commit %]
234                             [% IF ( can_revert ) %]
235                                 <form action="[% script_name | html %]" method="post" id="revert_batch_form">
236                                     <input type="hidden" name="op" value="revert-batch" />
237                                     <input type="hidden" name="runinbackground" value="" />
238                                     <input type="hidden" name="completedJobID" value="" />
239                                     <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
240                                     <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" /></fieldset>
241                                 </form>
242                                 <div id="jobpanel">
243                                     <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
244                                     <div id="jobfailed"></div>
245                                 </div>
246                             [% END # /IF can_revert %]
247                         </div>
248
249                         [% IF ( did_commit ) %]
250                             <div class="dialog message">Completed import of records</div>
251                             <table>
252                                 <tr>
253                                     <td>Number of records added</td>
254                                     <td>[% num_added | html %]</td>
255                                 </tr>
256                                 <tr>
257                                     <td>Number of records updated</td>
258                                     <td>[% num_updated | html %]</td>
259                                 </tr>
260                                 <tr>
261                                     <td>Number of records ignored</td>
262                                     <td>[% num_ignored | html %]</td>
263                                 </tr>
264                                 [% IF ( record_type == 'biblio' ) %]
265                                     <tr>
266                                         <td>Number of items added</td>
267                                         <td>[% num_items_added | html %]</td>
268                                     </tr>
269                                     <tr>
270                                         <td>Number of items replaced</td>
271                                         <td>[% num_items_replaced | html %]</td>
272                                     </tr>
273                                     <tr>
274                                         <td>Number of items ignored because of duplicate barcode</td>
275                                         <td>[% num_items_errored | html %]</td>
276                                     </tr>
277                                 [% END %]
278                             </table>
279                         [% END #/ IF did_commit %]
280
281                         [% IF ( did_revert ) %]
282                             <div class="dialog message">Success: Import reversed</div>
283                             <table>
284                                 <tr>
285                                     <td>Number of records deleted</td>
286                                     <td>[% num_deleted | html %]</td>
287                                 </tr>
288                                 [% IF ( record_type == 'biblio' ) %]
289                                     <tr>
290                                         <td>Number of items deleted</td>
291                                         <td>[% num_items_deleted | html %]</td>
292                                     </tr>
293                                     <tr>
294                                         <td>Number of records not deleted due to items on loan</td>
295                                         <td>[% num_errors | html %]</td>
296                                     </tr>
297                                 [% END %]
298                                 <tr>
299                                     <td>Number of records changed back</td>
300                                     <td>[% num_reverted | html %]</td>
301                                 </tr>
302                                 <tr>
303                                     <td>Number of records ignored</td>
304                                     <td>[% num_ignored | html %]</td>
305                                 </tr>
306                             </table>
307                         [% END  # /IF did_revert%]
308
309                     [% END # /IF batch_info %]
310
311                     <br style="clear:both;" />
312
313                     [% IF ( batch_list ) %]
314                         [% IF ( pages ) %]
315                             [% PROCESS pagination %]
316                         [% END %]
317
318                         <table>
319                             <tr>
320                                 <th>#</th>
321                                 <th>File name</th>
322                                 <th>Comments</th>
323                                 <th>Type</th>
324                                 <th>Status</th>
325                                 <th>Staged</th>
326                                 <th># Records</th>
327                                 <th># Items</th>
328                                 <th>Action</th>
329                             </tr>
330                             [% FOREACH batch_lis IN batch_list %]
331                                 <tr>
332                                     <td>[% batch_lis.import_batch_id | html %]</td>
333                                     <td><a href="[% batch_lis.script_name | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]">[% batch_lis.file_name | html %]</a></td>
334                                     <td>[% batch_lis.comments | html %]</td>
335                                     <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
336                                     <td>
337                                         [% IF ( batch_lis.import_status == 'cleaned' ) %]
338                                             Cleaned
339                                         [% ELSIF ( batch_lis.import_status == 'imported' ) %]
340                                             Imported
341                                         [% ELSIF ( batch_lis.import_status == 'importing' ) %]
342                                             Importing
343                                         [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
344                                             Reverted
345                                         [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
346                                             Reverting
347                                         [% ELSIF ( batch_lis.import_status == 'staged' ) %]
348                                             Staged
349                                         [% ELSE %]
350                                             [% batch_lis.import_status | html %]
351                                         [% END %]
352                                     </td>
353                                     <td>[% batch_lis.upload_timestamp | html %]</td>
354                                     <td>[% batch_lis.num_records | html %]</td>
355                                     <td>[% batch_lis.num_items | html %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]&amp;op=create_labels">(Create label batch)</a>[% END %]</td>
356                                     <td class="actions">
357                                         [% IF ( batch_lis.can_clean ) %]
358                                             <form method="post" action="[% batch_lis.script_name | html %]" name="clean_batch_[% batch_lis.import_batch_id | html %]" id="clean_batch_[% batch_lis.import_batch_id | html %]" class="batch_form batch_clean">
359                                                 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id | html %]" />
360                                                 <input type="hidden" name="op" value="clean-batch" />
361                                                 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-eraser"></i> Clean</button>
362                                             </form>
363                                         [% ELSIF ( batch_lis.import_status == 'cleaned' ) %]
364                                             <form method="post" action="/cgi-bin/koha/tools/manage-marc-import.pl" name="delete_batch_[% batch_lis.import_batch_id | html %]" id="delete_batch_[% batch_lis.import_batch_id | html %]" class="batch_form batch_delete">
365                                                 <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id | html %]" />
366                                                 <input type="hidden" name="op" value="delete-batch" />
367                                                 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>
368                                             </form>
369                                         [% END %]
370                                     </td>
371                                 </tr>
372                             [% END # /FOREACH batch_lis %]
373                         </table>
374
375                         [% IF ( pages ) %]
376                             [% PROCESS pagination %]
377                         [% END %]
378                     [% END # /IF batch_lis %]
379
380                     [% IF import_batch_id %]
381                         <table id="records-table">
382                             <thead>
383                                 <tr>
384                                     <th>#</th>
385                                     <th>Citation</th>
386                                     <th>Status</th>
387                                     <th>Match type</th>
388                                     <th>Match details</th>
389                                     <th><abbr title="Differences between the original bibliographic record and the imported">Diff</abbr></th>
390                                     <th>Record</th>
391                                 </tr>
392                             </thead>
393                         </table>
394
395                         <div id="marcPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
396                             <div class="modal-dialog">
397                                 <div class="modal-content">
398                                     <div class="modal-header">
399                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
400                                         <h3 id="marcPreviewLabel">MARC preview</h3>
401                                     </div>
402                                     <div class="modal-body">
403                                         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
404                                     </div>
405                                     <div class="modal-footer">
406                                         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
407                                     </div>
408                                 </div>
409                             </div>
410                         </div> <!-- /#marcPreview -->
411                     [% END # /IF import_batch_id %]
412                 </main>
413
414             </div> <!-- /.col-sm-10.col-sm-push-2 -->
415             <div class="col-sm-2 col-sm-pull-10">
416                 <aside>
417                     [% INCLUDE 'tools-menu.inc' %]
418                 </aside>
419             </div> <!-- .col-sm-2.col-sm-pull-10 -->
420         </div> <!-- /.row -->
421
422 [% MACRO jsinclude BLOCK %]
423     [% Asset.js("js/tools-menu.js") | $raw %]
424     [% Asset.js("js/background-job-progressbar.js") | $raw %]
425     [% INCLUDE 'datatables.inc' %]
426     <script>
427         $(document).ready(function() {
428             $("#staged-record-matching-rules select").change(function() {
429                 var str = $(this).attr("id");
430                 $("#reset_" + str).parent().show();
431             });
432             $("a.reset").click(function() {
433                 var str = $(this).attr("id");
434                 str = str.replace("reset_", "")
435                 $("#" + str + " option[selected='selected']").attr("selected", "selected");
436                 $(this).parent().hide();
437             });
438
439             [% IF import_batch_id %]
440                 $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, {
441                     "bAutoWidth": false,
442                     "bFilter": false,
443                     "bProcessing": true,
444                     "bServerSide": true,
445                     "sAjaxSource": 'batch_records_ajax.pl',
446                     "sPaginationType": "full_numbers",
447                     "sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">',
448                     "aoColumns": [
449                         { "mDataProp": "import_record_id" },
450                         { "mDataProp": "citation" },
451                         { "mDataProp": "status" },
452                         { "mDataProp": "overlay_status" },
453                         { "mDataProp": "match_citation" },
454                         { "mDataProp": "diff_url" },
455                         { "mDataProp": "matched" }
456                     ],
457                     "fnServerData": function(sSource, aoData, fnCallback) {
458                         aoData.push({ "name": "import_batch_id", "value": [% import_batch_id | html %] });
459
460                         $.ajax({
461                             'dataType': 'json',
462                             'type': 'POST',
463                             'url': sSource,
464                             'data': aoData,
465                             'success': function(json) {
466                                 fnCallback(json);
467                             }
468                         });
469                     },
470                     "fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
471                         [% IF(record_type == 'auth') %]
472                             var record_details_url = "/cgi-bin/koha/authorities/detail.pl?authid=";
473                         [% ELSE %]
474                             var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber=";
475                         [% END %]
476
477                         $('td:eq(1)', nRow).html(
478                             '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>'
479                         );
480
481                         $('td:eq(2)', nRow).html(
482                             aData['status'] == 'imported' ? _("Imported") :
483                             aData['status'] == 'ignored' ? _("Ignored") :
484                             aData['status'] == 'reverted' ? _("Reverted") :
485                             aData['status'] == 'staged' ? _("Staged") :
486                             aData['status'] == 'error' ? _("Error") :
487                             aData['status']
488                         );
489
490                         $('td:eq(3)', nRow).html(
491                             aData['overlay_status'] == 'no_match' ? _("No match") :
492                             aData['overlay_status'] == 'match_applied' ? _("Match applied") :
493                             aData['overlay_status'] == 'auto_match' ? _("Match found") :
494                             aData['overlay_status']
495                         );
496
497                         if (aData['match_id']) {
498                             [% IF(record_type == 'auth') -%]
499                                 var matching_msg = _("Matches authority %s (score=%s):%s");
500                             [%- ELSE -%]
501                                 var matching_msg = _("Matches bibliographic record %s (score=%s):%s");
502                             [%- END %]
503                             $('td:eq(4)', nRow).html(
504                                 matching_msg.format(aData['match_id'], aData['score'],
505                                     '<a target="_blank" href="' + record_details_url
506                                     + aData['match_id'] + '">' + aData['match_citation'] + '</a>')
507                             );
508                         }
509                         if (aData['diff_url']) {
510                             $('td:eq(5)', nRow).html(
511                                 '<a href="' + aData['diff_url'] + '">' + _("View") + '</a>'
512                             );
513                         }
514                         $('td:eq(6)', nRow).html(
515                             '<a target="_blank" href="' + record_details_url
516                             + aData['matched'] + '">' + aData['matched'] + '</a>'
517                         );
518                     },
519                 }));
520                 $("#import_batch_form").on("submit", function() {
521                     return submitBackgroundJob(document.getElementById("import_batch_form"));
522                 });
523                 $("#revert_batch_form").on("submit", function() {
524                     return confirm(_("Are you sure you want to undo the import of this batch into the catalog?")) && submitBackgroundJob(document.getElementById("revert_batch_form"));
525                 });
526             [% END %]
527
528             $("body").on("click", ".previewMARC", function(e) {
529                 e.preventDefault();
530                 var ltitle = $(this).text();
531                 var page = $(this).attr("href");
532                 $("#marcPreviewLabel").text(ltitle);
533                 $("#marcPreview .modal-body").load(page + " table");
534                 $('#marcPreview').modal({ show: true });
535             });
536             $("#marcPreview").on("hidden.bs.modal", function() {
537                 $("#marcPreviewLabel").html("");
538                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>");
539             });
540             $(".batch_form").on("submit", function() {
541                 if ($(this).hasClass("batch_delete")) {
542                     return confirm(_("Are you sure you want to permanently delete this batch?"));
543                 } else {
544                     return confirm(_("Clear all reservoir records staged in this batch?  This cannot be undone."));
545                 }
546             });
547         });
548
549     </script>
550 [% END %]
551 [% INCLUDE 'intranet-bottom.inc' %]
552 [% BLOCK pagination %]
553     <nav>
554         <ul class="pagination">
555             [% FOREACH page IN pages %]
556                 [% IF ( page.current_page && page.page_number > 1 ) %]
557                     <li><a href="[% page.script_name | url %]?offset=0" class="nav"><i class="fa fa-fw fa-angle-double-left"></i> First</a></li>
558                     <li><a href="[% page.script_name | url %]?offset=[% offset - results_per_page | uri %]"><i class="fa fa-fw fa-angle-left"></i> Previous</a></li>
559                 [% END %]
560             [% END %]
561             [% FOREACH page IN pages %]
562                 [% IF ( page.current_page ) %]
563                     [% SET current_page = page.page_number %]
564                     <li class="active"><span class="current">[% page.page_number | html %]</span></li>
565                 [% ELSE %]
566                     <li><a class="nav" href="[% page.script_name | url %]?offset=[% page.offset | uri %]">[% page.page_number | html %]</a></li>
567                 [% END %]
568             [% END %]
569             [% IF ( current_page < pages.size() ) %]
570                 <li>
571                     <a href="[% page.script_name | url %]?offset=[% offset + results_per_page | uri %]" class="nav">Next <i class="fa fa-fw fa-angle-right"></i></a>
572                 </li>
573                 <li>
574                     <a href="[% page.script_name | url %]?offset=[% ( results_per_page * ( pages.size - 1 ) ) | uri %]" class="nav">Last <i class="fa fa-fw fa-angle-double-right"></i></a>
575                 </li>
576             [% END %]
577         </ul>
578     </nav>
579 [% END %]