Files
headphones/data/interfaces/brink/index.html
Brinken d894750151 * Fixed issues with JS path
* Trying pull request
2012-05-22 12:09:13 +02:00

84 lines
2.2 KiB
HTML

<%inherit file="base.html"/>
<%!
from headphones import helpers
%>
<%def name="body()">
<table class="display" id="artist_table">
<thead>
<tr>
<th id="name">Artist Name</th>
<th id="status">Status</th>
<th id="album">Latest Album</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'] and artist['LatestAlbum']:
releasedate = artist['ReleaseDate']
albumdisplay = '<i>%s</i> (%s)' % (artist['LatestAlbum'], artist['ReleaseDate'])
if releasedate > helpers.today():
grade = 'A'
else:
grade = 'Z'
elif artist['LatestAlbum']:
releasedate = ''
grade = 'Z'
albumdisplay = '<i>%s</i>' % artist['LatestAlbum']
else:
releasedate = ''
grade = 'Z'
albumdisplay = '<i>None</i>'
if artist['Status'] == 'Paused':
grade = 'X'
%>
<tr class="grade${grade}">
<td id="name"><span title="${artist['ArtistSortName']}"></span><a href="artistPage?ArtistID=${artist['ArtistID']}">${artist['ArtistName']}</a></td>
<td id="status">${artist['Status']}</td>
<td id="album"><span title="${releasedate}"></span><a href="albumPage?AlbumID=${artist['AlbumID']}">${albumdisplay}</a></td>
<td id="have"><span title="${percent}"></span>
<div class="progress-container" title="You have ${havetracks} of ${totaltracks} total.">
<span class="havetracks">${havetracks}/${totaltracks}</span>
<div style="width:${percent}%"></div>
</div>
</td>
</tr>
%endfor
</tbody>
</table>
</%def>
<%def name="headIncludes()">
</%def>
<%def name="javascriptIncludes()">
<script src="interfaces/brink/js/libs/jquery.dataTables.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#artist_table').dataTable(
{
"aaSorting": [
],
"bPaginate": false,
"bFilter": true
});
});
</script>
</%def>