many many things...

This commit is contained in:
David Gauthier
2017-11-04 13:34:05 +01:00
parent f540b26e4e
commit 874a27a8c9
18 changed files with 1574 additions and 23 deletions
+8 -2
View File
@@ -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']
Vendored Executable → Regular
View File
Vendored Executable → Regular
View File
+12 -4
View File
@@ -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) {
+1
View File
@@ -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>