Added artist page and log page, fixed some css, added logline parse to helpers

This commit is contained in:
Remy
2011-08-05 22:20:36 -07:00
parent 5865a54fc5
commit fe1667a2e0
11 changed files with 210 additions and 148 deletions
+68
View File
@@ -0,0 +1,68 @@
<%inherit file="base.html"/>
<%def name="subhead()">
<div id="subhead_container">
<ul id="subhead_menu">
<li><a href="refresh?ArtistID=${artist['ArtistID']}">Refresh Artist</a></li>
<li><a href="delete?ArtistID=${artist['ArtistID']}">Delete Artist</a></li>
<li><a href="pause?ArtistID=${artist['ArtistID']}">Pause Artist</a></li>
</ul>
</div>
</%def>
<%def name="body()">
<div id="artistheader">
${artist['ArtistName']}
</div>
<table class="display" id="album_table">
<thead>
<tr>
<th id="albumart"></th>
<th id="albumname">Album Name</th>
<th id="reldate">Release Date</th>
<th id="type">Release Type</th>
<th id="status">Status</th>
<th id="have">Have</th>
</tr>
</thead>
<tbody>
%for album in albums:
<tr>
<td id="albumart"><img src="http://ec1.images-amazon.com/images/P/${album['AlbumASIN']}.01.MZZZZZZZ.jpg" height="50" width="50"></td>
<td id="albumname"><a href="albumPage?AlbumID=${album['AlbumID']}">${album['AlbumTitle']}</a></td>
<td id="reldate">${album['ReleaseDate']}</td>
<td id="type">${album['Type']}</td>
<td id="status">${album['Status']}</td>
<td id="have"><div class="progress-container"><div style="width:100%"><div class="havetracks">tracks</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>
<script>
$(document).ready(function()
{
$('#album_table').dataTable(
{
"oLanguage": {
"sLengthMenu":"Show _MENU_ albums per page",
"sEmptyTable": "No album information available",
"sInfo":"Showing _START_ to _END_ of _TOTAL_ albums",
"sInfoEmpty":"Showing 0 to 0 of 0 albums",
"sInfoFiltered":"(filtered from _MAX_ total albums)"},
"bStateSave": true,
"iDisplayLength": 25,
"sPaginationType": "full_numbers",
"aaSorting": [[3, 'asc'],[2,'desc']]
});
});
</script>
</%def>
+5 -2
View File
@@ -46,7 +46,9 @@
</form>
</div>
</header>
<div id="subhead">
${next.subhead()}
</div>
<div id="main" class="main">
${next.body()}
</div>
@@ -81,4 +83,5 @@
</html>
<%def name="javascriptIncludes()"></%def>
<%def name="headerIncludes()"></%def>
<%def name="headerIncludes()"></%def>
<%def name="subhead()"></%def>
+16 -2
View File
@@ -35,8 +35,8 @@
%>
<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="name"><a href="artistPage?ArtistID=${artist['ArtistID']}">${artist['ArtistName']}</a></td>
<td id="album"><a href="albumPage?AlbumID=${artist['AlbumID']}">${artist['LatestAlbum']}</a></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>
@@ -51,4 +51,18 @@
<%def name="javascriptIncludes()">
<script src="js/libs/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function()
{
$('#artist_table').dataTable(
{
"aoColumnDefs": [
{ "bSOtrable": false, "aTargets": [ 1 ] } ],
"bStateSave": true,
"iDisplayLength": 50,
"sPaginationType": "full_numbers",
});
});
</script>
</%def>
+56
View File
@@ -0,0 +1,56 @@
<%inherit file="base.html"/>
<%def name="body()">
<table class="display" id="log_table">
<thead>
<tr>
<th id="timestamp">Timestamp</th>
<th id="level">Level</th>
<th id="thread">Thread</th>
<th id="message">Message</th>
</tr>
</thead>
<tbody>
%for line in lineList:
<%
from headphones import helpers
timestamp, level, thread, message = helpers.extract_logline(line)
%>
%if timestamp and level and thread and message:
<tr>
<td id="timestamp">${timestamp}</td>
<td id="level">${level}</td>
<td id="thread">${thread}</td>
<td id="message">${message.decode('utf-8')}</td>
</tr>
%endif
%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>
<script>
$(document).ready(function()
{
$('#log_table').dataTable(
{
"oLanguage": {
"sLengthMenu":"Show _MENU_ lines per page",
"sEmptyTable": "No log information available",
"sInfo":"Showing _START_ to _END_ of _TOTAL_ lines",
"sInfoEmpty":"Showing 0 to 0 of 0 lines",
"sInfoFiltered":"(filtered from _MAX_ total lines)"},
"bStateSave": true,
"iDisplayLength": 100,
"sPaginationType": "full_numbers",
});
});
</script>
</%def>