mirror of https://github.com/evilhero/mylar
387 lines
25 KiB
HTML
Executable File
387 lines
25 KiB
HTML
Executable File
<%inherit file="base.html"/>
|
|
<%!
|
|
import mylar
|
|
from mylar import db
|
|
from mylar.helpers import checked
|
|
%>
|
|
|
|
<%def name="headerIncludes()">
|
|
<div id="subhead_container">
|
|
<div id="subhead_menu">
|
|
<a href="#" id="menu_link_refresh" onclick="doAjaxCall('pullist?week=${weekinfo['weeknumber']}&year=${weekinfo['year']}',$(this),'table')" data-success="Refresh submitted.">Refresh Pull-list</a>
|
|
<a href="#" id="menu_link_retry" onclick="doAjaxCall('pullrecreate?weeknumber=${weekinfo['weeknumber']}&year=${weekinfo['year']}',$(this),'table')" data-success="Recreating Pullist for week ${weekinfo['weeknumber']}, ${weekinfo['year']}">Recreate Pull-list</a>
|
|
<!--
|
|
<a href="#" id="menu_link_retry" onclick="doAjaxCall('create_readlist?weeknumber=${weekinfo['weeknumber']}&year=${weekinfo['year']}',$(this),'table')" data-success="Submitted request for reading-list generation for this week">Generate Reading-List</a>
|
|
-->
|
|
<a id="menu_link_scan" class="button">Download</a>
|
|
<a href="#" id="menu_link_refresh" onclick="doAjaxCall('pullSearch?week=${weekinfo['weeknumber']}&year=${weekinfo['year']}',$(this),'table')" data-success="Submitted background search request for new pull issues">Manually check for issues</a>
|
|
%if all([mylar.CONFIG.ENABLE_TORRENT_SEARCH is True, mylar.CONFIG.ENABLE_32P is True, mylar.CONFIG.MODE_32P is True]):
|
|
<a href="#" id="menu_link_refresh" onclick="doAjaxCall('download_0day?week=${weekinfo['midweek']}',$(this),'table')" data-success="Submitted background search request for 0-day pack for this week">Download 0-Day Pack</a>
|
|
%endif
|
|
</div>
|
|
</div>
|
|
<a href="home" class="back">« Back to overview</a>
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
<div>
|
|
</br></br>
|
|
<table width="100%" align="center">
|
|
<tr>
|
|
<td style="vertical-align: middle; text-align: right">
|
|
<a href="pullist?week=${weekinfo['prev_weeknumber']}&year=${weekinfo['prev_year']}¤t=${weekinfo['weeknumber']}-${weekinfo['year']}" title="Previous Week (${weekinfo['prev_weeknumber']})" onclick="$('#pull_table').page('first').draw('page');">
|
|
<img src="interfaces/default/images/prev.gif" width="16" height="18" Alt="Previous"/>
|
|
</a>
|
|
</td>
|
|
<td style="vertical-align: middle; text-align: center">
|
|
%if wantedcount == 0:
|
|
<h1><center>Weekly Pull list for week ${weekinfo['weeknumber']} :</br>${weekinfo['startweek']} - ${weekinfo['endweek']}</center></h1>
|
|
%else:
|
|
<h1><center>Weekly Pull list for week ${weekinfo['weeknumber']} :</br>${weekinfo['startweek']} - ${weekinfo['endweek']} (${wantedcount})</center></h1>
|
|
%endif
|
|
</td>
|
|
<td style="vertical-align: middle; text-align: left">
|
|
<a href="pullist?week=${weekinfo['next_weeknumber']}&year=${weekinfo['next_year']}¤t=${weekinfo['weeknumber']}-${weekinfo['year']}" title="Next Week (${weekinfo['next_weeknumber']})" onclick="$('#pull_table').page('first').draw('page');">
|
|
<img src="interfaces/default/images/next.gif" width="16" height="18" Alt="Next"/>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div>
|
|
<form action="MassWeeklyDownload" method="GET" id="MassDownload">
|
|
<fieldset>
|
|
<div class="row checkbox left clearfix">
|
|
</br>
|
|
<input type="checkbox" name="weekfolder" id="weekfolder" value="1" ${checked(mylar.CONFIG.WEEKFOLDER)} /><label>Store in Weekly Directory (${weekfold})</label>
|
|
</div>
|
|
|
|
<input type="hidden" name="year" value="${weekinfo['year']}">
|
|
<input type="hidden" name="weeknumber" value="${weekinfo['weeknumber']}">
|
|
<input type="hidden" name="midweek" value="${weekinfo['midweek']}">
|
|
<input type="submit" style="display:none" />
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="table_wrapper">
|
|
|
|
<table class="display" id="pull_table">
|
|
<thead>
|
|
<tr>
|
|
<th id="publisher">Publisher</th>
|
|
<th id="comicname">Comic</th>
|
|
<th id="comicnumber">#</th>
|
|
<th id="status">Status</th>
|
|
<th id="options">Options</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
%for weekly in weeklyresults:
|
|
<%
|
|
if weekly['STATUS'] == 'Skipped':
|
|
grade = 'Z'
|
|
elif weekly['STATUS'] == 'Wanted':
|
|
grade = 'X'
|
|
elif weekly['STATUS'] == 'Snatched':
|
|
grade = 'C'
|
|
elif weekly['STATUS'] == 'Downloaded':
|
|
grade = 'D'
|
|
elif weekly['STATUS'] == 'Paused':
|
|
grade = 'T'
|
|
if weekly['AUTOWANT'] == True:
|
|
grade = 'H'
|
|
|
|
if weekly['HAVEIT'] == 'OneOff':
|
|
grade = 'H'
|
|
|
|
#if the comicid is present, but issue isn't marked as wanted.
|
|
if weekly['HAVEIT'] == 'Yes' and weekly['STATUS'] == 'Skipped':
|
|
grade = 'E'
|
|
|
|
%>
|
|
<tr class="grade${grade}">
|
|
%if pullfilter is True:
|
|
<td class="publisher">${weekly['PUBLISHER']}</td>
|
|
<td class="comicname">
|
|
%if weekly['HAVEIT'] == 'No':
|
|
%if all([weekly['COMICID'] != '', weekly['COMICID'] is not None]):
|
|
<a href="${weekly['LINK']}" target="_blank">${weekly['COMIC']}</a>
|
|
%else:
|
|
${weekly['COMIC']}
|
|
%endif
|
|
%else:
|
|
%if weekly['HAVEIT'] == 'OneOff':
|
|
%if all([weekly['COMICID'] != '', weekly['COMICID'] is not None]):
|
|
<a href="${weekly['LINK']}" target="_blank">${weekly['COMIC']}</a>
|
|
%else:
|
|
${weekly['COMIC']}
|
|
%endif
|
|
%else:
|
|
<a href="comicDetails?ComicID=${weekly['COMICID']}">${weekly['COMIC']}</a>
|
|
%endif
|
|
%endif
|
|
%if weekly['VOLUME'] is not None:
|
|
 V${weekly['VOLUME']}
