From 7b2d388dbed11384c6a388a5437cca0b8f2914fd Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 19 Jul 2020 09:11:41 +0100 Subject: Wiring up export function --- bh20simplewebuploader/main.py | 9 +++++++ bh20simplewebuploader/static/main.js | 10 ++++--- bh20simplewebuploader/templates/export.html | 41 +++++++++++++++++++++++++++++ bh20simplewebuploader/templates/menu.html | 1 + 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 bh20simplewebuploader/templates/export.html (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index 2c360e1..b88055f 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -630,6 +630,10 @@ def validated_page(): validated_table(output, validated) return render_template('validated.html', table=Markup(output.getvalue()), menu='STATUS') +@app.route('/export') +def export_page(): + return render_template('export.html',menu='EXPORT') + @app.route('/demo') def demo_page(): return render_template('demo.html',menu='DEMO',load_map=True) @@ -685,6 +689,11 @@ def getCountDB(): # print(result, file=sys.stderr) return jsonify({'sequences': int(result[0]["num"]["value"])}) +# Execute a 'global search' +@app.route('/api/search', methods=['GET']) +def search(): + return jsonify(["TESTME"]) + @app.route('/api/getAllaccessions', methods=['GET']) def getAllaccessions(): query="""SELECT DISTINCT ?fasta ?value WHERE {?fasta ?x[ ?value ]}""" diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js index 1633c25..dc0864b 100644 --- a/bh20simplewebuploader/static/main.js +++ b/bh20simplewebuploader/static/main.js @@ -21,8 +21,6 @@ function fetchAPI(apiEndPoint) { .then(data => { console.log(data); }); - document.getElementById("map_view").classList.add("invisible"); - document.getElementById("loader").classList.remove("invisible"); } // Copy from function above but now output HTML table instead of plain json @@ -51,7 +49,13 @@ function fetchHTMLTable(apiEndPoint) { } -let search = () => { +/* Fetch record info using a 'global search' */ +let searchGlobal = () => { + let m = document.getElementById('search-input').value; + fetchAPI(scriptRoot + "/api/search?s=" + encodeURIComponent(m)); +} + +let searchSeq = () => { let m = document.getElementById('search-input').value; fetchAPI(scriptRoot + "/api/getDetailsForSeq?seq=" + encodeURIComponent(m)); } diff --git a/bh20simplewebuploader/templates/export.html b/bh20simplewebuploader/templates/export.html new file mode 100644 index 0000000..f105290 --- /dev/null +++ b/bh20simplewebuploader/templates/export.html @@ -0,0 +1,41 @@ + + + {% include 'header.html' %} + + {% include 'banner.html' %} + {% include 'menu.html' %} + +

Export Data

+
+ + COVID-19 PubSeq allows for exporting forms and data for other + services. + +

Export EBI/ENA Forms

+ +

+ Uploading data to EBI/ENA with PubSeq is described + here. + To export, first search for an uploaded entry through its + identifier: +

+ + + +
+ + {% include 'footer.html' %} + + + + + diff --git a/bh20simplewebuploader/templates/menu.html b/bh20simplewebuploader/templates/menu.html index 0f6003f..d408171 100644 --- a/bh20simplewebuploader/templates/menu.html +++ b/bh20simplewebuploader/templates/menu.html @@ -5,6 +5,7 @@ UPLOAD STATUS DEMO + EXPORT BLOG ABOUT -- cgit v1.2.3