2012-09-13 15:27:34 +00:00
|
|
|
<%inherit file="base.html"/>
|
|
|
|
<%!
|
2013-01-23 09:43:21 +00:00
|
|
|
from mylar import helpers, db
|
2012-09-13 15:27:34 +00:00
|
|
|
%>
|
|
|
|
|
|
|
|
<%def name="body()">
|
2013-01-23 09:43:21 +00:00
|
|
|
<div class="table_wrapper">
|
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
<table class="display" id="artist_table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th id="publisher">Publisher</th>
|
|
|
|
<th id="name">Comic</th>
|
|
|
|
<th id="year">Year</th>
|
|
|
|
<th id="status">Status</th>
|
|
|
|
<th id="issue">Latest Issue</th>
|
|
|
|
<th id="have">Have</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
%for comic in comics:
|
|
|
|
<%
|
2013-01-23 09:43:21 +00:00
|
|
|
myDB = db.DBConnection()
|
|
|
|
issue = myDB.select("SELECT * FROM issues WHERE ComicID=?", [comic['ComicID']])
|
|
|
|
wantedc = myDB.action("SELECT COUNT(*) as count FROM issues WHERE ComicID=? AND Status='Wanted'", [comic['ComicID']]).fetchone()
|
|
|
|
archedc = myDB.action("SELECT COUNT(*) as count FROM issues WHERE ComicID=? AND Status='Archived'", [comic['ComicID']]).fetchone()
|
|
|
|
totaltracks = comic['Total']
|
|
|
|
havetracks = comic['Have']
|
|
|
|
wants = wantedc[0]
|
|
|
|
arcs = archedc[0]
|
|
|
|
if not havetracks:
|
|
|
|
havetracks = 0
|
|
|
|
if not wants:
|
|
|
|
wants = 0
|
|
|
|
if not arcs:
|
|
|
|
arcs = 0
|
|
|
|
try:
|
|
|
|
wantpercent = (wants*100.0)/totaltracks
|
|
|
|
if wantpercent > 100:
|
|
|
|
wantpercent = 100
|
|
|
|
except (ZeroDivisionError, TypeError):
|
|
|
|
wantpercent = 0
|
|
|
|
wants = '?'
|
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
try:
|
|
|
|
percent = (havetracks*100.0)/totaltracks
|
|
|
|
if percent > 100:
|
|
|
|
percent = 100
|
|
|
|
except (ZeroDivisionError, TypeError):
|
|
|
|
percent = 0
|
|
|
|
totaltracks = '?'
|
|
|
|
|
2012-09-17 05:12:40 +00:00
|
|
|
|
2012-09-13 15:27:34 +00:00
|
|
|
if comic['Status'] == 'Paused':
|
|
|
|
grade = 'X'
|
2012-09-17 05:12:40 +00:00
|
|
|
elif comic['Status'] == 'Loading':
|
2013-01-23 09:43:21 +00:00
|
|
|
grade = 'L'
|
2012-09-17 05:12:40 +00:00
|
|
|
elif comic['Status'] == 'Error':
|
|
|
|
grade = 'Z'
|
2012-09-13 15:27:34 +00:00
|
|
|
else:
|
|
|
|
grade = 'A'
|
|
|
|
|
|
|
|
%>
|
|
|
|
<tr class="grade${grade}">
|
|
|
|
<td id="publisher">${comic['ComicPublisher']}</td>
|
|
|
|
<td id="name"><span title="${comic['ComicSortName']}"></span><a href="artistPage?ComicID=${comic['ComicID']}">${comic['ComicName']}</a></td>
|
|
|
|
<td id="year"><span title="${comic['ComicYear']}"></span>${comic['ComicYear']}</td>
|
|
|
|
<td id="status">${comic['Status']}</td>
|
|
|
|
<td id="issue"><span title="${comic['LatestIssue']}"></span># ${comic['LatestIssue']} (${comic['LatestDate']})</td>
|
2013-01-23 09:43:21 +00:00
|
|
|
<td id="have"><span title="${percent}"></span><div class="progress-container"><div style="background-color:#a3e532; height:14px; width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
|
2012-09-13 15:27:34 +00:00
|
|
|
%endfor
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2013-01-23 09:43:21 +00:00
|
|
|
</div>
|
2012-09-13 15:27:34 +00:00
|
|
|
</%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>
|
|
|
|
|
2013-01-23 09:43:21 +00:00
|
|
|
function initThisPage() {
|
|
|
|
$('#artist_table').dataTable(
|
|
|
|
{
|
|
|
|
"bDestroy": true,
|
|
|
|
"aoColumnDefs": [
|
|
|
|
{ 'bSortable': false, 'aTargets': [ 4 ] }
|
|
|
|
],
|
|
|
|
"oLanguage": {
|
|
|
|
"sLengthMenu":"Show _MENU_ results per page",
|
|
|
|
"sEmptyTable": "No results",
|
|
|
|
"sInfo":"Showing _START_ to _END_ of _TOTAL_ results",
|
|
|
|
"sInfoEmpty":"Showing 0 to 0 of 0 results",
|
|
|
|
"sInfoFiltered":"(filtered from _MAX_ total results)",
|
|
|
|
"sSearch" : ""},
|
2013-01-23 09:50:33 +00:00
|
|
|
"bStateSave": true,
|
2013-01-23 09:43:21 +00:00
|
|
|
"iDisplayLength": 15,
|
|
|
|
"sPaginationType": "full_numbers",
|
|
|
|
"aaSorting": []
|
|
|
|
});
|
|
|
|
resetFilters("comic");
|
2012-09-13 15:27:34 +00:00
|
|
|
}
|
|
|
|
|
2013-01-23 09:43:21 +00:00
|
|
|
$(document).ready(function(){
|
|
|
|
initThisPage();
|
2012-09-13 15:27:34 +00:00
|
|
|
});
|
|
|
|
$(window).load(function(){
|
|
|
|
initFancybox();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</%def>
|