mirror of
https://github.com/lazylibrarian/LazyLibrarian.git
synced 2026-06-12 09:35:37 -04:00
134 lines
5.7 KiB
HTML
134 lines
5.7 KiB
HTML
<%inherit file="base.html" />
|
|
<%!
|
|
import lazylibrarian
|
|
%>
|
|
<%def name="headerIncludes()">
|
|
<div id="subhead_container">
|
|
<div id="subhead_menu">
|
|
%if perm&lazylibrarian.perm_force:
|
|
<a href="forceSearch?source=magazines&title=${title | u}" class="button btn btn-sm btn-primary"><i class="fa fa-search"></i> Force Search</a>
|
|
<a href="forceProcess?source=magazines" class="button btn btn-sm btn-primary">Force Post-Processing</a>
|
|
<a href="magazineScan" class="button btn btn-sm btn-primary"><i class="fa fa-flash"></i> Library Scan</a>
|
|
<a href="pastIssues?mag=${title | u}" class="button btn btn-sm btn-primary"><i class="fa fa-calendar-o"></i> Past Issues</a>
|
|
%endif
|
|
<a href="magWall?title=${title | u}" class="button btn btn-sm btn-primary"><i class="fa fa-calendar"></i> Recent Issues</a>
|
|
</div>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
<h1>${title}</h1>
|
|
<form name="markIssues" id="markIssues" action="markIssues" method="get" class="form-inline" onsubmit="return false;">
|
|
<div class="form-group">
|
|
<label for="action" class="control-label">Selected issues:</label>
|
|
<select name="action" id="action" class="form-control input-sm">
|
|
<option value="Remove" selected>Remove</option>
|
|
<option value="Delete">Delete</option>
|
|
</select>
|
|
<button type="submit" class=" btn btn-m btn-primary" onclick="validateForm()">Go</button>
|
|
%if lazylibrarian.CONFIG['TOGGLES'] == True:
|
|
Toggle: <a class="toggle-vis" data-column="1">Cover</a> - <a class="toggle-vis" data-column="2">Issue</a> - <a class="toggle-vis" data-column="3">Acquired</a> - <a class="toggle-vis" data-column="4">Select</a>
|
|
%endif
|
|
</div>
|
|
<p> </p>
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-hover table-bordered" id="book_table">
|
|
<thead>
|
|
<tr>
|
|
%if perm&lazylibrarian.perm_status:
|
|
<th class="select text-center no-sort"><input type="checkbox" onClick="toggleAll(this)" /></th>
|
|
%else:
|
|
<th class="hidden"></th>
|
|
%endif
|
|
% if covercount > 0:
|
|
<th class="bookart text-center no-sort" width=20%>Cover</th>
|
|
% else:
|
|
<th class="bookart hidden">Cover</th>
|
|
% endif
|
|
<th class="issuedate text-center">Issue</th>
|
|
<th class="lastacquired text-center">Acquired</th>
|
|
<th class="issue text-center">Select</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
%for result in issues:
|
|
<tr>
|
|
%if perm&lazylibrarian.perm_status:
|
|
<td class="select text-center"><input type="checkbox" name="${result['IssueID']}" class="form-control" /></td>
|
|
%else:
|
|
<td class="hidden"></td>
|
|
%endif
|
|
% if covercount > 0:
|
|
<td class="bookart text-center"><a href="${result['Cover']}" target="_blank" rel="noreferrer"><img src="${result['Cover']}" alt="cover" width="90%"></a></td>
|
|
% else:
|
|
<td class="bookart hidden"></td>
|
|
% endif
|
|
<td class="issuedate text-center">${result['IssueDate']}</td>
|
|
<td class="lastacquired text-center">${result['IssueAcquired']}</td>
|
|
<td class="issue text-center"><a class="button green btn btn-xs btn-warning" href="openMag?bookid=${result['IssueID']}" target="_self"><i class="fa fa-book"></i> Open</a></td>
|
|
</tr>
|
|
%endfor
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</form>
|
|
</%def>
|
|
<%def name="headIncludes()">
|
|
</%def>
|
|
<%def name="javascriptIncludes()">
|
|
<script type="text/javascript">
|
|
$(document).ready(function()
|
|
{
|
|
|
|
var table = $('#book_table').DataTable(
|
|
{
|
|
"bAutoWidth": false,
|
|
"stateSave": true,
|
|
"order": [[ 2, 'desc']],
|
|
"columnDefs": [{ targets: 'no-sort', orderable: false }],
|
|
"oLanguage": {
|
|
"sSearch": "Filter: ",
|
|
"sLengthMenu":"Show _MENU_ issues per page",
|
|
"sEmptyTable": "No issues found",
|
|
"sInfo":"Showing _START_ to _END_ of _TOTAL_ results",
|
|
"sInfoEmpty":"Showing 0 to 0 of 0 issues",
|
|
"sInfoFiltered":"(filtered from _MAX_ total issues)"},
|
|
"sPaginationType": "full_numbers",
|
|
"aaSorting": [[2, 'desc']],
|
|
"aLengthMenu": [[5, 10, 15, 25, 50, 100, -1], [5, 10, 15, 25, 50, 100, "All"]],
|
|
"iDisplayLength": ${lazylibrarian.CONFIG['DISPLAYLENGTH']},
|
|
});
|
|
$('.dataTables_filter input').attr("placeholder", "Results filter");
|
|
$('a.toggle-vis').click(function (e) {
|
|
e.preventDefault();
|
|
var column = table.column( $(this).attr('data-column') );
|
|
column.visible( ! column.visible() );
|
|
} );
|
|
});
|
|
|
|
function validateForm() {
|
|
var x = document.forms["markIssues"]["action"].value;
|
|
if (x == "Delete") {
|
|
bootbox.confirm({
|
|
message: "Are you sure you want to permanently delete the selected issues?",
|
|
buttons: {
|
|
confirm: {
|
|
label: 'Yes',
|
|
className: 'btn-success'
|
|
},
|
|
cancel: {
|
|
label: 'No',
|
|
className: 'btn-danger'
|
|
}
|
|
},
|
|
callback: function (result) {
|
|
if (result) { document.getElementById("markIssues").submit(); }
|
|
}
|
|
});
|
|
return false;
|
|
}
|
|
else { document.getElementById("markIssues").submit(); }
|
|
}
|
|
</script>
|
|
</%def>
|