Finishing touches - adjusted css for config, fixed bug when no track duration, helpers now converts milliseconds to H:M:S if its more than an hour

This commit is contained in:
Remy
2011-08-08 00:06:31 -07:00
parent e42cacbe80
commit 4726c3c91f
6 changed files with 39 additions and 13 deletions
+12 -3
View File
@@ -30,9 +30,14 @@
<%
totalduration = myDB.action("SELECT SUM(TrackDuration) FROM tracks WHERE AlbumID=?", [album['AlbumID']]).fetchone()[0]
totaltracks = len(myDB.select("SELECT TrackTitle from tracks WHERE AlbumID=?", [album['AlbumID']]))
try:
albumduration = helpers.convert_milliseconds(totalduration)
except:
albumduration = 'n/a'
%>
<h3>Tracks: ${totaltracks}</h3>
<h3>Duration: ${helpers.convert_milliseconds(totalduration)}</h3>
<h3>Duration: ${albumduration}</h3>
%if description:
<h3>Description: </h3>
${description['Summary']}
@@ -55,18 +60,22 @@
%for track in tracks:
<%
i += 1
have = myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle like ? AND TrackTitle like ?', [album['ArtistName'], album['AlbumTitle'], track['TrackTitle']])
have = myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle like ? AND TrackTitle like ?', [track['ArtistName'], track['AlbumTitle'], track['TrackTitle']])
if len(have):
grade = 'A'
check = '<img src="images/checkmark.png" alt="checkmark">'
else:
grade = 'Z'
check = ''
try:
trackduration = helpers.convert_milliseconds(track['TrackDuration'])
except:
trackduration = 'n/a'
%>
<tr class="grade${grade}">
<td id="number">${i}</td>
<td id="name">${track['TrackTitle']}</td>
<td id="duration">${helpers.convert_milliseconds(track['TrackDuration'])}</td>
<td id="duration">${trackduration}</td>
<td id="have">${check}</td>
</tr>
%endfor
+11 -1
View File
@@ -1,6 +1,16 @@
<%inherit file="base.html"/>
<%def name="headerIncludes()">
<div id="subhead_container">
<ul id="subhead_menu">
<li><a href="shutdown">Shut Down</a></li>
<li><a href="restart">Restart</a></li>
</ul>
</div>
</%def>
<%def name="body()">
<div id="paddingheader">
<h1><h1>
</div>
<div class="table_wrapper">
<form action="configUpdate" method="post">
<a name="web_interface"><h1><u>Web Interface</u></h1></a>
+3 -1
View File
@@ -1,11 +1,13 @@
<%inherit file="base.html"/>
<%def name="headIncludes()">
<meta http-equiv="refresh" content="15;url=index">
<meta http-equiv="refresh" content="${timer};url=index">
</%def>
<%def name="body()">
<div class="table_wrapper">
<div id="shutdown">
<h1>Headphones is ${message}</h1>
</div>
</div>
</%def>