mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-26 05:17:44 +01:00
Display query/type in search box on results page.
This commit is contained in:
@@ -125,4 +125,18 @@
|
||||
initThisPage();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
<%!
|
||||
# Abuse JSON module for escaping JavaScript
|
||||
import json
|
||||
%>
|
||||
$(document).ready(function() {
|
||||
// Search parameter
|
||||
$("#searchbar input[name=name]").val(${name | json.dumps});
|
||||
|
||||
// Album or artist
|
||||
$("#searchbar select[name=type]").val(${type | json.dumps});
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
@@ -142,7 +142,7 @@ class WebInterface(object):
|
||||
searchresults = mb.findArtist(name, limit=100)
|
||||
else:
|
||||
searchresults = mb.findRelease(name, limit=100)
|
||||
return serve_template(templatename="searchresults.html", title='Search Results for: "' + name + '"', searchresults=searchresults, type=type)
|
||||
return serve_template(templatename="searchresults.html", title='Search Results for: "' + name + '"', searchresults=searchresults, name=name, type=type)
|
||||
search.exposed = True
|
||||
|
||||
def addArtist(self, artistid):
|
||||
|
||||
Reference in New Issue
Block a user