mylar/data/interfaces/default/importresults.html

163 lines
8.9 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 id="menu_link_refresh" onclick="doAjaxCall('flushImports', $(this),'table')" data-success="Import Results Flushed">Flush all Imports</a>
</div>
</div>
</%def>
<%def name="body()">
<div id="paddingheader">
<h1 class="clearfix">Ultron Import Results</h1>
</div>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Import Results</a></li>
</ul>
<div id="tabs-1" class="configtable">
<table>
<tr>
<span style="position:right">
<img src="interfaces/default/images/ultron.png" style="float:right" height="125" width="125" />
<fieldset>
<div class="row checkbox">
<input type="checkbox" name="autoadd" style="vertical-align: middle; margin: 3px; margin-top: -1px;" id="autoadd" value="1" ${checked(mylar.ADD_COMICS)}><label>Auto-add new series</label>
</div>
<div class="row checkbox">
<input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="imp_move" id="imp_move" value="1" ${checked(mylar.IMP_MOVE)}><label>Move files</label>
</div>
%if mylar.RENAME_FILES:
<div class="row checkbox">
<input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="imp_rename" id="imp_rename" value="1" ${checked(mylar.IMP_RENAME)}><label>Rename Files </label>
<small>(After importing, Rename the files to configuration settings)</small>
<label>${mylar.FOLDER_FORMAT}/${mylar.FILE_FORMAT}</label>
</div>
%endif
<div class="row checkbox">
<input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="imp_metadata" id="imp_metadata" value="1" ${checked(mylar.IMP_METADATA)}><label>Use Existing Metadata</label>
<small>(Use existing Metadata to better locate series for import)</small>
</div>
</fieldset>
</span>
</tr>
</table>
</div>
<form action="markImports" method="get" id="markImports">
<div id="markcomic">
<select name="action" onChange="doAjaxCall('markImports',$(this),'table',true);" data-error="You didn't select any comics">
<option disabled="disabled" selected="selected">Choose...</option>
<option value="massimport">Start Import</option>
<option value="removeimport">Remove</option>
</select>
<input type="hidden" value="Go">
</div>
<table class="display" id="impresults_table">
<tr/><tr/>
<tr><center><h3>To be Imported</h3></center></tr>
<thead>
<tr>
<th id="select"></th>
<th id="comicname">Comic Name</th>
<th id="comicyear">Year</th>
<th id="issues">Issues</th>
<th id="status">Status</th>
<th id="importdate">Import Date</th>
<th id="addcomic">Options</th>
</tr>
</thead>
<tbody>
%if results:
%for result in results:
<%
if result['DisplayName'] is None:
displayname = result['ComicName']
else:
displayname = result['DisplayName']
endif
%>
<tr>
<td id="select"><input type="checkbox" style="vertical-align: middle; margin: 3px; margin-top: -1px;" name="${result['ComicName']}" value="${result['ComicName']}" class="checkbox" />
<td id="comicname">${displayname}</td>
<td id="comicyear"><title="${result['ComicYear']}">${result['ComicYear']}</td>
<td id="comicissues"><title="${result['IssueCount']}">${result['IssueCount']}</td>
<td id="status">
%if result['ComicID']:
<a href="comicDetails?ComicID=${result['ComicID']}">${result['Status']}</a>
%else:
${result['Status']}
%endif
%if result['WatchMatch'] is not None:
<img src="interfaces/default/images/green-circle.png" height="10" width="10"/>
%endif
</td>
<td id="importdate">${result['ImportDate']}</td>
<td id="addcomic">
%if result['Status'] == 'Not Imported':
[<a href="#" title="Import ${result['ComicName']} into your watchlist" onclick="doAjaxCall('preSearchit?ComicName=${result['ComicName']| u}&displaycomic=${displayname}| u}',$(this),'table')" data-success="Imported ${result['ComicName']}">Import</a>]
%endif
[<a href="deleteimport?ComicName=${result['ComicName']}">Remove</a>]
%if result['implog'] is not None:
[<a class="showlog" title="Display the Import log for ${result['ComicName']}" href="importLog?ComicName=${result['ComicName'] |u}&SRID=${result['SRID']}">Log</a>]
%endif
%if result['SRID'] is not None and result['Status'] != 'Imported':
[<a title="Manual intervention is required - more than one result when attempting to import" href="importresults_popup?SRID=${result['SRID']}&ComicName=${result['ComicName'] |u}&imported=yes&ogcname=${result['ComicName'] |u}">Select</a>]
%endif
</td>
</tr>
%endfor
%else:
<tr>
<td colspan="6">
<center><legend>There are no results to display</legend></center>
</td>
</tr>
%endif
</tbody>
</table>
</form>
</div>
</%def>
<%def name="javascriptIncludes()">
<script type="text/javascript">
$('.showlog').click(function (event) {
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
url = this.href,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(url, 'twitte', opts);
return false;
});
</script>
<script>
function initThisPage() {
jQuery( "#tabs" ).tabs();
initActions();
};
$(document).ready(function() {
initThisPage();
});
</script>
</%def>