mirror of
https://github.com/lazylibrarian/LazyLibrarian.git
synced 2026-06-11 17:17:23 -04:00
111 lines
4.3 KiB
HTML
111 lines
4.3 KiB
HTML
<%inherit file="base.html" />
|
|
<%!
|
|
import lazylibrarian
|
|
%>
|
|
<%def name="headerIncludes()">
|
|
<div id="subhead_container">
|
|
<div id="subhead_menu">
|
|
<label for="wallColumns" class=""> </label>
|
|
</div>
|
|
</div>
|
|
</%def>
|
|
<%def name="body()">
|
|
<h1>${title}</h1>
|
|
<form action="pastIssues" method="get" class="form-inline">
|
|
<div class="form-group">
|
|
<label for="whichStatus" class="control-label">Status: </label>
|
|
<select name="whichStatus" id="whichStatus" class="form-control input-sm">
|
|
%for item in ['Skipped', 'Have', 'Ignored', 'Wanted', 'Snatched']:
|
|
<option value="${item}"
|
|
%if whichStatus == item:
|
|
selected = "selected"
|
|
%endif
|
|
>${item}</option>
|
|
%endfor
|
|
</select>
|
|
</div>
|
|
|
|
%if lazylibrarian.CONFIG['TOGGLES'] == True:
|
|
Toggle: <a class="toggle-vis" data-column="1">Title</a> - <a class="toggle-vis" data-column="2">Date</a> - <a class="toggle-vis" data-column="3">Issue</a> - <a class="toggle-vis" data-column="4">Provider</a>
|
|
%endif
|
|
</form>
|
|
<br>
|
|
<form action="markPastIssues" method="get" class="form-inline">
|
|
<input type="hidden" name="redirect" value="manageissues">
|
|
<table class="display table table-striped table hover table-bordered" id="book_table">
|
|
<thead>
|
|
<tr>
|
|
<th class="select no-sort"><input type="checkbox" onClick="toggleAll(this)" /></th>
|
|
<th class="magtitle">Title</th>
|
|
<th class="lastacquired text-center">NZB Date</th>
|
|
<th class="issuedate text-center">Issue Date</th>
|
|
<th class="Provider">Provider</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
%if perm%lazylibrarian.perm_status:
|
|
<p>
|
|
<div class="form-group">
|
|
<label class="control-label">Change selected magazines to:</label>
|
|
<select class="form-control input-sm" name="action">
|
|
%for item in ['Skipped', 'Wanted', 'Ignored', 'Remove']:
|
|
%if whichStatus != item:
|
|
<option value="${item}">${item}</option>
|
|
%endif
|
|
%endfor
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="btn btn-sm btn-default" id="markPastIssues" value="Go">Go</button>
|
|
</p>
|
|
%endif
|
|
</form>
|
|
</%def>
|
|
<%def name="headIncludes()">
|
|
</%def>
|
|
<%def name="javascriptIncludes()">
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$('#whichStatus').change(function(){
|
|
window.location = 'pastIssues?mag=${mag | u}&whichStatus=' + $(this).val()
|
|
})
|
|
var table = $('#book_table').DataTable(
|
|
{
|
|
"responsive": true,
|
|
"order": [[ 1, 'asc']],
|
|
"bAutoWidth": false,
|
|
"stateSave": true,
|
|
"columnDefs":
|
|
[ { targets: 'no-sort', orderable: false },
|
|
{ targets: [0],
|
|
'class': 'text-center',
|
|
'render': function(data, type, row) {
|
|
return '<input type="checkbox" name="' + data + '" class="checkbox" />';}
|
|
}
|
|
]
|
|
,
|
|
"oLanguage": {
|
|
"sSearch": "Filter: ",
|
|
"sLengthMenu":"_MENU_ rows per page",
|
|
"sEmptyTable": "No matching issues found",
|
|
"sInfo":"Showing _START_ to _END_ of _TOTAL_ rows",
|
|
"sInfoEmpty":"Showing 0 to 0 of 0 rows",
|
|
"sInfoFiltered":"(filtered from _MAX_ total rows)"},
|
|
"sPaginationType": "full_numbers",
|
|
"aLengthMenu": [[5, 10, 15, 25, 50, 100, -1], [5, 10, 15, 25, 50, 100, "All"]],
|
|
"iDisplayLength": ${lazylibrarian.CONFIG['DISPLAYLENGTH']},
|
|
"aaSorting": [[1, 'asc']],
|
|
"bServerSide": true,
|
|
// need to pass requested status filter
|
|
"sAjaxSource": 'getPastIssues?whichStatus=${whichStatus}&mag=${mag | u}',
|
|
"bFilter": true,
|
|
});
|
|
$('.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() );
|
|
} );
|
|
});
|
|
</script>
|
|
</%def>
|