<%inherit file="base.html"/> <%! from mylar import helpers, db %> <%def name="body()">
%for comic in comics: <% 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 = '?' try: percent = (havetracks*100.0)/totaltracks if percent > 100: percent = 100 except (ZeroDivisionError, TypeError): percent = 0 totaltracks = '?' if comic['Status'] == 'Paused': grade = 'X' elif comic['Status'] == 'Loading': grade = 'L' elif comic['Status'] == 'Error': grade = 'Z' else: grade = 'A' %> %endfor
Publisher Comic Year Last Issue Published Have Status Active
${comic['ComicPublisher']} ${comic['ComicName']} ${comic['ComicYear']} # ${comic['LatestIssue']} ${comic['LatestDate']}
${havetracks}/${totaltracks}
%if comic['ComicPublished'] is None or comic['ComicPublished'] == '': Unknown %elif 'present' in comic['ComicPublished'].lower(): Continuing %else: Ended %endif %if comic['Status'] == "Active": Y %else: N %endif
<%def name="headIncludes()"> <%def name="javascriptIncludes()">