mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-22 20:59:27 +00:00
94 lines
2.6 KiB
HTML
94 lines
2.6 KiB
HTML
<%inherit file="base.html"/>
|
|
<%!
|
|
from headphones import helpers
|
|
%>
|
|
|
|
<%def name="body()">
|
|
<table class="display" id="artist_table">
|
|
<thead>
|
|
<tr>
|
|
<th id="albumart"></th>
|
|
<th id="ArtistSortName">Artist Name</th>
|
|
<th id="Status">Status</th>
|
|
<th id="LatestAlbum">Latest Album</th>
|
|
<th id="HaveTracks">Have</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</%def>
|
|
|
|
<%def name="headIncludes()">
|
|
<link rel="stylesheet" href="interfaces/default/css/data_table.css">
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="js/libs/jquery.dataTables.min.js"></script>
|
|
<script>
|
|
function getArtistArt() {
|
|
var nodes = document.getElementById("artist_table").getElementsByTagName("img");
|
|
$("#artist_table img").each(function(){
|
|
var id = $(this).attr('id');
|
|
var image = $(this);
|
|
if ( !image.hasClass('done') ) {
|
|
image.addClass('done');
|
|
getThumb(image,id,'artist');
|
|
}
|
|
});
|
|
}
|
|
function initThisPage() {
|
|
$('#artist_table').dataTable({
|
|
"bDestroy": true,
|
|
"aoColumnDefs": [
|
|
{
|
|
"bSortable": false,
|
|
"aTargets": [ 0 ],
|
|
"mData":"ArtistID",
|
|
"mRender": function ( data, type, full ) {
|
|
return '<div id="artistImg"><img class="albumArt" alt="" id="'+ data + '"/></div>';
|
|
}
|
|
},
|
|
{"aTargets":[1],"mDataProp":"ArtistSortName"},
|
|
{"aTargets":[2],"mDataProp":"Status"},
|
|
{"aTargets":[3],"mDataProp":"LatestAlbum"},
|
|
{"aTargets":[4],"mDataProp":"HaveTracks"},
|
|
|
|
],
|
|
|
|
"oLanguage": {
|
|
"sSearch": ""},
|
|
"bStateSave": true,
|
|
"iDisplayLength": 50,
|
|
"sPaginationType": "full_numbers",
|
|
"bProcessing": true,
|
|
"bServerSide": true,
|
|
"sAjaxSource": 'getArtists.json',
|
|
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ){
|
|
return nRow;
|
|
},
|
|
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
|
/* Add some extra data to the sender */
|
|
$.getJSON( sSource, aoData, function (json) { fnCallback(json) } )
|
|
},
|
|
"fnInitComplete": function(oSettings, json)
|
|
{
|
|
getArtistArt();
|
|
}});
|
|
|
|
|
|
|
|
resetFilters("artist or album");
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
initThisPage();
|
|
});
|
|
$(window).load(function(){
|
|
initFancybox();
|
|
refreshLoadArtist();
|
|
});
|
|
</script>
|
|
|
|
</%def>
|