mylar/data/interfaces/default/index.html

202 lines
9.7 KiB
HTML
Executable File

<%inherit file="base.html"/>
<%!
from mylar import helpers, db
import datetime
import decimal
%>
<%def name="body()">
<div class="table_wrapper">
<table class="display" id="series_table">
<thead>
<tr>
<th id="publisher">Publisher</th>
<th id="name">Comic</th>
<th id="year">Year</th>
<th id="issue">Last Issue</th>
<th id="published">Published</th>
<th class="hidden" id="havepercent">Have %</th>
<th id="have">Have</th>
<th class="hidden" id="totalcount">Total</th>
<th id="status">Status</th>
<th id="active">Active</th>
<th class="hidden" id="activestatus">ActiveSt</th>
</tr>
</thead>
<tbody>
%for comic in comics:
<%
if comic['percent'] == 101:
css = '<div class=\"progress-container warning\">'
if comic['percent'] == 100:
css = '<div class=\"progress-container complete\">'
if comic['percent'] < 100:
css = '<div class=\"progress-container missing\">'
if any([comic['haveissues'] == 'None', comic['haveissues'] is None]):
hissues = 0
else:
hissues = comic['haveissues']
if any([comic['totalissues'] == 'None', comic['totalissues'] is None]):
tissues = 0
else:
tissues = comic['totalissues']
comic_percent = comic['percent']
if comic['Status'] == 'Paused':
grade = 'T'
elif comic['Status'] == 'Loading':
grade = 'L'
elif comic['Status'] == 'Error':
grade = 'X'
else:
grade = 'A'
comicpub = comic['ComicPublisher']
try:
if len(comic['ComicPublisher']) > 15:
comicpub = comic['ComicPublisher'][:15] + '...'
except:
pass
comicname = comic['ComicSortName']
try:
if len(comic['ComicSortName']) > 55:
comicname = comic['ComicSortName'][:55] + '...'
except:
pass
comicline = comicname
comictype = comic['Type']
try:
if (any([comictype == 'None', comictype is None, comictype == 'Print']) and comic['Corrected_Type'] != 'TPB') or all([comic['Corrected_Type'] is not None, comic['Corrected_Type'] == 'Print']):
comictype = None
else:
if comic['Corrected_Type'] is not None:
comictype = comic['Corrected_Type']
else:
comictype = comictype
except:
comictype = None
if comictype is not None:
comicline += ' [%s]' % (comictype)
%>
<tr class="grade${grade}">
<td id="publisher"><span title="${comicpub}"></span>${comicpub}</td>
<td id="name"><span title="${comicname}"></span><a title="${comic['ComicName']}" href="comicDetails?ComicID=${comic['ComicID']}">${comicline}</a></td>
<td id="year"><span title="${comic['ComicYear']}"></span>${comic['ComicYear']}</td>
<td id="issue"><span title="${comic['LatestIssue']}"></span># ${comic['LatestIssue']}</td>
<td id="published">${comic['LatestDate']}</td>
<td class="hidden" id="havepercent">${comic_percent}</td>
<td id="have"><span title="${comic['percent']}"></span>${css}<div style="width:${comic['percent']}%"><span class="progressbar-front-text">${comic['haveissues']}/${comic['totalissues']}</span></div></td>
<td class="hidden" id="totalcount">${comic['totalissues']}</td>
<td id="status">${comic['recentstatus']}</td>
<td id="active" align="center">
%if comic['Status'] == "Active":
<img src="interfaces/default/images/checkmark.png" alt="Y" width="16" height="16" />
%elif comic['Status'] == 'Paused':
<img src="interfaces/default/images/pause-icon.png" alt="Paused" width="16" height="16" />
%elif comic['Status'] == 'Loading':
<img src="interfaces/default/images/hourglass.png" alt="Loading" width="16" height="16" />
%else:
<img src="interfaces/default/images/cross.png" alt="N" width="16" height="16" />
%endif
</td>
<td class="hidden" id="activestatus">${comic['Status']}</td>
</tr>
%endfor
</tbody>
</table>
</div>
</%def>
<%def name="headIncludes()">
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
<link rel="stylesheet" href="css/alphabetSearch.css">
</%def>
<%def name="javascriptIncludes()">
<script src="js/libs/jquery.dataTables.min.js"></script>
<script src="js/libs/full_numbers_no_ellipses.js"></script>
<script src="js/alphabetSearch.js"></script>
<script>
function initThisPage() {
$.fn.DataTable.ext.pager.numbers_length = 3;
var alphaindex = "${alphaindex}";
if (alphaindex == "True") {
var table = $('#series_table').dataTable( {
"destroy": true,
"sDom": '<"clear"Af><"clear"lp><"clear">rt<"clear"ip>',
"columnDefs": [
{ "orderable": false, "targets": [5, 7, 10] },
{ "visible": false, "targets": [5, 7, 10] },
{ "type": 'num', "targets": 5 },
{ "type": 'num', "targets": 7 },
{ "orderData": [ 5, 7 ], "targets": 6 },
{ "orderData": 10, "targets": 9 },
{ "order": [[7, 'asc'],[1, 'asc']] }
],
"lengthMenu": [[10, 15, 25, 50, 100, 200, -1], [10, 15, 25, 50, 100, 200, 'All' ]],
"language": {
"lengthMenu":"Show _MENU_ results per page",
"emptyTable": "No results",
"info":"Showing _START_ to _END_ of _TOTAL_ results",
"infoEmpty":"Showing 0 to 0 of 0 results",
"infoFiltered":"(filtered from _MAX_ total results)",
"search" : ""
},
"stateSave": true,
"stateDuration": 0,
"pageLength": 25,
"pagingType": "simple_numbers",
alphabetSearch: { column:1 }
});
} else {
var table = $('#series_table').dataTable( {
"destroy": true,
"sDom": '<"clear"f><"clear"lp><"clear">rt<"clear"ip>',
"columnDefs": [
{ "orderable": false, "targets": [5, 7, 10] },
{ "visible": false, "targets": [5, 7, 10] },
{ "type": 'num', "targets": 5 },
{ "type": 'num', "targets": 7 },
{ "orderData": [ 5, 7 ], "targets": 6 },
{ "orderData": 10, "targets": 9 },
{ "order": [[7, 'asc'],[1, 'asc']] }
],
"lengthMenu": [[10, 15, 25, 50, 100, 200, -1], [10, 15, 25, 50, 100, 200, 'All' ]],
"language": {
"lengthMenu":"Show _MENU_ results per page",
"emptyTable": "No results",
"info":"Showing _START_ to _END_ of _TOTAL_ results",
"infoEmpty":"Showing 0 to 0 of 0 results",
"infoFiltered":"(filtered from _MAX_ total results)",
"search" : ""
},
"stateSave": true,
"stateDuration": 0,
"pageLength": 25,
"pagingType": "simple_numbers",
alphabetSearch: { column: 1 }
});
}
resetFilters("comic");
}
$(document).ready(function(){
initThisPage();
});
$(window).load(function(){
initFancybox();
});
</script>
</%def>