Fixed artist sort, fixed helpers import in logs

This commit is contained in:
Remy
2011-08-06 12:29:13 -07:00
parent 644344cb27
commit 7199c610b8
4 changed files with 23 additions and 11 deletions

View File

@@ -35,7 +35,7 @@
%>
<tr>
<td id="name"><a href="artistPage?ArtistID=${artist['ArtistID']}">${artist['ArtistName']}</a></td>
<td id="name"><span title="${artist['ArtistSortName']}"><span><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"><span title="${percent}"><span><div class="progress-container"><div style="width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
@@ -57,7 +57,7 @@
$('#artist_table').dataTable(
{
"aoColumns": [
{ "sType": "anti-the" },
{ "sType": "title-string"},
null,
null,
{ "sType": "title-numeric"}

View File

@@ -1,4 +1,7 @@
<%inherit file="base.html"/>
<%!
from headphones import helpers
%>
<%def name="body()">
<table class="display" id="log_table">
@@ -13,17 +16,14 @@
<tbody>
%for line in lineList:
<%
from headphones import helpers
out_tuple = helpers.extract_logline(line)
if out_tuple:
timestamp, level, thread, message = out_tuple
%>
%if timestamp and level and thread and message:
%if out_tuple:
<tr>
<td id="timestamp">${timestamp}</td>
<td id="level">${level}</td>
<td id="thread">${thread}</td>
<td id="message">${message.decode('utf-8')}</td>
<td id="timestamp">${out_tuple[0]}</td>
<td id="level">${out_tuple[1]}</td>
<td id="thread">${out_tuple[2]}</td>
<td id="message">${out_tuple[3].decode('utf-8')}</td>
</tr>
%endif
%endfor

View File

@@ -6,6 +6,18 @@ window.log = function(){
};
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});
jQuery.fn.dataTableExt.oSort['title-string-asc'] = function(a,b) {
var x = a.match(/title="(.*?)"/)[1].toLowerCase();
var y = b.match(/title="(.*?)"/)[1].toLowerCase();
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};
jQuery.fn.dataTableExt.oSort['title-string-desc'] = function(a,b) {
var x = a.match(/title="(.*?)"/)[1].toLowerCase();
var y = b.match(/title="(.*?)"/)[1].toLowerCase();
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};
jQuery.fn.dataTableExt.oSort['title-numeric-asc'] = function(a,b) {
var x = a.match(/title="*(-?[0-9]+)/)[1];
var y = b.match(/title="*(-?[0-9]+)/)[1];

View File

@@ -403,7 +403,7 @@ class WebInterface(object):
lineList = fileHandle.readlines()
fileHandle.close()
lineList.reverse()
return serve_template(templatename="logs.html", title="Log", lineList=lineList[0:1000])
return serve_template(templatename="logs.html", title="Log", lineList=lineList[0:500])
logs.exposed = True
def clearhistory(self):