|
|
%endif
|
|
|
|
%if weekly['SERIESYEAR'] is not None:
|
|
 (${weekly['SERIESYEAR']})
|
|
%endif
|
|
|
|
%if weekly['FORMAT'] == 'Digital':
|
|
 [${weekly['FORMAT']}]
|
|
%endif
|
|
</td>
|
|
<td class="comicnumber">${weekly['ISSUE']}</td>
|
|
%if weekly['AUTOWANT']:
|
|
<td class="status">Auto-Want</td>
|
|
%else:
|
|
<td class="status">${weekly['STATUS']}</td>
|
|
%endif
|
|
<td class="options">
|
|
%if weekly['HAVEIT'] == 'OneOff':
|
|
%if weekly['STATUS'] == 'Snatched' or weekly['STATUS'] == 'Downloaded':
|
|
<a href="#" onclick="doAjaxCall('queueit?ComicName=${weekly['COMIC'] | u}&ComicID=${weekly['COMICID']}&IssueID=${weekly['ISSUEID']}&ComicIssue=${weekly['ISSUE']}&mode=pullwant&Publisher=${weekly['PUBLISHER']}&pullinfo=${weekinfo['midweek']}&pullweek=${weekinfo['weeknumber']}&pullyear=${weekinfo['year']}',$(this),'table')" data-success="Successfully submitted search request for ${weekly['COMIC']} #${weekly['ISSUE']}" title="Snatch issue again as a One-Off">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/retry.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Retry
|
|
%endif
|
|
</a>
|
|
%endif
|
|
%if weekly['HASH'] is not None and mylar.CONFIG.AUTO_SNATCH is True:
|
|
<a href="#" onclick="doAjaxCall('torrentit?torrent_hash=${weekly['HASH']}&download=True',$(this),'table')" title="Auto-Snatch torrent file">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/snatch.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Auto-Snatch
|
|
%endif
|
|
</a>
|
|
%endif
|
|
%elif any([weekly['STATUS'] == 'Skipped', weekly['STATUS'] == 'Wanted']):
|
|
%if weekly['STATUS'] == 'Skipped':
|
|
%if weekly['COMICID'] != '' and weekly['COMICID'] is not None:
|
|
<a href="#" title="auto-add to Watchlist directly by ID available for this series" onclick="doAjaxCall('addbyid?comicid=${weekly['COMICID']}&calledby=True',$(this),'table')" data-success="${weekly['COMIC']} is now being added to your wachlist.">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/add.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Add
|
|
%endif
|
|
</a>
|
|
%else:
|
|
%if weekly['ISSUE'] == '1' or weekly['ISSUE'] == '0':
|
|
<a href="#" title="Watch for this series and auto-add to Watchlist when available" onclick="doAjaxCall('add2futurewatchlist?ComicName=${weekly['COMIC'] |u}&Issue=${weekly['ISSUE']}&Publisher=${weekly['PUBLISHER']}&ShipDate=${weekinfo['midweek']}&weeknumber=${weekinfo['weeknumber']}&year=${weekinfo['year']}',$(this),'table')" data-success="${weekly['COMIC']} is now on auto-watch/add.">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/watch.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Watch
|
|
%endif
|
|
</a>
|
|
%endif
|
|
<a href="searchit?name=${weekly['COMIC'] | u}&issue=${weekly['ISSUE']}&mode=pullseries" title="Search for this series to add to your watchlist">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/search_add.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Search
|
|
%endif
|
|
</a>
|
|
%endif
|
|
<% dl = True %>
|
|
%else:
|
|
<% dl = False %>
|
|
%endif
|
|
%if weekly['HAVEIT'] == 'No' and weekly['STATUS'] == 'Skipped':
|
|
<a href="#" onclick="doAjaxCall('queueit?ComicName=${weekly['COMIC'] | u}&ComicID=${weekly['COMICID']}&IssueID=${weekly['ISSUEID']}&ComicIssue=${weekly['ISSUE']}&mode=pullwant&Publisher=${weekly['PUBLISHER']}&pullinfo=${weekinfo['midweek']}&pullweek=${weekinfo['weeknumber']}&pullyear=${weekinfo['year']}',$(this),'table')" data-success="Successfully submitted search request for ${weekly['COMIC']} #${weekly['ISSUE']}" title="One off download">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/search.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>One-Off
|
|
%endif
|
|
</a>
|
|
%endif
|
|
<!--
|
|
<a class="menu_link_edit" id="choose_specific_download" title="Choose Specific Download" href="javascript:void(0)" onclick="getAvailableDownloads('${weekly['ISSUEID']}', '${weekly['COMIC']}', '${weekly['COMICID']}', '${weekly['ISSUE']}', '${weekly['VOLUME']}', 'pullwant', '${weekly['PUBLISHER']}', '${weekinfo['midweek']}', '${weekinfo['weeknumber']}', '${weekinfo['year']}', '${dl}')">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/magnifier.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Choose
|
|
%endif
|
|
</a>
|
|
<div id="choose_specific_download_dialog" title="Search & Choose a specific download for this issue" 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>
|
|
-->
|
|
%elif weekly['HASH'] is not None and mylar.CONFIG.AUTO_SNATCH is True:
|
|
<a href="#" onclick="doAjaxCall('torrentit?torrent_hash=${weekly['HASH']}&download=True',$(this),'table')" title="Auto-Snatch torrent file">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/snatch.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Auto-Snatch
|
|
%endif
|
|
</a>
|
|
%elif weekly['STATUS'] == 'Snatched':
|
|
<a href="#" onclick="doAjaxCall('queueit?ComicName=${weekly['COMIC'] | u}&ComicID=${weekly['COMICID']}&IssueID=${weekly['ISSUEID']}&ComicIssue=${weekly['ISSUE']}&mode=pullwant&Publisher=${weekly['PUBLISHER']}&pullinfo=${weekinfo['midweek']}&pullweek=${weekinfo['weeknumber']}&pullyear=${weekinfo['year']}',$(this),'table')" data-success="Successfully submitted search request for ${weekly['COMIC']} #${weekly['ISSUE']}" title="Snatch issue again">
|
|
%if mylar.CONFIG.SHOW_ICONS:
|
|
<img style="margin: 0px 5px" src="interfaces/default/images/retry.png" height="25" width="25" class="highqual" />
|
|
%else:
|
|
<span class="ui-icon ui-icon-plus"></span>Retry
|
|
%endif
|
|
</a>
|
|
%endif
|
|
</td>
|
|
%endif
|
|
</tr>
|
|
%endfor
|
|
</tbody>
|
|
</table>
|
|
</br><small><center>last updated: ${weekinfo['last_update']}</center></small>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="headIncludes()">
|
|
<meta name="referrer" content="no-referrer" />
|
|
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="js/libs/jquery.dataTables.min.js"></script>
|
|
<script type="text/javascript">
|
|
function addAction() {
|
|
$('#weekfolder').append('<input type="hidden" name="filename" value=True />');
|
|
};
|
|
|
|
$("#menu_link_scan").click(function() {
|
|
addAction();
|
|
$('#MassDownload').submit();
|
|
return true;
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
function getAvailableDownloads(issueid, comicname, comicid, issue, comicvolume, mode, publisher, pullinfo, pullweek, pullyear, dl) {
|
|
ShowSpinner();
|
|
$.getJSON("choose_specific_download", {issueid: issueid, comicname: comicname, comicid: comicid, issue: issue, comicvolume: comicvolume, mode: mode, publisher: publisher, pullinfo: pullinfo, pullweek: pullweek, pullyear: pullyear, action: dl}, function(data) {
|
|
loader.remove();
|
|
feedback.fadeOut();
|
|
search_results = data;
|
|
if(search_results !=null){
|
|
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']],
|
|
"olanguage": {
|
|
"emptyTable": "No search results found"},
|
|
"bFilter": false,
|
|
"bInfo": false,
|
|
"bPaginate": false,
|
|
"bDestroy": true
|
|
});
|
|
} else{
|
|
$('#downloads_table_body').append('<tr><td style="text-align:center;" colspan="3">No results returned</td></tr>');
|
|
}
|
|
$("#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() {
|
|
$("#weekfolder").click(function(){
|
|
if ($("#weekfolder").is(":checked"))
|
|
{
|
|
$("#MassDownload").submit();
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
$("#MassDownload").submit();
|
|
return true;
|
|
}
|
|
});
|
|
initActions();
|
|
$('#pull_table').dataTable (
|
|
{
|
|
"bDestroy": true,
|
|
//"aoColumnDefs": [
|
|
// { 'bSortable': false, 'aTargets': [ 2,3 ] }
|
|
//],
|
|
"aLengthMenu": [[10, 15, 25, 50, -1], [10, 15, 25, 50, 'All' ]],
|
|
"oLanguage": {
|
|
"sLengthMenu":"Show _MENU_ issues per page",
|
|
"sEmptyTable": "No issue information available",
|
|
"sInfo":"Showing _TOTAL_ issues",
|
|
"sInfoEmpty":"Showing 0 to 0 of 0 issues",
|
|
"sInfoFiltered":"(filtered from _MAX_ total issues)",
|
|
"sSearch": ""},
|
|
"bStateSave": true,
|
|
"iDisplayLength": 25,
|
|
"sPaginationType": "full_numbers",
|
|
"aaSorting": [[0, 'asc']]
|
|
});
|
|
resetFilters("weekly");
|
|
setTimeout(function(){
|
|
initFancybox();
|
|
},1500)
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
initThisPage();
|
|
});
|
|
</script>
|
|
</%def>
|