From e4a89d13863517020bbe82293e52cea98418c983 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 19 Jul 2020 11:11:09 +0100 Subject: Search table --- bh20simplewebuploader/main.py | 2 +- bh20simplewebuploader/static/main.css | 31 +++++++++++++++++++++++++++++++ bh20simplewebuploader/static/main.js | 16 +++++++++++++--- 3 files changed, 45 insertions(+), 4 deletions(-) (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index 48520fe..673f913 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -702,7 +702,7 @@ def search(): ?sample sio:SIO_000115 ?id . ?seq pubseq:sample ?sample . ?sample ?p ?o . - } + } limit 100 """ % s payload = {'query': query, 'format': 'json'} r = requests.get(baseURL, params=payload) diff --git a/bh20simplewebuploader/static/main.css b/bh20simplewebuploader/static/main.css index 09b6beb..bdcc0bc 100644 --- a/bh20simplewebuploader/static/main.css +++ b/bh20simplewebuploader/static/main.css @@ -347,6 +347,37 @@ footer { } } + +.rTable +{ + display: table; +} +.rTableTitle +{ + display: table-caption; + text-align: center; + font-weight: bold; + font-size: larger; +} +.rTableHeading +{ + display: table-row; + font-weight: bold; + text-align: center; +} +.rTableRow +{ + display: table-row; +} +.rTableCell +{ + display: table-cell; + border: solid; + border-width: thin; + padding-left: 5px; + padding-right: 5px; +} + .blog { margin: 10px; } diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js index 8271d2c..208823a 100644 --- a/bh20simplewebuploader/static/main.js +++ b/bh20simplewebuploader/static/main.js @@ -2,6 +2,15 @@ * Menu and navigation */ +/* Small helpers */ +function cell(text) { + html = "" + html += '
'; + html += text; + html += '
'; + return html +} + /* Convert a list of table items to an HTML DIV table */ function toDIVTable(rows) { if (rows.length == 0) @@ -9,14 +18,15 @@ function toDIVTable(rows) { else { html = '
'; rows.forEach(row => { + seq = row['seq']; html += '
'; - html += '
'; - html += row["id"]; - html += '
'; + html += cell(row['id']); + html += cell('FASTA'); html += '
'; }); html += '
'; } + console.log(html); document.getElementById("table").innerHTML = html; } -- cgit v1.2.3