From 0a69a6cda09b4014eaa4f0b94beb00de39c4983e Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 14 Jun 2019 13:43:10 -0500 Subject: Added some metadata to top of global search results --- wqflask/wqflask/gsearch.py | 3 +++ wqflask/wqflask/templates/gsearch_gene.html | 3 ++- wqflask/wqflask/templates/gsearch_pheno.html | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index 5910d77b..8df8c9a3 100644 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -61,6 +61,7 @@ class GSearch(object): with Bench("Running query"): logger.sql(sql) re = g.db.execute(sql).fetchall() + trait_list = [] with Bench("Creating trait objects"): for i, line in enumerate(re): @@ -100,6 +101,7 @@ class GSearch(object): trait_list.append(this_trait) + self.trait_count = len(trait_list) self.trait_list = json.dumps(trait_list) elif self.type == "phenotype": @@ -186,4 +188,5 @@ class GSearch(object): trait_list.append(this_trait) + self.trait_count = len(trait_list) self.trait_list = json.dumps(trait_list) diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 97b09929..62a2944c 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -9,7 +9,8 @@
-

You searched for {{ terms }}.

+

GN searched 754 datasets and 39765944 traits across 10 species, and found {{ trait_count }} results that match your query. + You can filter these results by adding key words in the fields below and you can also sort results on most columns.

To study a record, click on its Record ID below.
Check records below and click Add button to add to selection.

diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index a34c2796..2a0e5c0c 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -9,7 +9,8 @@
-

You searched for {{ terms }}.

+

GN searched 51 datasets and 13763 traits across 10 species, and found {{ trait_count }} results that match your query. + You can filter these results by adding key words in the fields below and you can also sort results on most columns.

To study a record, click on its ID below.
Check records below and click Add button to add to selection.

@@ -28,8 +29,8 @@
-
- +
+
-- cgit v1.2.3

Loading...