From e67129ad901bb2af29f4f00ba5d4d5b9b94ae705 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Tue, 25 Oct 2016 16:39:47 +0000
Subject: Replaced the Download Table button for collection page with python
version that displays metadata, etc
Removed currently unused javascript and css imports related to the DataTables buttons import (since it was replaced with the python export) from regular search, both global searches, and the view_collection page
Added a bunch of parameters to the jsonable function for the GeneralTrait object in order to later create a json version of the search results and implement the client-side Scroller feature (which dynamically loads table rows from json when you scroll)
---
wqflask/base/trait.py | 34 +++++++++++--
wqflask/wqflask/templates/collections/view.html | 59 ++++++++++-------------
wqflask/wqflask/templates/gsearch_gene.html | 4 --
wqflask/wqflask/templates/gsearch_pheno.html | 4 --
wqflask/wqflask/templates/search_result_page.html | 4 --
5 files changed, 55 insertions(+), 50 deletions(-)
(limited to 'wqflask')
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 32032ba7..358138f5 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -78,10 +78,36 @@ class GeneralTrait(object):
"""Return a dict suitable for using as json
Actual turning into json doesn't happen here though"""
- return dict(name=self.name,
- dataset=self.dataset.name,
- description=self.description_display,
- mean=self.mean)
+
+ if self.dataset.type == "ProbeSet":
+ return dict(name=self.name,
+ symbol=self.symbol,
+ dataset=self.dataset.name,
+ description=self.description_display,
+ mean=self.mean,
+ location=self.location_repr,
+ lrs_score=self.LRS_score_repr,
+ lrs_location=self.LRS_location_repr,
+ additive=self.additive
+ )
+ elif self.dataset.type == "Publish":
+ return dict(name=self.name,
+ dataset=self.dataset.name,
+ description=self.description_display,
+ authors=self.authors,
+ pubmed_text=self.pubmed_text,
+ pubmed_link=self.pubmed_link,
+ lrs_score=self.LRS_score_repr,
+ lrs_location=self.LRS_location_repr,
+ additive=self.additive
+ )
+ elif self.dataset.type == "Geno":
+ return dict(name=self.name,
+ dataset=self.dataset.name,
+ location=self.location_repr
+ )
+ else:
+ return dict()
def get_name(self):
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index 8fc5f120..801266d3 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -4,7 +4,6 @@
-
{% endblock %}
{% block content %}
@@ -74,20 +73,26 @@
+
- | Index | -Dataset | -Record | -Description | -Location | -Mean | -Max LRS ? | -Max LRS Location | -Additive Effect ? | +Index | +Dataset | +Record | +Description | +Location | +Mean | +Max LRS ? | +Max LRS Location | +Additive Effect ? | {{ loop.index }} | -{{ this_trait.dataset.name }} | -+ | {{ loop.index }} | +{{ this_trait.dataset.name }} | +{{ this_trait.description_display }} | +{{ this_trait.location_repr }} | +{{ '%0.3f' % this_trait.mean|float }} | +{{ '%0.3f' % this_trait.LRS_score_repr|float }} | +{{ this_trait.LRS_location_repr }} | +{{ '%0.3f' % this_trait.additive|float }} | {% endfor %} @@ -132,9 +137,6 @@ {% block js %} - - - @@ -170,18 +172,7 @@ "width": "15%" }, { "type": "natural" } ], - "buttons": [ - { - extend: 'csvHtml5', - text: 'Download CSV', - title: 'collection', - fieldBoundary: '"', - exportOptions: { - columns: [1, 2, 3, 4, 5, 6, 7, 8, 9] - } - } - ], - "sDom": "ZRBtir", + "sDom": "ZRtir", "iDisplayLength": -1, "autoWidth": true, "bDeferRender": true, diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html index 776b8d07..8b8a9057 100644 --- a/wqflask/wqflask/templates/gsearch_gene.html +++ b/wqflask/wqflask/templates/gsearch_gene.html @@ -2,7 +2,6 @@ {% block title %}Search Results{% endblock %} {% block css %} - {% endblock %} {% block content %} @@ -99,9 +98,6 @@ - - - diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html index 9aad7568..2f7dcaf6 100644 --- a/wqflask/wqflask/templates/gsearch_pheno.html +++ b/wqflask/wqflask/templates/gsearch_pheno.html @@ -4,7 +4,6 @@ - {% endblock %} @@ -93,9 +92,6 @@ - - - diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html index b6aab101..0f5e68d7 100644 --- a/wqflask/wqflask/templates/search_result_page.html +++ b/wqflask/wqflask/templates/search_result_page.html @@ -5,7 +5,6 @@ - {% endblock %} {% block content %} @@ -166,9 +165,6 @@ - - - -- cgit v1.2.3 From 684f461b815e3920419874fccb036c359cae35d8 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 25 Oct 2016 16:48:54 +0000 Subject: Just removed some extraneous spaces in trait.py --- wqflask/base/trait.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wqflask') diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py index 358138f5..276c624a 100644 --- a/wqflask/base/trait.py +++ b/wqflask/base/trait.py @@ -78,7 +78,7 @@ class GeneralTrait(object): """Return a dict suitable for using as json Actual turning into json doesn't happen here though""" - + if self.dataset.type == "ProbeSet": return dict(name=self.name, symbol=self.symbol, @@ -108,7 +108,7 @@ class GeneralTrait(object): ) else: return dict() - + def get_name(self): stringy = "" -- cgit v1.2.3
---|