mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-22 12:49:26 +00:00
82 lines
2.1 KiB
HTML
82 lines
2.1 KiB
HTML
<%inherit file="base.html" />
|
|
|
|
<%def name="body()">
|
|
|
|
<div id="paddingheader">
|
|
<h1>Search Results</h1>
|
|
</div>
|
|
<table class="display" id="searchresults_table">
|
|
<thead>
|
|
<tr>
|
|
%if type == 'album':
|
|
<th id="albumname">Album Name</th>
|
|
%endif
|
|
<th id="artistname">Artist Name</th>
|
|
<th id="score">Score</th>
|
|
<th id="add"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
%if searchresults:
|
|
%for result in searchresults:
|
|
<%
|
|
if result['score'] == 100:
|
|
grade = 'A'
|
|
else:
|
|
grade = 'Z'
|
|
%>
|
|
<tr class="grade${grade}">
|
|
%if type == 'album':
|
|
<td id="albumname"><a href="${result['albumurl']}">${result['title']}</a></td>
|
|
%endif
|
|
<td id="artistname"><a href="${result['url']}">${result['uniquename']}</a></td>
|
|
<td id="score">
|
|
<div class="searchscore" title="The match result is: ${result['score']}%">
|
|
|
|
|
|
<div class="progress-container" title="Match result is ${result['score']}%">
|
|
<span class="searchmatch">${result['score']}%</span>
|
|
<div style="width: ${result['score']}%"></div>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
%if type == 'album':
|
|
<td id="add"><a class="btnAdd" href="addReleaseById?rid=${result['albumid']}" title="Add this Album"></a></td>
|
|
%else:
|
|
<td id="add"><a class="btnAdd" href="addArtist?artistid=${result['id']}" title="Add this Artist"></a></td>
|
|
%endif
|
|
</tr>
|
|
%endfor
|
|
%endif
|
|
</tbody>
|
|
</table>
|
|
</%def>
|
|
|
|
<%def name="headIncludes()">
|
|
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="interfaces/brink/JS/libs/jquery.dataTables.min.js"></script>
|
|
<script>
|
|
$(document).ready(function()
|
|
{
|
|
$('#searchresults_table').dataTable(
|
|
{
|
|
"aoColumns": [
|
|
null,
|
|
null,
|
|
{ "bSortable": false}
|
|
],
|
|
"oLanguage": {
|
|
"sLengthMenu":"Show _MENU_ albums per page",
|
|
"sEmptyTable": "No search results found",
|
|
"sInfo":"Showing _TOTAL_ albums",
|
|
"sInfoEmpty":"No albums found",
|
|
"sInfoFiltered":"(Filtered from _MAX_ total albums)"},
|
|
"bPaginate": false,
|
|
"aaSorting": [[4, 'asc'],[3,'desc']]
|
|
});
|
|
});
|
|
</script>
|
|
</%def> |