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
|
2013-05-09 02:22:47 +00:00
|
|
|
import datetime
|
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>
|
2013-02-17 10:31:18 +00:00
|
|
|
<th id="issue">Last Issue</th>
|
|
|
|
<th id="published">Published</th>
|
2012-09-13 15:27:34 +00:00
|
|
|
<th id="have">Have</th>
|
2013-02-06 19:55:23 +00:00
|
|
|
<th id="status">Status</th>
|
|
|
|
<th id="status">Active</th>
|
2012-09-13 15:27:34 +00:00
|
|
|
</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()
|
2013-09-08 04:49:09 +00:00
|
|
|
anwantedc = myDB.action("SELECT COUNT(*) as count FROM annuals WHERE ComicID=? AND Status='Wanted'", [comic['ComicID']]).fetchone()
|
|
|
|
annual = myDB.action("SELECT COUNT(*) as count FROM annuals WHERE ComicID=?", [comic['ComicID']]).fetchone()
|
2013-01-23 09:43:21 +00:00
|
|
|
archedc = myDB.action("SELECT COUNT(*) as count FROM issues WHERE ComicID=? AND Status='Archived'", [comic['ComicID']]).fetchone()
|
2013-09-08 04:49:09 +00:00
|
|
|
annualcount = annual[0]
|
|
|
|
if not annualcount:
|
|
|
|
annualcount = 0
|
|
|
|
totaltracks = comic['Total'] + annualcount
|
2013-01-23 09:43:21 +00:00
|
|
|
havetracks = comic['Have']
|
|
|
|
wants = wantedc[0]
|
2013-09-08 04:49:09 +00:00
|
|
|
anns = anwantedc[0]
|
2013-01-23 09:43:21 +00:00
|
|
|
arcs = archedc[0]
|
|
|
|
if not havetracks:
|
|
|
|
havetracks = 0
|
|
|
|
if not wants:
|
|
|
|
wants = 0
|
2013-09-08 04:49:09 +00:00
|
|
|
if not anns:
|
|
|
|
anns = 0
|
2013-01-23 09:43:21 +00:00
|
|
|
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':
|
2013-03-14 08:33:16 +00:00
|
|
|
grade = 'X'
|
2012-09-13 15:27:34 +00:00
|
|
|
else:
|
|
|
|
grade = 'A'
|
|
|
|
|
|
|
|
%>
|
|
|
|
<tr class="grade${grade}">
|
|
|
|
<td id="publisher">${comic['ComicPublisher']}</td>
|
2013-07-10 01:45:10 +00:00
|
|
|
<td id="name"><span title="${comic['ComicSortName']}"></span><a href="comicDetails?ComicID=${comic['ComicID']}">${comic['ComicName']}</a></td>
|
2012-09-13 15:27:34 +00:00
|
|
|
<td id="year"><span title="${comic['ComicYear']}"></span>${comic['ComicYear']}</td>
|
2013-02-17 10:31:18 +00:00
|
|
|
<td id="issue"><span title="${comic['LatestIssue']}"></span># ${comic['LatestIssue']}</td>
|
|
|
|
<td id="published">${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>
|
2013-02-06 19:55:23 +00:00
|
|
|
<td id="status">
|
2013-02-27 08:28:40 +00:00
|
|
|
%if comic['ComicPublished'] is None or comic['ComicPublished'] == '':
|
|
|
|
Unknown
|
2013-09-08 04:49:09 +00:00
|
|
|
%elif comic['ForceContinuing'] == 1:
|
|
|
|
Continuing
|
2013-03-11 17:25:45 +00:00
|
|
|
%elif 'present' in comic['ComicPublished'].lower() or ( helpers.today()[:4] in comic['LatestDate']):
|
2013-05-09 02:22:47 +00:00
|
|
|
<%
|
|
|
|
latestdate = comic['LatestDate']
|
|
|
|
c_date = datetime.date(int(latestdate[:4]),int(latestdate[5:7]),1)
|
|
|
|
n_date = datetime.date.today()
|
|
|
|
recentchk = (n_date - c_date).days
|
2013-07-01 05:19:15 +00:00
|
|
|
if recentchk < 55:
|
2013-05-09 02:22:47 +00:00
|
|
|
recentstatus = 'Continuing'
|
|
|
|
else:
|
|
|
|
recentstatus = 'Ended'
|
|
|
|
%>
|
|
|
|
${recentstatus}
|
2013-02-06 19:55:23 +00:00
|
|
|
%else:
|
|
|
|
Ended
|
|
|
|
%endif
|
|
|
|
</td>
|
|
|
|
<td id="active" align="center">
|
|
|
|
%if comic['Status'] == "Active":
|
2013-03-14 08:33:16 +00:00
|
|
|
<img src="/interfaces/default/images/checkmark.png" alt="Y" width="16" height="16" />
|
2013-02-06 19:55:23 +00:00
|
|
|
%else:
|
2013-03-14 08:33:16 +00:00
|
|
|
<img src="/interfaces/default/images/cross.png" alt="N" width="16" height="16" />
|
2013-02-06 19:55:23 +00:00
|
|
|
%endif
|
|
|
|
</td>
|
2013-01-27 10:07:08 +00:00
|
|
|
</tr>
|
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": [
|
2013-02-17 10:31:18 +00:00
|
|
|
{ 'bSortable': false, 'aTargets': [ 5 ] }
|
2013-01-23 09:43:21 +00:00
|
|
|
],
|
2013-04-14 02:55:00 +00:00
|
|
|
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, 'All' ]],
|
2013-01-23 09:43:21 +00:00
|
|
|
"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-27 10:07:08 +00:00
|
|
|
"iDisplayLength": 25,
|
2013-01-23 09:43:21 +00:00
|
|
|
"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>
|