aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/wqflask/dataSharing/SharingInfoPage.py13
-rw-r--r--wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee48
-rw-r--r--wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js54
-rw-r--r--wqflask/wqflask/templates/base.html4
-rw-r--r--wqflask/wqflask/templates/data_sharing.html190
-rw-r--r--wqflask/wqflask/templates/trait_data_and_analysis.html20
-rw-r--r--wqflask/wqflask/views.py33
7 files changed, 153 insertions, 209 deletions
diff --git a/wqflask/wqflask/dataSharing/SharingInfoPage.py b/wqflask/wqflask/dataSharing/SharingInfoPage.py
index 4e07e01b..91538a07 100755
--- a/wqflask/wqflask/dataSharing/SharingInfoPage.py
+++ b/wqflask/wqflask/dataSharing/SharingInfoPage.py
@@ -28,6 +28,8 @@ from __future__ import print_function, division
from pprint import pformat as pf
+import flask
+
from base.templatePage import templatePage
from base import webqtlConfig
from dbFunction import webqtlDatabaseFunction
@@ -42,8 +44,9 @@ class SharingInfoPage(templatePage):
def __init__(self, fd):
templatePage.__init__(self, fd)
+ self.redirect_url = None # Set if you want a redirect
print("fd is:", pf(fd.__dict__))
- # Todo: Need a [0] in line below????
+ # Todo: Need a [0] in line below????d
GN_AccessionId = fd.get('GN_AccessionId') # Used under search datasharing
InfoPageName = fd['database'][0]
cursor = webqtlDatabaseFunction.getCursor()
@@ -51,8 +54,12 @@ class SharingInfoPage(templatePage):
sql = "select GN_AccesionId from InfoFiles where InfoPageName = %s"
cursor.execute(sql, InfoPageName)
GN_AccessionId = cursor.fetchone()
- url = webqtlConfig.CGIDIR + "main.py?FormID=sharinginfo&GN_AccessionId=%s" % GN_AccessionId
- self.redirection = url
+ self.redirect_url = "http://23.21.59.238:5001/data_sharing&GN_AccessionId=%s" % GN_AccessionId
+ #self.redirect_url = flask.url_for('data_sharing', GN_AccessionId=GN_AccessionId[0])
+ print("set self.redirect_url")
+ #print("before redirect")
+ #return flask.redirect(url)
+ #print("after redirect")
else:
sharingInfoObject = SharingInfo.SharingInfo(GN_AccessionId, InfoPageName)
self.dict['body'] = sharingInfoObject.getBody(infoupdate="")
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
index 118be8ec..d3b1051d 100644
--- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
+++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
@@ -1,5 +1,15 @@
console.log("start_b")
+isNumber = (o) ->
+ return ! isNaN (o-0) && o != null
+
+console.log("isNumber 7:", isNumber(7))
+console.log("isNumber 13.1:", isNumber(13.1))
+console.log("isNumber x:", isNumber("x"))
+console.log("isNumber '9':", isNumber('9'))
+console.log("isNumber:", isNumber())
+
+
$ ->
hide_tabs = (start) ->
for x in [start..10]
@@ -12,7 +22,7 @@ $ ->
console.log("hidden?")
-
+ # Changes stats table between all, bxd only and non-bxd, etc.
stats_mdp_change = ->
console.log("In stats_mdp_change")
selected = $(this).val()
@@ -24,3 +34,39 @@ $ ->
console.log("tape")
+
+ mean = (the_values)->
+ total = 0
+ total += value for value in the_values
+ console.log("yeap")
+ console.log(total)
+ the_mean = total / the_values.length
+ return the_mean.toFixed(2)
+
+
+
+ edit_data_change = ->
+ console.log("In edit_data_change")
+ the_values = []
+ #console.log($(this))
+ #$(this).each (counter, element) =>
+ # #console.log("counter is:" + counter)
+ # console.log("element is:")
+ # console.log(element)
+ console.log("foo")
+ values = $('#primary').find(".edit_strain_value")
+ console.log("values are:", values)
+ for value in values
+ console.log(value)
+ real_value = $(value).val()
+ #if real_value
+ console.log(real_value)
+ if isNumber(real_value) and real_value != ""
+ the_values.push(parseFloat(real_value))
+ console.log(the_values)
+ the_mean = mean(the_values)
+ console.log(the_mean)
+ $("#mean_value").html(the_mean)
+
+ $('#primary').change(edit_data_change)
+ console.log("loaded")
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
index e59edbdb..eecc630f 100644
--- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
+++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
@@ -1,10 +1,25 @@
// Generated by CoffeeScript 1.3.3
(function() {
+ var isNumber;
console.log("start_b");
+ isNumber = function(o) {
+ return !isNaN((o - 0) && o !== null);
+ };
+
+ console.log("isNumber 7:", isNumber(7));
+
+ console.log("isNumber 13.1:", isNumber(13.1));
+
+ console.log("isNumber x:", isNumber("x"));
+
+ console.log("isNumber '9':", isNumber('9'));
+
+ console.log("isNumber:", isNumber());
+
$(function() {
- var hide_tabs, stats_mdp_change;
+ var edit_data_change, hide_tabs, mean, stats_mdp_change;
hide_tabs = function(start) {
var x, _i, _results;
_results = [];
@@ -26,7 +41,42 @@
return $("#stats_tabs" + selected).show();
};
$(".stats_mdp").change(stats_mdp_change);
- return console.log("tape");
+ console.log("tape");
+ mean = function(the_values) {
+ var the_mean, total, value, _i, _len;
+ total = 0;
+ for (_i = 0, _len = the_values.length; _i < _len; _i++) {
+ value = the_values[_i];
+ total += value;
+ }
+ console.log("yeap");
+ console.log(total);
+ the_mean = total / the_values.length;
+ return the_mean.toFixed(2);
+ };
+ edit_data_change = function() {
+ var real_value, the_mean, the_values, value, values, _i, _len;
+ console.log("In edit_data_change");
+ the_values = [];
+ console.log("foo");
+ values = $('#primary').find(".edit_strain_value");
+ console.log("values are:", values);
+ for (_i = 0, _len = values.length; _i < _len; _i++) {
+ value = values[_i];
+ console.log(value);
+ real_value = $(value).val();
+ console.log(real_value);
+ if (isNumber(real_value) && real_value !== "") {
+ the_values.push(parseFloat(real_value));
+ }
+ }
+ console.log(the_values);
+ the_mean = mean(the_values);
+ console.log(the_mean);
+ return $("#mean_value").html(the_mean);
+ };
+ $('#primary').change(edit_data_change);
+ return console.log("loaded");
});
}).call(this);
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index 6776a71c..d7154a5b 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -18,11 +18,11 @@
<link type="text/css" href='/css/custom-theme/jquery-ui-1.8.12.custom.css' rel='Stylesheet' />
<link type="text/css" href='/css/tab_style.css' rel='Stylesheet' />
- <script type="text/javascript" src="/javascript/jquery-1.5.2.min.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<SCRIPT SRC="/javascript/webqtl.js"></SCRIPT>
<SCRIPT SRC="/javascript/dhtml.js"></SCRIPT>
<SCRIPT SRC="/javascript/tablesorter.js"></SCRIPT>
- <SCRIPT SRC="/javascript/jqueryFunction.js"></SCRIPT>
+ <!--<SCRIPT SRC="/javascript/jqueryFunction.js"></SCRIPT>-->
<script src="/javascript/tabbed_pages.js" type="text/javascript"></script>
<script src="/javascript/jquery-ui-1.8.12.custom.min.js" type="text/javascript"></script>
diff --git a/wqflask/wqflask/templates/data_sharing.html b/wqflask/wqflask/templates/data_sharing.html
index e9d082d6..e6942504 100644
--- a/wqflask/wqflask/templates/data_sharing.html
+++ b/wqflask/wqflask/templates/data_sharing.html
@@ -1,112 +1,6 @@
-<?XML VERSION="1.0" ENCODING="UTF-8">
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML>
-<HEAD>
-<TITLE></TITLE>
-
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META NAME="keywords" CONTENT="genetics, bioinformatics, genome, phenome, gene expression, complex trait analysis, gene mapping, SNP, quantitative trait locus QTL, expression eQTL, WebQTL, Traitnet, Traitnetwork, personalized medicine">
-<META NAME="description" CONTENT ="GeneNetwork is a free scientific web resource used to study relationships between differences in genes, environmental factors, phenotypes, and disease risk." >
-<META NAME="author" CONTENT ="GeneNetwork developers" >
-<META NAME="geo.placename" CONTENT ="Memphis, TN" >
-<META NAME="geo.region" CONTENT="US-TN">
-
-<LINK REL="stylesheet" TYPE="text/css" HREF='/css/general.css'>
-<LINK REL="stylesheet" TYPE="text/css" HREF='/css/menu.css'>
-<link rel="stylesheet" media="all" type="text/css" href="/css/tabbed_pages.css" />
-<LINK REL="apple-touch-icon" href="/images/ipad_icon3.png" />
-<link type="text/css" href='/css/custom-theme/jquery-ui-1.8.12.custom.css' rel='Stylesheet' />
-<link type="text/css" href='/css/tab_style.css' rel='Stylesheet' />
-
-<script type="text/javascript" src="/javascript/jquery-1.5.2.min.js"></script>
-<SCRIPT SRC="/javascript/webqtl.js"></SCRIPT>
-<SCRIPT SRC="/javascript/dhtml.js"></SCRIPT>
-<SCRIPT SRC="/javascript/tablesorter.js"></SCRIPT>
-<SCRIPT SRC="/javascript/jqueryFunction.js"></SCRIPT>
-<script src="/javascript/tabbed_pages.js" type="text/javascript"></script>
-<script src="/javascript/jquery-ui-1.8.12.custom.min.js" type="text/javascript"></script>
-
-
-<script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-3782271-1']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
-</script>
-</HEAD>
-<BODY bottommargin="2" leftmargin="2" rightmargin="2" topmargin="2" text=#000000 bgColor=#ffffff >
-
-<TABLE cellSpacing=5 cellPadding=4 width="100%" border=0>
- <TBODY>
- <!-- Start of header -->
- <TR>
- <TD width=30 rowSpan=5>&nbsp;</TD>
-<TD bgColor=#ffffff NOWRAP="yes" width="100%" class="solidBorder">
- <Table width= "100%" cellSpacing=0 cellPadding=0>
- <TR>
- <TD width= "100%" id="smallsize">
- <a href="/">
- <IMG src="/images/upload/GeneNet_Banner2009c.png" border="0">
- </a>
- </TD>
- <TD valign="bottom">
- <A HREF="http://www.touchgraph.com/TGGoogleBrowser.php?start=genenetwork.org&signed=false" target="_blank">
- <IMG SRC="/images/upload/NetworkLogo.png" width="101" height="73" border="0">
- </a>
- </td>
- <TD valign="bottom">
- <IMG src="/images/webqtllogo2.gif" alt="WebQTL" border="0">
- </TD>
- </TR>
- </Table>
-</TD>
-<TD width="30" rowSpan=5>&nbsp;</TD>
-</TR>
-<TR>
-<!--Home Help Search News Papers Policies Accounts Links-->
-<TD bgColor=#ddddff NOWRAP="yes" class="solidBorder">
-<table width="100%" cellSpacing=0 cellPadding=0 border=0>
-<tr>
-<td aligh=left NOWRAP="yes">
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-<Span Id= "menu_grp1" onmouseover="A_MENUS[0].onmouseover(grpObj['menu_grp1'])" onmouseout="A_MENUS[0].onmouseout(grpObj['menu_grp1'])" style="font-size:12px;font-family:verdana;color:#0000ae">
-<Strong>Home</Strong></Span>
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-<Span Id= "menu_grp2" onmouseover="A_MENUS[0].onmouseover(grpObj['menu_grp2'])" onmouseout="A_MENUS[0].onmouseout(grpObj['menu_grp2'])" style="font-size:12px;font-family:verdana;color:#0000ae">
-<Strong>Search</Strong></Span>
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-<Span Id= "menu_grp3" onmouseover="A_MENUS[0].onmouseover(grpObj['menu_grp3'])" onmouseout="A_MENUS[0].onmouseout(grpObj['menu_grp3'])" style="font-size:12px;font-family:verdana;color:#0000ae">
-<Strong>Help</Strong></Span>
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-<Span Id= "menu_grp4" onmouseover="A_MENUS[0].onmouseover(grpObj['menu_grp4'])" onmouseout="A_MENUS[0].onmouseout(grpObj['menu_grp4'])" style="font-size:12px;font-family:verdana;color:#0000ae">
-<A Href="/whats_new.html" style="font-size:12px;font-family:verdana;color:#0000ae">
-<Strong>News</Strong></A></Span>
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-<Span Id= "menu_grp5" onmouseover="A_MENUS[0].onmouseover(grpObj['menu_grp5'])" onmouseout="A_MENUS[0].onmouseout(grpObj['menu_grp5'])" style="font-size:12px;font-family:verdana;color:#0000ae">
-<A Href="/reference.html" style="font-size:12px;font-family:verdana;color:#0000ae">
-<Strong>References</Strong></A></Span>
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-<Span Id= "menu_grp6" onmouseover="A_MENUS[0].onmouseover(grpObj['menu_grp6'])" onmouseout="A_MENUS[0].onmouseout(grpObj['menu_grp6'])" style="font-size:12px;font-family:verdana;color:#0000ae">
-<Strong>Policies</Strong></Span>
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-<Span Id= "menu_grp8" onmouseover="A_MENUS[0].onmouseover(grpObj['menu_grp8'])" onmouseout="A_MENUS[0].onmouseout(grpObj['menu_grp8'])" style="font-size:12px;font-family:verdana;color:#0000ae">
-<A Href="/links.html" style="font-size:12px;font-family:verdana;color:#0000ae">
-<Strong>Links</Strong></A></Span>
-&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
-</td>
-<td align="right" NOWRAP="yes">
-Welcome! <a href=/account.html><U>Login</U></a>&nbsp;&nbsp;&nbsp;
-</td>
-</tr>
-</table>
-</TD>
-
- </TR>
- <!-- End of header -->
+{% extends "base.html" %}
+{% block title %}Search Results{% endblock %}
+{% block content %}
<!-- Start of body -->
<TR>
@@ -752,80 +646,4 @@ This table lists all arrays by file order (<B>Index</B>), tube/sample ID, age, s
</TD>
</TR>
<!-- End of body -->
-
- <!-- Start of footer -->
- <TR>
- <TD align=center bgColor=#ddddff class="solidBorder">
- <TABLE width="90%"><TR>
- <TD align="left">
- <A HREF="http://citg.uthsc.edu/" target="_blank">
- <IMG SRC="/images/upload/CITGLogo.png" alt="CITG" border="0"></A>
- </TD>
- <TD align="left" id="smallsize" style="font-size:11px;font-family:verdana;color:black">
-WWW service initiated January, 1994 as <A HREF="http://www.ncbi.nlm.nih.gov/pubmed?term=8043953">The Portable Dictionary of the Mouse Genome</A> and June 15, 2001 as WebQTL.
-
-This site is currently operated by
- <A class="smallsize" HREF="mailto:rwilliams@uthsc.edu">Rob Williams</A>,
- <A class="smallsize" HREF="mailto:lyan6@uthsc.edu">Lei Yan</A>,
- <A class="smallsize" HREF="mailto:zachary.a.sloan@gmail.com">Zachary Sloan</A>,
- <A class="smallsize" HREF="mailto:acenteno@uthsc.edu" target="_blank">Arthur Centeno</A>. Design and code by Sam Ockman, Xiaodong Zhou, Christian Fernandez, Ning Liu, Rudi Alberts, Elissa Chesler, Jintao Wang, Kenneth Manly, Robert W. Williams, and <A class="smallsize" HREF="/credit.html">colleagues</A>.
-
-
- </TD>
- <TD align="right">
- <A HREF="http://www.python.org/" target="_blank">
- <IMG src="/images/upload/PythonLogo.png" alt="Python Powered" border="0"></A>
- </TD>
- <TD align="right">
- <A HREF="http://www.neuinfo.org" target="_blank">
- <img src="/images/upload/Nif.png" alt="Registered with Nif" border="0"></A>
- </TD>
-</TR>
-<TR>
-
-<!-- GENENETWORK SUPPORTED BY -->
-
- <TD colspan=4 style="font-size:12px;font-family:verdana;color:black">
- GeneNetwork support from:
- <UL>
- <LI><a class="smallsize" target="_blank" href="http://citg.uthsc.edu">The UT Center for Integrative and Translational Genomics</A>
- <LI><a class="smallsize" target="_blank" href="http://www.iniastress.org">NIAAA</A> Integrative Neuroscience Initiative on Alcoholism (U01AA13499, U24AA13513, U01AA014425)
- <LI><a class="smallsize" target="_blank" href="http://www.drugabuse.gov/about/organization/Genetics/geneexpression/index.html">NIDA</A>, <a class="smallsize" target="_blank" href="http://www.nimh.nih.gov/">NIMH</A>, and <a class="smallsize" target="_blank" href="http://www.niaaa.nih.gov/">NIAAA</A> (P20-DA 21131)
- <LI>NCI <a class="smallsize" target="_blank" href="http://emice.nci.nih.gov/">MMHCC</A> (U01CA105417), <a class="smallsize" target="_blank" href="http://www.ncrr.nih.gov/">NCRR</A> <a class="smallsize" target="_blank" href="http://www.nbirn.net/TestBeds/Mouse/index.htm">BIRN</A>, (U24 RR021760)
- </UL>
- </TD>
-</TR>
-<TR>
- <TD colspan=4 id="smallsize" align="left">
- &nbsp;&nbsp;&nbsp;&nbsp;It took 0.011 second(s) for spring211.uthsc.edu to generate this page
- </TD>
-</TR></table>
- </td>
- </TR>
- <!-- End of footer -->
-</TABLE>
-
-<!-- menu script itself. you should not modify this file -->
-<script language="JavaScript" src="/javascript/menu_new.js"></script>
-<!-- items structure. menu hierarchy and links are stored there -->
-<script language="JavaScript" src="/javascript/menu_items.js"></script>
-<!-- files with geometry and styles structures -->
-<script language="JavaScript" src="/javascript/menu_tpl.js"></script>
-<script language="JavaScript">
- <!--//
- // Note where menu initialization block is located in HTML document.
- // Don't try to position menu locating menu initialization block in
- // some table cell or other HTML element. Always put it before </body>
- // each menu gets two parameters (see demo files)
- // 1. items structure
- // 2. geometry structure
- new menu (MENU_ITEMS, MENU_POS);
- // make sure files containing definitions for these variables are linked to the document
- // if you got some javascript error like "MENU_POS is not defined", then you've made syntax
- // error in menu_tpl.js file or that file isn't linked properly.
-
- // also take a look at stylesheets loaded in header in order to set styles
- //-->
-</script>
-</BODY>
-</HTML>
+{% endblock %}
diff --git a/wqflask/wqflask/templates/trait_data_and_analysis.html b/wqflask/wqflask/templates/trait_data_and_analysis.html
index efd87acc..c27ab092 100644
--- a/wqflask/wqflask/templates/trait_data_and_analysis.html
+++ b/wqflask/wqflask/templates/trait_data_and_analysis.html
@@ -295,7 +295,7 @@
<tr align="right">
<td class="fs13 b1 cbw c222" nowrap="yes" align="left">Mean</td>
- <td class="fs13 b1 cbw c222" nowrap="yes">{{ "%2.3f" % sd.traitmean }}</td>
+ <td class="fs13 b1 cbw c222" nowrap="yes" id="mean_value">{{ "%2.3f" % sd.traitmean }}</td>
</tr>
<tr align="right">
@@ -3047,7 +3047,7 @@
{% for strain_type in (primary_strains, other_strains) %}
<div id="{{ strain_type[0]['the_id'].lower().partition('_')[0] }}"> {# Slightly tortuous, but best way to get the id we need #}
- <table class="tablesorter"
+ <table class="not_tablesorter" {# Todo: Turn tablesorter back on #}
id="{{ 'sortable%i' % (loop.index) }}"
cellpadding="0" cellspacing="0">
<tr>
@@ -3063,18 +3063,19 @@
</tr>
{% for strain in strain_type %}
- <tr class="{{ strain.outlier }}" id="{{ strain.the_id }}">
+ <tr class="{{ strain.outlier }} value_se" id="{{ strain.the_id }}">
<td class="fs13 b1 c222" align="right" width="45">
{{ loop.index }}
- <input type="checkbox" name="selectCheck" class="checkbox" value="{{ strain.strain_name }}">
+ <input type="checkbox" name="selectCheck" class="checkbox edit_strain_checkbox" value="{{ strain.strain_name }}">
</td>
<td class="fs13 b1 c222" align="right" width="100">
- <span class="fs14 fwn ffl">{{ strain.strain_name }}</span>
+ <span class="fs14 fwn ffl edit_strain_strain_name">{{ strain.strain_name }}</span>
</td>
- <td class="fs13 b1 c222" id="value_0_primary" align="right" width="70">
- <input type="text" name="{{ strain.strain_name }}" class="fs13 b1 c222 valueField"
+ {# Todo: Add IDs #}
+ <td class="fs13 b1 c222" align="right" width="70">
+ <input type="text" name="{{ strain.strain_name }}" class="fs13 b1 c222 edit_strain_value valueField"
value="{{ strain.value }}" size="8" maxlength="8"
style="text-align:right; background-color:#FFFFFF;">
</td>
@@ -3083,8 +3084,9 @@
±
</td>
- <td class="fs13 b1 c222" id="SE_0_primary" align="right" width="80">
- <input type="text" name=""{{ 'V' + strain.strain_name}}" class="fs13 b1 c222 valueField"
+ {# Todo: Add IDs #}
+ <td class="fs13 b1 c222" align="right" width="80">
+ <input type="text" name=""{{ 'V' + strain.strain_name}}" class="fs13 b1 c222 valueField edit_strain_se"
value="{{ strain.se }}"
size="8" maxlength="8" style="text-align:right"></td>
</tr>
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index a2c68f13..55d6ffe2 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -1,5 +1,7 @@
from __future__ import absolute_import, division, print_function
+import flask
+
from wqflask import app
from flask import render_template, request
@@ -13,6 +15,8 @@ from base import webqtlFormData
from pprint import pformat as pf
+print("latest blue")
+
@app.route("/")
def index_page():
return render_template("index_page.html")
@@ -21,12 +25,26 @@ def index_page():
@app.route("/search")
def search():
if 'info_database' in request.args:
- print("Going to data_sharing")
- data_sharing()
+ print("Going to sharing_info_page")
+ template_vars = sharing_info_page()
+ if template_vars.redirect_url:
+ return flask.redirect(template_vars.redirect_url)
+ else:
+ return render_template("data_sharing.html", **template_vars.__dict__)
else:
the_search = search_results.SearchResultPage(request.args)
return render_template("search_result_page.html", **the_search.__dict__)
+@app.route("/data_sharing")
+def data_sharing():
+ print("In data_sharing")
+ fd = webqtlFormData.webqtlFormData(request.args)
+ print("Have fd")
+ template_vars = SharingInfoPage.SharingInfoPage(fd)
+ print("Made it to rendering")
+ return template_vars
+
+
@app.route("/showDatabaseBXD")
def showDatabaseBXD():
# Here it's currently too complicated not to use an fd that is a webqtlFormData
@@ -35,11 +53,14 @@ def showDatabaseBXD():
print("showDatabaseBXD template_vars:", pf(template_vars.__dict__))
return render_template("trait_data_and_analysis.html", **template_vars.__dict__)
-#@app.route("/data_sharing")
-def data_sharing():
- print("In data_sharing")
+
+
+# Todo: Can we simplify this? -Sam
+def sharing_info_page():
+ print("In sharing_info_page")
fd = webqtlFormData.webqtlFormData(request.args)
print("Have fd")
+ print("SharingInfoPage is:", SharingInfoPage)
template_vars = SharingInfoPage.SharingInfoPage(fd)
print("Made it to rendering")
- return render_template("data_sharing.html", **template_vars.__dict__)
+ return template_vars