about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZachary Sloan2014-12-04 16:41:13 +0000
committerZachary Sloan2014-12-04 16:41:13 +0000
commite294826c979b18848d54c8e6bdd6c9131f78f1c7 (patch)
tree56c3c91564718b8f6a87b19c48ae1dfa57b691f2
parente2831ccf30b5f125f85c4dc90c1be7560796ee7e (diff)
downloadgenenetwork2-e294826c979b18848d54c8e6bdd6c9131f78f1c7.tar.gz
Added some pages for anonymous collections
-rw-r--r--wqflask/wqflask/templates/collections/not_logged_in.html23
-rw-r--r--wqflask/wqflask/templates/collections/remove.html48
-rw-r--r--wqflask/wqflask/templates/collections/view_anonymous.html143
3 files changed, 214 insertions, 0 deletions
diff --git a/wqflask/wqflask/templates/collections/not_logged_in.html b/wqflask/wqflask/templates/collections/not_logged_in.html
new file mode 100644
index 00000000..a4c8747e
--- /dev/null
+++ b/wqflask/wqflask/templates/collections/not_logged_in.html
@@ -0,0 +1,23 @@
+{% extends "base.html" %}
+{% block title %}Your Collections{% endblock %}
+{% block content %}
+<!-- Start of body -->
+    {{ header("Not logged in") }}
+
+
+    <div id "collections_holder" class="container">
+        <div class="page-header">
+            <h1>Please log in in order to use this feature.</h1>
+        </div>
+    </div>
+
+<!-- End of body -->
+
+{% endblock %}
+
+{% block js %}
+    <script type="text/javascript" src="/static/packages/smart-time-ago/lib/timeago.js"></script>
+    <script>
+        $('body').timeago();
+    </script>
+{% endblock %}
diff --git a/wqflask/wqflask/templates/collections/remove.html b/wqflask/wqflask/templates/collections/remove.html
new file mode 100644
index 00000000..faee4f78
--- /dev/null
+++ b/wqflask/wqflask/templates/collections/remove.html
@@ -0,0 +1,48 @@
+<div id="myModal">
+    <div class="modal-header">
+        <h3>Add to collection</h3>
+        <p>You have three choices: Use your default collection, create a new named collection,
+        or add the traits to an existing collection.</p>
+    </div>
+    <div class="modal-body">
+        <form action="/collections/new" data-validate="parsley" id="add_form">
+            <fieldset>
+                <legend>Use your default collection</legend>
+                <span class="help-block">Choose this if you're in a hurry or don't plan on using the collection again.</span>
+                <span class="help-block"><em></em>If you are unsure this is probably the option you want.</em></span>
+                <button type="submit" name="Default" class="btn">Continue</button>
+            </fieldset>
+            <hr />
+
+
+            <input type="hidden" name="traits" value="{{ traits }}" />
+            <fieldset>
+                <legend>Or create a new named collection</legend>
+                <label>New collection name</label>
+                <input type="text" name="new_collection" placeholder="Name of new collection..."
+                    data-trigger="change" data-minlength="5" data-maxlength="50">
+                <span class="help-block">Type the name of the new collection.</span>
+                <button type="submit" name="create_new" class="btn">Create and add traits</button>
+            </fieldset>
+
+            <hr />
+            <fieldset>
+                <legend>Or add to an existing collection</legend>
+                <label>Existing collection name</label>
+
+                <select name="existing_collection" class="form-control">
+                {% for col in user_collections %}
+                    <option value="{{ col.id }}">{{ col.name }}</option>
+                {% endfor %}
+                </select>
+                <br />
+
+                <button type="submit" name="add_to_existing" class="btn">Add to existing collection</button>
+            </fieldset>
+        </form>
+    </div>
+</div>
+
+<script>
+    $('#add_form').parsley();
+</script>
diff --git a/wqflask/wqflask/templates/collections/view_anonymous.html b/wqflask/wqflask/templates/collections/view_anonymous.html
new file mode 100644
index 00000000..56323e10
--- /dev/null
+++ b/wqflask/wqflask/templates/collections/view_anonymous.html
@@ -0,0 +1,143 @@
+{% extends "base.html" %}
+{% block title %}View Collection{% endblock %}
+{% block content %}
+<!-- Start of body -->
+    {% if uc %}
+        {{ header(uc.name,
+            'This collection has {}.'.format(numify(trait_obs|count, "record", "records"))) }}
+    {% else %}
+        {{ header('Your Collection',
+            'This collection has {}.'.format(numify(trait_obs|count, "record", "records"))) }}
+    {% endif %}
+    <div class="container">
+        <div class="page-header">
+            <h1>Your Collection</h1>
+            {% if uc %}
+            <h2>{{ uc.name }}</h2>
+            {% endif %}
+
+            <div class="form-group">
+            <form action="/collections/delete" method="post">
+                {% if uc %}
+                <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" />
+                {% endif %}
+                <div class="col-xs-3 controls">
+                    <input type="submit" class="btn btn-danger" value="Delete this collection" />
+                </div>
+            </form>
+            <form action="/corr_matrix" method="post">
+                {% if uc %}
+                <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" />
+                {% endif %}
+                <input type="hidden" name="trait_list" id="trait_list" value= "
+                {% for this_trait in trait_obs %}
+                    {{ this_trait.name }}:{{ this_trait.dataset.name }},
+                {% endfor %}" >
+                <div class="col-xs-2 controls">
+                    <input type="submit" class="btn btn-primary" value="Correlation Matrix" />
+                </div>
+            </form>
+            <form action="/heatmap" method="post">
+                {% if uc %}
+                <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" />
+                {% endif %}
+                <input type="hidden" name="trait_list" id="trait_list" value= "
+                {% for this_trait in trait_obs %}
+                    {{ this_trait.name }}:{{ this_trait.dataset.name }},
+                {% endfor %}" >
+                <div class="col-xs-2 controls">
+                    <input type="submit" class="btn btn-primary" value="Heatmap" />
+                </div>
+            </form>
+            </div>
+
+            <!--
+            <form action="/corr_matrix" method="post">
+                {% if uc %}
+                <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" />
+                {% endif %}
+                <input type="hidden" name="trait_list" id="trait_list" value= "
+                {% for this_trait in trait_obs %}
+                    {{ this_trait.name }}:{{ this_trait.dataset.name }},
+                {% endfor %}" >
+                <input type="submit"
+                       class="btn btn-small"
+                       value="Correlation Matrix" />
+            </form>
+            <form action="/heatmap" method="post">
+                {% if uc %}
+                <input type="hidden" name="uc_id" id="uc_id" value="{{ uc.id }}" />
+                {% endif %}
+                <input type="hidden" name="trait_list" id="trait_list" value= "
+                {% for this_trait in trait_obs %}
+                    {{ this_trait.name }}:{{ this_trait.dataset.name }},
+                {% endfor %}" >
+                <input type="submit"
+                       class="btn btn-small"
+                       value="Heatmap" />
+            </form>
+            -->
+        </div>
+
+
+
+        <div class="bs-docs-example">
+        <table class="table table-hover" id='trait_table'>
+            <thead>
+                <tr>
+                    <th></th>
+                    <th>Record</th>
+                    <th>Description</th>
+                    <th>Location</th>
+                    <th>Mean</th>
+                    <th>Max LRS</th>
+                    <th>Max LRS Location</th>
+                </tr>
+            </thead>
+
+            <tbody>
+                {% for this_trait in trait_obs %}
+                <TR id="trait:{{ this_trait.name }}:{{ this_trait.dataset.name }}">
+                    <TD>
+                        <INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox"
+                               VALUE="{{ data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) }}">
+                    </TD>
+                    <TD>
+                        <a href="{{ url_for('show_trait_page',
+                                trait_id = this_trait.name,
+                                dataset = this_trait.dataset.name
+                                )}}">
+                            {{ this_trait.name }}
+                        </a>
+                    </TD>
+
+                    <TD>{{ this_trait.description_display }}</TD>
+                    <TD>{{ this_trait.location_repr }}</TD>
+                    <TD>{{ this_trait.mean }}</TD>
+                    <TD>{{ this_trait.LRS_score_repr }}</TD>
+                    <TD>{{ this_trait.LRS_location_repr }}</TD>
+
+                </TR>
+            {% endfor %}
+            </tbody>
+
+        </table>
+
+        <br />
+
+        <button class="btn" id="select_all"><i class="icon-ok"></i> Select All</button>
+        <button class="btn" id="deselect_all"><i class="icon-remove"></i> Deselect All</button>
+        <button class="btn" id="invert"><i class="icon-resize-vertical"></i> Invert</button>
+        <button class="btn" id="add" disabled="disabled"><i class="icon-plus-sign"></i> Add Record to Other Collection</button>
+        <button class="btn" id="remove" disabled="disabled"><i class="icon-minus-sign"></i> Remove Record</button>
+        <button class="btn btn-primary pull-right"><i class="icon-download icon-white"></i> Download Table</button>
+        </div>
+    </div>
+
+<!-- End of body -->
+
+{% endblock %}
+
+{% block js %}
+    <script type="text/javascript" src="/static/new/javascript/search_results.js"></script>
+{% endblock %}