many many things...
This commit is contained in:
+8
-2
@@ -118,7 +118,7 @@ def searh():
|
||||
|
||||
################################
|
||||
##
|
||||
## need to chache all the below
|
||||
## need to cache all the below??
|
||||
##
|
||||
################################
|
||||
|
||||
@@ -128,7 +128,13 @@ def searh():
|
||||
a.load(l)
|
||||
results.append(a.search(k_arg))
|
||||
|
||||
return jsonify(result=results)
|
||||
## -- sort results?
|
||||
search_results = sorted(results, key=get_result_key)
|
||||
|
||||
return jsonify(result=search_results)
|
||||
|
||||
def get_result_key(r):
|
||||
return r['archive']
|
||||
|
||||
|
||||
|
||||
|
||||
+12
-4
@@ -1,18 +1,26 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#search').on('submit', function(e) {
|
||||
$('#loading').hide()
|
||||
|
||||
$('#search').submit(function(e) {
|
||||
e.preventDefault();
|
||||
args = $(this).serialize();
|
||||
$('#graph').empty();
|
||||
$('#results').empty();
|
||||
|
||||
$('#loading').show()
|
||||
$.get('/search?'+args, function(data) {
|
||||
$('#loading').hide()
|
||||
console.log(data);
|
||||
$('#graph').empty();
|
||||
$('#results').empty();
|
||||
// $('#graph').empty();
|
||||
// $('#results').empty();
|
||||
$.each(data.result, function(i, item) {
|
||||
search_result_archive(item);
|
||||
});
|
||||
graph(data);
|
||||
graph(data);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_result_archive(a) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="submit" value="search" id="submit">
|
||||
<div id="loading">Loading...</div>
|
||||
</form>
|
||||
<div id="graph"></div>
|
||||
<div id="results"></div>
|
||||
|
||||
Reference in New Issue
Block a user