mirror of https://github.com/evilhero/mylar
459 lines
26 KiB
HTML
Executable File
459 lines
26 KiB
HTML
Executable File
<%inherit file="base.html"/>
|
|
<%!
|
|
import os
|
|
from mylar import db
|
|
import mylar
|
|
%>
|
|
|
|
<%def name="headerIncludes()">
|
|
<div id="subhead_container">
|
|
<div id="subhead_menu">
|
|
<a id="menu_link_refresh" onclick="doAjaxCall('refreshArtist?ComicID=${comic['ComicID']}', $(this)),'table'" href="#" data-success="'${comic['ComicName']}' is being refreshed">Refresh Comic</a>
|
|
<a id="menu_link_delete" href="deleteArtist?ComicID=${comic['ComicID']}">Delete Comic</a>
|
|
%if mylar.RENAME_FILES:
|
|
<a id="menu_link_refresh" onclick="doAjaxCall('manualRename?comicid=${comic['ComicID']}', $(this),'table')" data-success="Renaming files.">Rename Files</a>
|
|
%endif
|
|
<a id="menu_link_refresh" onclick="doAjaxCall('forceRescan?ComicID=${comic['ComicID']}', $(this)),'table'" href="#" data-success="'${comic['ComicName']}' is being refreshed">Recheck Files</a>
|
|
%if comic['Status'] == 'Paused':
|
|
<a id="menu_link_resume" href="#" onclick="doAjaxCall('resumeArtist?ComicID=${comic['ComicID']}',$(this),true)" data-success="${comic['ComicName']} resumed">Resume Comic</a>
|
|
%else:
|
|
<a id="menu_link_pauze" href="#" onclick="doAjaxCall('pauseArtist?ComicID=${comic['ComicID']}',$(this),true)" data-success="${comic['ComicName']} paused">Pause Comic</a>
|
|
%endif
|
|
|
|
</div>
|
|
</div>
|
|
</%def>
|
|
<%def name="body()">
|
|
|
|
<div id="paddingheader">
|
|
<h1>
|
|
%if comic['Status'] == 'Loading':
|
|
<img src="interfaces/default/images/loader_black.gif" alt="loading" style="float:left; margin-right: 5px;"/>
|
|
%endif
|
|
<div class="row">
|
|
|
|
<a href="http://comicvine.com/volume/49-${comic['ComicID']}" target="_blank">${comic['ComicName']} (${comic['ComicYear']})</a>
|
|
%if comic['Status'] == 'Loading':
|
|
<h3><i>(Comic information is currently being loaded)</i></h3>
|
|
%endif
|
|
</div>
|
|
</h1>
|
|
<div style="z-index:10; position: absolute; right: 0; top: 10;">
|
|
<a href="artistPage?ComicID=${series['Previous']}"><img src="interfaces/default/images/prev.gif" width="16" height="18" /></a>
|
|
<a href="artistPage?ComicID=${series['Next']}"><img src="interfaces/default/images/next.gif" width="16" height="18" /></a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="tabs">
|
|
<ul>
|
|
<li><a href="#tabs-1">Comic Details</a></li>
|
|
<li><a href="#tabs-2">Download settings</a></li>
|
|
<li><a href="#tabs-3">Edit Settings</a></li>
|
|
</ul>
|
|
<div id="tabs-1">
|
|
|
|
|
|
<table class="comictable" summary="Comic Details">
|
|
<tr>
|
|
<td id="mainimg">
|
|
<fieldset>
|
|
<div id="artistImg">
|
|
<img src="${comic['ComicImage']}" alt="" height="400" width="263" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
<td width="100%" padding="10">
|
|
%if comic['ComicPublisher'] == 'DC Comics':
|
|
<img src="interfaces/default/images/logo-dccomics.png" align="right" alt="DC" height="50" width="50" />
|
|
%elif comic['ComicPublisher'] == 'Marvel':
|
|
<img src="interfaces/default/images/logo-marvel.jpg" align="right" alt="Marvel" height="50" width="100"/>
|
|
%elif comic['ComicPublisher'] == 'Image':
|
|
<img src="interfaces/default/images/logo-imagecomics.gif" align="right" alt="Image" height="100" width="50" />
|
|
%elif comic['ComicPublisher'] == 'Dark Horse Comics':
|
|
<img src="interfaces/default/images/logo-darkhorse.jpg" align="right" alt="Darkhorse" height="75" width="50" />
|
|
%elif comic['ComicPublisher'] == 'IDW Publishing':
|
|
<img src="interfaces/default/images/logo-idwpublish.png" align="right" alt="IDW" height="50" width="100"/>
|
|
%endif
|
|
<fieldset>
|
|
<div>
|
|
<label><big>Publication Date: </big><norm>${comic['ComicPublished']}</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Publisher: </big><norm>${comic['ComicPublisher']}</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Status: </big><norm>${comic['Status']}</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Last Updated: </big>
|
|
%if comic['LastUpdated'] is None:
|
|
<norm>Never</norm>
|
|
%else:
|
|
<norm>${comic['LastUpdated']}</norm>
|
|
%endif
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<label><big>Issues in Series: </big><norm>${comic['Total']} issues
|
|
%if comic['not_updated_db'] > 0:
|
|
(${comic['not_updated_db']} issue not updated yet)
|
|
%endif
|
|
</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Directory</big><br/><norm>${comic['ComicLocation']}</norm></label>
|
|
</div> </fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="tabs-2">
|
|
<table class="comictable" summary="Download Settings">
|
|
<tr>
|
|
<td id="mainimg">
|
|
<fieldset>
|
|
<div id="artistImg">
|
|
<img src="${comic['ComicImage']}" alt="" height="400" width="263" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
<td width="100%" padding="10">
|
|
%if comic['ComicPublisher'] == 'DC Comics':
|
|
<img src="interfaces/default/images/logo-dccomics.png" align="right" alt="DC" height="50" width="50">
|
|
%elif comic['ComicPublisher'] == 'Marvel':
|
|
<img src="interfaces/default/images/logo-marvel.jpg" align="right" alt="Marvel" height="50" width="100">
|
|
%elif comic['ComicPublisher'] == 'Image':
|
|
<img src="interfaces/default/images/logo-imagecomics.gif" align="right" alt="Image" height="100" width="50"/>
|
|
%elif comic['ComicPublisher'] == 'Dark Horse Comics':
|
|
<img src="interfaces/default/images/logo-darkhorse.jpg" align="right" alt="Darkhorse" height="75" width="50"/>
|
|
%elif comic['ComicPublisher'] == 'IDW Publishing':
|
|
<img src="interfaces/default/images/logo-idwpublish.png" align="right" alt="IDW" height="50" width="100"/>
|
|
%endif
|
|
<fieldset>
|
|
<div>
|
|
<label><big>Alternate versions :</big><norm>${comic['ComicVersion']}</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Scanner :</big><norm>${comic['QUALscanner']}</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Type :</big><norm>${comic['QUALtype']}</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Quality :</big><norm>${comic['QUALquality']}</norm></label>
|
|
</div>
|
|
<div>
|
|
<label><big>Alternate Search Names :</big><norm>${comic['AlternateSearch']}</norm></label>
|
|
</div>
|
|
<%
|
|
if comic['UseFuzzy'] == "0" or comic['UseFuzzy'] is None:
|
|
fuzzy = "None"
|
|
fuzzy_year = "0"
|
|
elif comic['UseFuzzy'] == "1":
|
|
fuzzy = "Remove Year"
|
|
fuzzy_year = "1"
|
|
elif comic['UseFuzzy'] == "2":
|
|
fuzzy = "Fuzzy Year"
|
|
fuzzy_year = "2"
|
|
|
|
%>
|
|
|
|
<div>
|
|
<label><big>Fuzzy Year logic : </big><norm>${fuzzy} </norm></label>
|
|
</div>
|
|
|
|
</fieldset>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="tabs-3">
|
|
<table class="comictable" summary="Edit Settings">
|
|
<tr>
|
|
<td id="mainimg">
|
|
<fieldset>
|
|
<div class="row" id="artistImg">
|
|
<img src="${comic['ComicImage']}" alt="" height="400" width="263" />
|
|
</div>
|
|
</fieldset>
|
|
</td>
|
|
<td width="100%" padding="10">
|
|
%if comic['ComicPublisher'] == 'DC Comics':
|
|
<img src="interfaces/default/images/logo-dccomics.png" align="right" alt="DC" height="50" width="50"/>
|
|
%elif comic['ComicPublisher'] == 'Marvel':
|
|
<img src="interfaces/default/images/logo-marvel.jpg" align="right" alt="Marvel" height="50" width="100"/>
|
|
%elif comic['ComicPublisher'] == 'Image':
|
|
<img src="interfaces/default/images/logo-imagecomics.gif" align="right" alt="Image" height="100" width="50"/>
|
|
%elif comic['ComicPublisher'] == 'Dark Horse Comics':
|
|
<img src="interfaces/default/images/logo-darkhorse.jpg" align="right" alt="Darkhorse" height="75" width="50"/>
|
|
%elif comic['ComicPublisher'] == 'IDW Publishing':
|
|
<img src="interfaces/default/images/logo-idwpublish.png" align="right" alt="IDW" height="50" width="100"/>
|
|
%endif
|
|
|
|
<form action="comic_config" method="GET">
|
|
<input type="hidden" name="ComicID" value=${comic['ComicID']}>
|
|
<br/><br/><br/>
|
|
<fieldset>
|
|
<div>
|
|
<label>Directory Location</label>
|
|
<input type="text" name="com_location" value="${comic['ComicLocation']}" size="60"><br/>
|
|
<div class="row"><small>the directory where all the comics are located for this particular comic</small></div>
|
|
</div>
|
|
<div>
|
|
<label>Alternate Search Names</label>
|
|
<input type="text" name="alt_search" value="${comic['AlternateSearch']}" size="60"><br/>
|
|
<div class="row"><small>Alternate comic names to be searched in case naming is different (ie. Hack/Slash = hack-slash)</small></div>
|
|
<div>
|
|
<label>Version Number</label>
|
|
<input type="text" name="comic_version" value="${comic['ComicVersion']}" size="20"><br/>
|
|
</div>
|
|
</div>
|
|
<label>Year Options</label>
|
|
<div class="row radio left clearfix">
|
|
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="0" ${comicConfig['fuzzy_year0']} /><label>Keep the Year as is<small>Default</small></label>
|
|
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="1" ${comicConfig['fuzzy_year1']} /><label>Year Removal<small>Remove issue publication year from searches (dangerous)</small></label>
|
|
<input type="radio" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="fuzzy_year" value="2" ${comicConfig['fuzzy_year2']} /><label>Fuzzy the Year<small>Increase & Decrease the issue publication year by one</small></label>
|
|
</div>
|
|
<input type="submit" value="Update"/>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div id="checkboxControls" style="float: right; vertical-align: middle; margin: 3px; margin-top: -1px;">
|
|
<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="Archived" class="checkbox inline Archived"><input type="checkbox" id="Archived" checked="checked" /> Archived: <b>${isCounts['Archived']}</b></label>
|
|
<label for="Downloaded" class="checkbox inline Downloaded"><input type="checkbox" id="Downloaded" checked="checked" /> Downloaded: <b>${isCounts['Downloaded']}</b></label>
|
|
<label for="Skipped" class="checkbox inline Skipped"><input type="checkbox" id="Skipped" checked="checked" /> Skipped: <b>${isCounts['Skipped']}</b></label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table_wrapper">
|
|
<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="Wanted">Wanted</option>
|
|
<option value="Skipped">Skipped</option>
|
|
<option value="Downloaded">Downloaded</option>
|
|
<option value="Archived">Archived</option>
|
|
</select>
|
|
selected issues
|
|
<input type="hidden" value="Go">
|
|
<input type="checkbox" name="skipped2wanted" onclick="doAjaxCall('skipped2wanted?comicid=${comic['ComicID']}',$(this),'table')" value="1" data-success="Skipped Issues Changed to Wanted" style="float: right; vertical-align: middle; margin: 3px; margin-top: -1px;" /><label style="float: right; vertical-align: middle; margin: 3px; margin-top: -1px;">Change All Skipped to Wanted </label>
|
|
</div>
|
|
|
|
<table class="display" id="issue_table">
|
|
<thead>
|
|
<tr>
|
|
<th id="select" align="left"><input type="checkbox" onClick="toggle(this)" class="checkbox" /></th>
|
|
<th id="issuenumber">Number</th>
|
|
<th id="issuename">Name</th>
|
|
<th id="reldate">Date</th>
|
|
<th id="status">Status</th>
|
|
<th id="options">Options</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
%for issue in issues:
|
|
<%
|
|
if issue['Status'] == 'Skipped':
|
|
grade = 'Z'
|
|
elif issue['Status'] == 'Wanted':
|
|
grade = 'X'
|
|
elif issue['Status'] == 'Snatched':
|
|
grade = 'C'
|
|
elif issue['Status'] == 'Downloaded':
|
|
grade = 'A'
|
|
elif issue['Status'] == 'Archived':
|
|
grade = 'A'
|
|
else:
|
|
grade = 'A'
|
|
%>
|
|
<tr class="${issue['Status']} grade${grade}">
|
|
|
|
<td id="select"><input type="checkbox" name="${issue['IssueID']}" class="checkbox" value="${issue['IssueID']}"/></td>
|
|
<td id="issuenumber">${issue['Issue_Number']}</td>
|
|
<td id="issuename">${issue['IssueName']}</td>
|
|
<td id="reldate">${issue['IssueDate']}</td>
|
|
<td id="status">${issue['Status']}
|
|
%if issue['Status'] == 'Downloaded' or issue['Status'] == 'Archived':
|
|
<%Csize = mylar.helpers.human_size(issue['ComicSize'])%>
|
|
<a href="#" title="${issue['Location']} (${Csize})"><img src="interfaces/default/images/info32.png" height="16" alt="" /></a>
|
|
%endif
|
|
</td>
|
|
<td id="options">
|
|
%if issue['Status'] == 'Skipped':
|
|
<a href="#" title="Mark issue as Wanted" onclick="doAjaxCall('queueissue?ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&ComicYear=${issue['IssueDate']}&mode=want',$(this),'table')"><img src="interfaces/default/images/wanted_icon.png" height="25" width="25" /></a>
|
|
%elif (issue['Status'] == 'Wanted'):
|
|
<a href="#" title="Mark issue as Skipped" onclick="doAjaxCall('unqueueissue?IssueID=${issue['IssueID']}&ComicID=${issue['ComicID']}',$(this),'table')" data-success="'${issue['Issue_Number']}' has been marked as skipped"><img src="interfaces/default/images/skipped_icon.png" height="25" width="25" /></a>
|
|
%elif (issue['Status'] == 'Snatched'):
|
|
<a href="#" onclick="doAjaxCall('queueissue?ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&mode=want', $(this),'table')" data-success="Retrying the same version of '${issue['ComicName']}' '${issue['Issue_Number']}'" title="Retry the same download again"><img src="interfaces/default/images/retry_icon.png" height="25" width="25" /></a>
|
|
<a href="#" title="Mark issue as Skipped" onclick="doAjaxCall('unqueueissue?IssueID=${issue['IssueID']}&ComicID=${issue['ComicID']}',$(this),'table')" data-success="'${issue['Issue_Number']}' has been marked as skipped"><img src="interfaces/default/images/skipped_icon.png" height="25" width="25" /></a>
|
|
%elif (issue['Status'] == 'Downloaded'):
|
|
|
|
%if issue['inCacheDIR']:
|
|
<%
|
|
try:
|
|
with open(os.path.join(mylar.CACHE_DIR,issue['Location'])) as f:
|
|
linky = issue['Location']
|
|
except IOError as e:
|
|
linky = None
|
|
|
|
%>
|
|
%if linky:
|
|
<a href="cache/${linky}"><img src="interfaces/default/images/download_icon.png" height="25" width="25" title="Download the Issue" /></a>
|
|
%endif
|
|
%else:
|
|
<a onclick="doAjaxCall('downloadLocal?IssueID=${issue['IssueID']}', $(this), 'table')" ><img src="interfaces/default/images/copy_icon.png" height="25" width="25" title="Copy issue to local cache (ready for download)" /></a>
|
|
%endif
|
|
%elif (issue['Status'] == 'Read'):
|
|
<a href="#" title="Add to Reading List" onclick="doAjaxCall('addtoreadlist?IssueID=${issue['IssueID']}',$(this),'table')" data-success="${issue['Issue_Number']} added to Reading List"><img src="interfaces/default/images/glasses-icon.png" height="25" width="25" /></a>
|
|
%else:
|
|
<a href="#" onclick="doAjaxCall('queueissue?ComicID=${issue['ComicID']}&IssueID=${issue['IssueID']}&ComicIssue=${issue['Issue_Number']}&mode=want', $(this),'table')" data-success="Retrying the same version of '${issue['ComicName']}' '${issue['Issue_Number']}'" title="Retry the same download again"><img src="interfaces/default/images/retry_icon.png" height="25" width="25" /></a>
|
|
<a href="#" title="Mark issue as Skipped" onclick="doAjaxCall('unqueueissue?IssueID=${issue['IssueID']}&ComicID=${issue['ComicID']}',$(this),'table')" data-success="'${issue['Issue_Number']}' has been marked as skipped"><img src="interfaces/default/images/skipped_icon.png" height="25" width="25" /></a>
|
|
%endif
|
|
<a href="#" onclick="doAjaxCall('archiveissue?IssueID=${issue['IssueID']}',$(this),'table')"><img src="interfaces/default/images/archive_icon.png" height="25" width="25" title="Mark issue as Archived"></a>
|
|
</td>
|
|
</tr>
|
|
%endfor
|
|
</tbody>
|
|
</table>
|
|
%if annuals:
|
|
<table class="display" id="issue_table">
|
|
<thead>
|
|
<tr>
|
|
<th id="select" align="left"><input type="checkbox" onClick="toggle(this)" class="checkbox" /></th>
|
|
<th id="issuenumber">Number</th>
|
|
<th id="issuename">Name</th>
|
|
<th id="reldate">Date</th>
|
|
<th id="status">Status</th>
|
|
<th id="options">Options</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
%for annual in annuals:
|
|
<tr>
|
|
<td id="select"><input type="checkbox" name="${annual['IssueID']}" class="checkbox" value="${annual['IssueID']}"/></td>
|
|
<td id="issuenumber">${annual['Issue_Number']}</td>
|
|
<td id="issuename">${annual['IssueName']}</td>
|
|
<td id="reldate">${annual['IssueDate']}</td>
|
|
<td id="status">${annual['Status']}</td>
|
|
<td id="options"></td>
|
|
</tr>
|
|
%endfor
|
|
</tbody>
|
|
</table>
|
|
%endif
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="headIncludes()">
|
|
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
|
|
|
|
%if comic['Status'] == 'Loading':
|
|
<meta http-equiv="refresh" content="60">
|
|
%endif
|
|
</%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();
|
|
}
|
|
});
|
|
}
|
|
|
|
hideServerDivs = function () {
|
|
$("#customoptions").slideUp();
|
|
$("#hpserveroptions").slideUp();
|
|
};
|
|
|
|
handleNewSelection = function () {
|
|
|
|
hideServerDivs();
|
|
|
|
switch ($(this).val()) {
|
|
case 'custom':
|
|
$("#customoptions").slideDown();
|
|
break;
|
|
case 'mylar':
|
|
$("#hpserveroptions").slideDown();
|
|
break;
|
|
}
|
|
};
|
|
|
|
function initThisPage(){
|
|
|
|
$(function() {
|
|
$( "#tabs" ).tabs();
|
|
});
|
|
initActions();
|
|
|
|
$('#issue_table').dataTable(
|
|
{
|
|
"bDestroy": true,
|
|
"aoColumnDefs": [
|
|
{ 'bSortable': false, 'aTargets': [ 0, 2 ] }
|
|
],
|
|
"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": ""},
|
|
"iDisplayLength": 25,
|
|
"sPaginationType": "full_numbers",
|
|
"aaSorting": [[1, 'desc'],[3,'desc']]
|
|
});
|
|
resetFilters("issues");
|
|
setTimeout(function(){
|
|
initFancybox();
|
|
},1500)
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
initThisPage();
|
|
});
|
|
</script>
|
|
</%def>
|