Lines 270-283
Link Here
|
270 |
[% END %] |
270 |
[% END %] |
271 |
</div> |
271 |
</div> |
272 |
[% END %] |
272 |
[% END %] |
273 |
<div class="statictabs"> |
|
|
274 |
<ul> |
275 |
<li><a id="marcfileslink">Marc files</a></li> |
276 |
<li><a id="draftrecordslink" name="draft_record_to_display" value="1">Draft records</a></li> |
277 |
</ul> |
278 |
|
279 |
<div class="tabs-container"> |
280 |
<div id="marcfiles"> |
281 |
<table> |
273 |
<table> |
282 |
<tr> |
274 |
<tr> |
283 |
<th>#</th> |
275 |
<th>#</th> |
Lines 334-361
Link Here
|
334 |
</tr> |
326 |
</tr> |
335 |
[% END %] |
327 |
[% END %] |
336 |
</table> |
328 |
</table> |
337 |
</div> |
|
|
338 |
|
339 |
<div id="draftrecords" onload="document.getElementById("draftrecords").style.display ='none';"> |
340 |
<p> To edit or save these draft records click the 'Edit' link beside the appropriate record. </p> |
341 |
<table id="records-table"> |
342 |
<thead> |
343 |
<tr> |
344 |
<th>#</th> |
345 |
<th>Citation</th> |
346 |
<th>Status</th> |
347 |
<th>Match type</th> |
348 |
<th>Match details</th> |
349 |
<th><abbr title="Differences between the original biblio and the imported">Diff</abbr></th> |
350 |
<th>Record</th> |
351 |
<th>Catalog link</th> |
352 |
</tr> |
353 |
</thead> |
354 |
</table> |
355 |
</div> |
356 |
</div> |
357 |
</div> |
358 |
|
359 |
[% IF ( pages ) %] |
329 |
[% IF ( pages ) %] |
360 |
<div class="pages"> |
330 |
<div class="pages"> |
361 |
[% FOREACH page IN pages %] |
331 |
[% FOREACH page IN pages %] |
Lines 426-461
Link Here
|
426 |
$(this).parent().hide(); |
396 |
$(this).parent().hide(); |
427 |
}); |
397 |
}); |
428 |
|
398 |
|
429 |
[% IF !(import_batch_id) %] |
399 |
[% IF import_batch_id %] |
430 |
document.getElementById('draftrecords').style.display = 'none'; |
|
|
431 |
var marcfileslink = document.getElementById("marcfileslink"); |
432 |
marcfileslink.style.backgroundColor = "#FFF"; |
433 |
[% END %] |
434 |
|
435 |
var marcfiles = document.getElementById("marcfiles"); |
436 |
var draftrecords = document.getElementById("draftrecords"); |
437 |
var draftrecordslink = document.getElementById("draftrecordslink"); |
438 |
var marcfileslink = document.getElementById("marcfileslink"); |
439 |
|
440 |
$("#draftrecordslink").click(function(e){ |
441 |
draftrecords.style.display = "block"; |
442 |
draftrecordslink.style.backgroundColor = "#FFF"; |
443 |
marcfileslink.style.backgroundColor= "#e6f0f2"; |
444 |
marcfiles.style.display = "none"; |
445 |
if (document.getElementById("draftrecords").style.display === 'block') { |
446 |
[% draft_record_to_display = 1 %] |
447 |
} |
448 |
}); |
449 |
|
450 |
$("#marcfileslink").click(function(e){ |
451 |
draftrecords.style.display = "none"; |
452 |
marcfiles.style.display = "block"; |
453 |
draftrecordslink.style.backgroundColor = "#e6f0f2"; |
454 |
marcfileslink.style.backgroundColor= "#FFF"; |
455 |
}); |
456 |
|
457 |
[% IF (import_batch_id || draft_record_to_display) %] |
458 |
$("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { |
400 |
$("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { |
|
|
401 |
"bSort": true, |
402 |
"order": [0, "desc"], |
459 |
"bAutoWidth": false, |
403 |
"bAutoWidth": false, |
460 |
"bFilter": false, |
404 |
"bFilter": false, |
461 |
"bProcessing": true, |
405 |
"bProcessing": true, |
Lines 471-485
Link Here
|
471 |
{ "mDataProp": "match_citation" }, |
415 |
{ "mDataProp": "match_citation" }, |
472 |
{ "mDataProp": "diff_url" }, |
416 |
{ "mDataProp": "diff_url" }, |
473 |
{ "mDataProp": "matched" }, |
417 |
{ "mDataProp": "matched" }, |
474 |
[% IF !(import_batch_id) %] { "mDataProp": "catalog_link" } [% END %] |
|
|
475 |
], |
418 |
], |
476 |
[% IF (import_batch_id) %] |
419 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
477 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
420 |
aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } ); |
478 |
aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } ); |
|
|
479 |
[% ELSE %] |
480 |
"fnServerData": function ( sSource, aoData, fnCallback ) { |
481 |
aoData.push( { "name": "import_batch_id", "value": [% draft_record_to_display %] } ); |
482 |
[% END %] |
483 |
$.ajax({ |
421 |
$.ajax({ |
484 |
'dataType': 'json', |
422 |
'dataType': 'json', |
485 |
'type': 'POST', |
423 |
'type': 'POST', |
Lines 502-514
Link Here
|
502 |
); |
440 |
); |
503 |
|
441 |
|
504 |
$('td:eq(2)', nRow).html( |
442 |
$('td:eq(2)', nRow).html( |
505 |
aData['status'] == 'imported' ? _("Imported") : |
443 |
aData['status'] == 'staged' ? _("Draft") : |
506 |
aData['status'] == 'ignored' ? _("Ignored") : |
|
|
507 |
aData['status'] == 'reverted' ? _("Reverted") : |
508 |
aData['status'] == 'staged' ? _("Staged") : |
509 |
aData['status'] == 'error' ? _("Error") : |
510 |
aData['status'] |
444 |
aData['status'] |
511 |
); |
445 |
); |
|
|
446 |
$('td:eq(2)', nRow).html( |
447 |
aData['status'] == 'imported' ? _("Imported") : |
448 |
aData['status'] == 'ignored' ? _("Ignored") : |
449 |
aData['status'] == 'reverted' ? _("Reverted") : |
450 |
aData['status'] == 'staged' ? _("Staged") : |
451 |
aData['status'] == 'error' ? _("Error") : |
452 |
aData['status'] |
453 |
); |
512 |
|
454 |
|
513 |
$('td:eq(3)', nRow).html( |
455 |
$('td:eq(3)', nRow).html( |
514 |
aData['overlay_status'] == 'no_match' ? _("No match") : |
456 |
aData['overlay_status'] == 'no_match' ? _("No match") : |
Lines 538-550
Link Here
|
538 |
'<a target="_blank" href="' + record_details_url |
480 |
'<a target="_blank" href="' + record_details_url |
539 |
+ aData['matched'] + '">' + aData['matched'] + '</a>' |
481 |
+ aData['matched'] + '">' + aData['matched'] + '</a>' |
540 |
); |
482 |
); |
541 |
[% IF !(import_batch_id) %] |
|
|
542 |
if (aData['catalog_link']){ |
543 |
$('td:eq(7)', nRow).html( |
544 |
'<a href="' + aData['catalog_link'] + '">' + "Edit" + '</a>' |
545 |
); |
546 |
} |
547 |
[% END %] |
548 |
}, |
483 |
}, |
549 |
})); |
484 |
})); |
550 |
$("#import_batch_form").on("submit",function(){ |
485 |
$("#import_batch_form").on("submit",function(){ |