1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-27 01:57:01 +00:00
mylar/data/interfaces/default/history.html

107 lines
4.1 KiB
HTML
Executable file

<%inherit file="base.html"/>
<%!
from mylar import helpers
%>
<%def name="headerIncludes()">
<div id="subhead_container">
<div id="subhead_menu">
<a id="menu_link_delete" href="#" onclick="doAjaxCall('clearhistory?type=all',$(this),'table')" data-success="All History cleared">Clear All History</a>
<a id="menu_link_delete" href="#" onclick="doAjaxCall('clearhistory?type=Processed',$(this),'table')" data-success="All Processed cleared">Clear Processed</a>
<a id="menu_link_delete" href="#" onclick="doAjaxCall('clearhistory?type=Unprocessed',$(this),'table')" data-success="All Unprocessed cleared">Clear Unprocessed</a>
<a id="menu_link_delete" href="#" onclick="doAjaxCall('clearhistory?type=Snatched',$(this),'table')" data-success="All Snatched cleared">Clear Snatched</a>
</div>
</div>
</%def>
<%def name="body()">
<div id="paddingheader">
<h1 class="clearfix"><img src="interfaces/default/images/icon_history.png" alt="History"/>History</h1>
</div>
<form action="markissues" method="get" id="markissues">
<div id="markissue">Mark selected issues as
<select name="action" onChange="doAjaxCall('markissues',$(this),'table',true);" data-success="selected issues marked">
<option disabled="disabled" selected="selected">Choose...</option>
<option value="Retry">Retry</option>
<option value="Clear">Clear</option>
</select>
selected issues
<input type="hidden" value="Go">
</div>
<div class="table_wrapper" id="history_table_wrapper">
<table class="display" id="history_table">
<thead>
<tr>
<th id="select" align="left"><input type="checkbox" onClick="toggle(this)" class="checkbox" /></th>
<th id="dateadded">Date Added</th>
<th id="filename">Comic Name</th>
<th id="issue">Issue</th>
<th id="status">Status</th>
<th id="action"></th>
</tr>
</thead>
<tbody>
%for item in history:
<%
if item['Status'] == 'Processed':
grade = 'A'
elif item['Status'] == 'Snatched':
grade = 'C'
elif item['Status'] == 'Unprocessed':
grade = 'X'
else:
grade = 'U'
%>
<tr class="grade${grade}">
<td id="select"><input type="checkbox" name="${item['IssueID']}" class="checkbox" /></td>
<td id="dateadded">${item['DateAdded']}</td>
<td id="filename">${item['ComicName']}</td>
<td id="issue">${item['Issue_Number']}</td>
<td id="status">${item['Status']}
%if item['Provider'] == 'ComicBT' or item['Provider'] == 'KAT':
<img src="interfaces/default/images/torrent-icon.png" height="20" width="20" title="${item['Provider']}" />
%endif
</td>
<td id="action">[<a href="#" onclick="doAjaxCall('queueissue?IssueID=${item['IssueID']}&ComicName=${item['ComicName']}&ComicID=${item['ComicID']}&ComicIssue=${item['Issue_Number']}&mode=want&redirect=history', $(this),'table')" data-success="Retrying download of '${item['ComicName']}' '${item['Issue_Number']}'">retry</a>]</td>
</tr>
%endfor
</tbody>
</table>
</div>
</form>
</%def>
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
</%def>
<%def name="javascriptIncludes()">
<script src="js/libs/jquery.dataTables.min.js"></script>
<script>
function initThisPage() {
$('#history_table').dataTable({
"bDestroy": true,
"oLanguage": {
"sLengthMenu":"Show _MENU_ items per page",
"sEmptyTable": "<em>No History to Display</em>",
"sInfo":"Showing _START_ to _END_ of _TOTAL_ items",
"sInfoEmpty":"Showing 0 to 0 of 0 items",
"sInfoFiltered":"(filtered from _MAX_ total items)"},
"iDisplayLength": 25,
"sPaginationType": "full_numbers",
"aaSorting": []
});
resetFilters("history");
}
$(document).ready(function() {
initThisPage();
initActions();
});
</script>
</%def>