mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-20 19:59:26 +00:00
54 lines
1.4 KiB
HTML
54 lines
1.4 KiB
HTML
<%
|
|
from headphones import helpers
|
|
%>
|
|
<%inherit file="base.html"/>
|
|
|
|
<%def name="body()">
|
|
<table class="display" id="artist_table">
|
|
<thead>
|
|
<tr>
|
|
<th id="name">Artist Name</th>
|
|
<th id="album">Latest Album</th>
|
|
<th id="reldate">Release Date</th>
|
|
<th id="have">Have</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
%for artist in artists:
|
|
<%
|
|
totaltracks = artist['TotalTracks']
|
|
havetracks = artist['HaveTracks']
|
|
if not havetracks:
|
|
havetracks = 0
|
|
try:
|
|
percent = (havetracks*100.0)/totaltracks
|
|
if percent > 100:
|
|
percent = 100
|
|
except (ZeroDivisionError, TypeError):
|
|
percent = 0
|
|
totaltracks = '?'
|
|
|
|
if artist['ReleaseDate']:
|
|
releasedate = artist['ReleaseDate']
|
|
else:
|
|
releasedate = ''
|
|
|
|
%>
|
|
<tr>
|
|
<td id="name"><a href="artistPage?ArtistID=${artist['ArtistID']}">${artist['ArtistName']} </td>
|
|
<td id="album"><a href="albumPage?AlbumID=${artist['AlbumID']}">${artist['LatestAlbum']}</td>
|
|
<td id="reldate">${releasedate}</td>
|
|
<td id="have"><div class="progress-container"><div style="width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
|
|
</tr>
|
|
%endfor
|
|
</tbody>
|
|
</table>
|
|
</%def>
|
|
|
|
<%def name="headerIncludes()">
|
|
<link rel="stylesheet" href="css/data_table.css">
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="js/libs/jquery.dataTables.min.js"></script>
|
|
</%def> |