1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-23 00:02:38 +00:00
mylar/data/interfaces/default/upcoming.html

402 lines
18 KiB
HTML
Executable file

<%inherit file="base.html" />
<%!
import mylar
%>
<%def name="headerIncludes()">
<div id="subhead_container">
<div id="subhead_menu">
<a href="#" id="menu_link_scan" onclick="doAjaxCall('forceSearch',$(this))" data-success="Checking for wanted issues successful" data-error="Error checking wanted issues">Force Check</a>
</div>
</div>
</%def>
<%def name="body()">
<div class="title">
<h1 class="clearfix"><img src="interfaces/default/images/icon_wanted.png" alt="Wanted Issues"/>Wanted Issues (${wantedcount})</h1>
</div>
<div id="checkboxControls" style="float: right; vertical-align: middle; margin: 5px 3px 3px 3px;">
<div style="padding-bottom: 5px;">
<label for="Wanted" class="checkbox inline Wanted"><input type="checkbox" id="Wanted" checked="checked" /> Wanted: <b>${isCounts['Wanted']}</b></label>
<label for="WantedTier" class="checkbox inline WantedTier">Tiered: <b>${isCounts['WantedTier']}</b></label>
%if mylar.CONFIG.UPCOMING_SNATCHED is True:
%if int(isCounts['Snatched']) > 0:
<label for="Snatched" class="checkbox inline Snatched"><input type="checkbox" id="Snatched" checked="checked" /> Snatched: <b>${isCounts['Snatched']}</b></label>
%endif
%endif
%if int(isCounts['Failed']) > 0 and mylar.CONFIG.FAILED_DOWNLOAD_HANDLING is True:
<label for="Failed" class="checkbox inline Failed"><input type="checkbox" id="Failed" checked="checked" /> Failed: <b>${isCounts['Failed']}</b></label>
%endif
</div>
</div>
<div class="table_wrapper" id="wanted_table_wrapper" >
<form action="markissues" method="get" id="markissues">
<div id="markissue" style="top:0;">
Mark selected issues as
<select name="action" onChange="doAjaxCall('markissues',$(this),'table',true);" data-error="You didn't select any issues" data-success="selected issues marked">
<option disabled="disabled" selected="selected">Choose...</option>
<option value="Wanted">Wanted</option>
<option value="Skipped">Skipped</option>
<option value="Downloaded">Downloaded</option>
<option value="Archived">Archived</option>
<option value="Ignored">Ignored</option>
</select>
<input type="hidden" value="Go">
</div>
<small style="float: right; vertical-align: middle;">Date shown in SearchTier is when the issue was added to the Wanted list</small>
<table class="display" id="wanted_table">
<thead>
<tr>
<th id="select"><input type="checkbox" onClick="toggle(this)" /></th>
<th id="comicname">Comic</th>
<th id="issuenumber">Issue</th>
<th id="reldate">Release Date</th>
<th id="tier">SearchTier</th>
<th id="options">Options</th>
</tr>
</thead>
<tbody>
%for issue in issues:
<%
if issue['Status'] == 'Wanted':
grade = 'X'
try:
if issue['DateAdded'] <= mylar.SEARCH_TIER_DATE:
tier = "2nd"
grade = 'T2'
else:
tier = "1st [%s]" % issue['DateAdded']
grade = 'X'
except:
tier = "1st [%s]" % issue['DateAdded']
grade = 'T2'
elif issue['Status'] == 'Snatched':
grade = 'C'
elif issue['Status'] == 'Failed':
grade = 'F'
else:
grade = 'Z'
%>
<tr class="${issue['Status']} grade${grade}">
<%
linkit = 'comicDetails?ComicID=%s' % issue['ComicID']
try:
if issue['StoryArcID'] is not None:
lineheader = issue['StoryArc']
linkit = 'detailStoryArc?StoryArcID=%s&StoryArcName=%s' % (issue['StoryArcID'],issue['StoryArc'])
issuenumber = issue['IssueNumber']
issueid = issue['IssueArcID']
else:
lineheader = None
issuenumber = issue['Issue_Number']
issueid = issue['IssueID']
except:
lineheader = None
try:
issuenumber = issue['Issue_Number']
except:
issuenumber = issue['IssueNumber']
issueid = issue['IssueID']
if any(d['IssueID'] == str(issue['IssueID']) for d in ann_list):
adjcomicname = issue['ComicName'] + ' Annual'
else:
adjcomicname = issue['ComicName']
endif
try:
if issue['DateAdded'] <= mylar.SEARCH_TIER_DATE:
tier = "2nd"
else:
tier = "1st [%s]" % issue['DateAdded']
except:
tier = "1st [%s]" % issue['DateAdded']
%>
<td id="select"><input type="checkbox" name="${issueid}" class="checkbox" value="${issueid}"/></td>
<td id="comicname">
%if lineheader is not None:
<b>[${lineheader}]</b><a href="${linkit}"> ${adjcomicname}</a>
%else:
<a href="${linkit}">${adjcomicname}</a>
%endif
</td>
<td id="issuenumber">${issuenumber}</td>
<td id="reldate">${issue['IssueDate']}</td>
%if issue['Status'] == 'Wanted':
<td id="tier" style="text-align:center;">${tier}</td>
%else:
<td id="tier"></td>
%endif
<td id="options">
<!--
<a class="menu_link_edit" id="choose_specific_download" title="Choose Specific Download" href="javascript:void(0)" onclick="getAvailableDownloads('${issueid}')"><i class="fa fa-search"></i><img src="interfaces/default/images/magnifier.png" height="25" width="25" class="highqual" /></a>
<div id="choose_specific_download_dialog" title="Choose a specific download for ${adjcomicname} #${issuenumber}" style="display:none" class="configtable">
<table class="display" id="downloads_table">
<thead>
<tr>
<th id="title">Title</th>
<th id="provider">Provider</th>
<th id="size">Size</th>
<th id="kind">Kind</th>
</tr>
</thead>
<tbody id="downloads_table_body" value="Now searching....this might take up to 90 seconds.">
</tbody>
</table>
</div>
-->
</td>
</div
</tr>
%endfor
</tbody>
</table>
</form>
</div>
<div class="title">
<h1 class="clearfix"><img src="interfaces/default/images/icon_upcoming.png" alt="Upcoming Issues"/>Upcoming Issues</h1>
</div>
<div id="tabs">
<ul>
<li><a href="#tabs-1">This Week's Upcoming (${upcoming_count})</a></li>
<li><a href="#tabs-2">Upcoming nodata</a></li>
<!--
<li><a href="#tabs-3">Future Upcoming (${futureupcoming_count})</a></li>
-->
</ul>
<div id="tabs-1">
<div class="table_wrapper">
<table class="display_no_select" id="upcoming_table">
%if upcoming:
<thead>
<tr>
<th id="comicname">Comic</th>
<th id="issuenumber">Issue</th>
<th id="reldate">Release Date</th>
<th id="status">Status</th>
</tr>
</thead>
<tbody>
%for upcome in upcoming:
<tr class="gradeZ">
<td id="comicname"><a href="comicDetails?ComicID=${upcome['ComicID']}">${upcome['ComicName']}</a></td>
<td id="issuenumber">${upcome['IssueNumber']}</td>
<td id="reldate">${upcome['IssueDate']}</td>
<td id="status">${upcome['Status']}</td>
</tr>
%endfor
%else:
<tr><td align="center" width="100%"> no upcoming data to display</td></tr>
%endif
</tbody>
</table>
</div>
</div>
<div id="tabs-2">
<a name="upcoming_nodata"></a>
<a id="menu_link_edit" href="future_check">Force Check Availability</a>
<div class="table_wrapper">
<table class="display_no_select" id="upcoming_table">
%if future_nodata_upcoming:
<thead>
<tr>
<th id="delcolumn"></th>
<th id="comicname">Comic</th>
<th id="issuenumber">Issue</th>
<th id="reldate">Release Date</th>
<th id="status">Status</th>
</tr>
</thead>
<tbody>
%for f_nodata in future_nodata_upcoming:
<tr class="gradeZ">
<td id="delcolumn">
<a href="upcoming#upcoming_nodata" title="Delete series from auto-Want list" onclick="doAjaxCall('removeautowant?comicname=${f_nodata['ComicName'] |u}&release=${f_nodata['IssueDate']}',$(this),'table')" data-success="${f_nodata['ComicName']} has been removed from the auto-want list"><img src="interfaces/default/images/skipped_icon.png" height="25" width="25" class="highqual" /></a>
</td>
%if f_nodata['ComicID'] is not None:
<td id="comicname"><a href="comicDetails?ComicID=${f_nodata['ComicID']}">${f_nodata['ComicName']}</a></td>
%else:
<td id="comicname">${f_nodata['ComicName']}</td>
%endif
<td id="issuenumber">${f_nodata['IssueNumber']}</td>
<td id="reldate">${f_nodata['IssueDate']}</td>
<td id="status">${f_nodata['Status']}</td>
</tr>
%endfor
%else:
<tr><td align="center" width="100%">no upcoming future data to display</td></tr>
%endif
</tbody>
</table>
</div>
</div>
<!--
<div id="tabs-3">
<a id="menu_link_edit" href="futurepulllist">View Future Pull-list</a>
<div class="table_wrapper">
<table class="display_no_select" id="upcoming_table">
%if futureupcoming:
<thead>
<tr>
<th id="comicname">Comic</th>
<th id="issuenumber">Issue</th>
<th id="reldate">Release Date</th>
<th id="status">Status</th>
</tr>
</thead>
<tbody>
%for f_upcome in futureupcoming:
<tr class="gradeZ">
<td id="comicname">${f_upcome['ComicName']}</td>
<td id="issuenumber">${f_upcome['IssueNumber']}</td>
<td id="reldate">${f_upcome['IssueDate']}</td>
<td id="status">${f_upcome['Status']}</td>
</tr>
%endfor
%else:
<tr><td align="center" width="100%">no upcoming future data to display</td></tr>
%endif
</tbody>
</table>
</div>
</div>
-->
</div>
</%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>
// show/hide different types of rows when the checkboxes are changed
$("#checkboxControls input").change(function(e){
var whichClass = $(this).attr('id')
$(this).showHideRows(whichClass)
return
$('tr.'+whichClass).each(function(i){
$(this).toggle();
});
});
// initially show/hide all the rows according to the checkboxes
$("#checkboxControls input").each(function(e){
var status = this.checked;
$("tr."+$(this).attr('id')).each(function(e){
if (status) {
$(this).show();
} else {
$(this).hide();
}
});
});
$.fn.showHideRows = function(whichClass){
var status = $('#checkboxControls > input, #'+whichClass).prop('checked')
$("tr."+whichClass).each(function(e){
if (status) {
$(this).show();
} else {
$(this).hide();
}
});
};
function getAvailableDownloads(issueid) {
ShowSpinner();
$.getJSON("choose_specific_download", {issueid: issueid}, function(data) {
loader.remove();
feedback.fadeOut();
search_results = data
for( var i = 0, len = data.length; i < len; i++ ) {
$('#downloads_table_body').append('<tr><td id="title"><a href="javascript:void(0)" onclick="downloadSpecificRelease('+i+')">'+data[i].nzbtitle+'</a></td><td id="provider">'+data[i].provider+'</td><td id="size">'+data[i].size+'</td><td id="kind">'+data[i].kind+'</td></tr>');
}
$('#downloads_table').dataTable({
"aoColumns": [
null,
null,
null,
null
],
"aaSorting": [[ 1, 'desc']],
"bFilter": false,
"bInfo": false,
"bPaginate": false,
"bDestroy": true
});
$("#choose_specific_download_dialog").dialog({
width: "70%",
maxHeight: 500
});
return false;
});
}
function downloadSpecificRelease(i){
name = search_results[i].nzbtitle
prov = search_results[i].tmpprov
nzbid = search_results[i].nzbid
ShowSpinner();
$.getJSON("download_specific_release", {nzbid: nzbid, provider: prov, name: name}, function(data) {
loader.remove();
feedback.fadeOut();
refreshSubmenu();
$("#choose_specific_download_dialog").dialog("close");
});
}
function ShowSpinner() {
feedback = $("#ajaxMsg");
update = $("#updatebar");
if ( update.is(":visible") ) {
var height = update.height() + 35;
feedback.css("bottom",height + "px");
} else {
feedback.removeAttr("style");
}
loader = $("<i class='fa fa-refresh fa-spin'></i>");
feedback.prepend(loader);
feedback.fadeIn();
}
var loadingMessage = false;
var spinner_active = false;
var loadingtext_active = false;
var refreshInterval;
function initThisPage() {
$(function() {
$( "#tabs" ).tabs();
});
$('#wanted_table').dataTable({
"bDestroy":true,
"bFilter": false,
"bInfo": false,
"bPaginate": false
});
resetFilters("issues");
initActions();
}
$(document).ready(function() {
initThisPage();
});
</script>
</%def>