Skip to content

Commit

Permalink
added help and popup
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed Sep 19, 2017
1 parent 9edec97 commit 655f0fa
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
19 changes: 18 additions & 1 deletion planet/controllers/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"neighborhood": "modals/help/neighborhood.html",
"hrr": "modals/help/hrr.html",
"blast": "modals/help/blast.html",
"pcc": "modals/help/pcc.html"}
"pcc": "modals/help/pcc.html",
"lowabundance": "modals/help/low_abundance.html"}

__POPUPS = {"lowabundance": "tooltips/low_abundance.html"}

help = Blueprint('help', __name__)

Expand All @@ -32,3 +35,17 @@ def help_topic(topic):
else:
abort(404)


@help.route('/popup/<topic>')
def help_popup(topic):
"""
Generic function to get help popups
:param topic: name of the topic
:return: renders template for the topic if found, 404 if not.
"""
if topic in __POPUPS.keys():
return render_template(__POPUPS[topic])
else:
abort(404)

2 changes: 1 addition & 1 deletion planet/templates/expression_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>Expression profile for: <strong>{{ profile.probe }}</strong></h1>

{% if profile.low_abundance %}
<br />
<span class="warning-message"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <strong>Attention:</strong> This gene has <strong>low abundance</strong>.</span>
<span class="warning-message"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <strong>Attention:</strong> This gene has <strong><abbr title="Click to show help" href="{{ url_for('help.help_topic', topic='lowabundance') }}" data-target="#helpModal">low abundance</abbr></strong>.</span>
<br /><br />
{% endif %}

Expand Down
12 changes: 12 additions & 0 deletions planet/templates/modals/help/low_abundance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel"><strong>Low (Transcript) Abundance</strong></h4>
</div>
<div class="modal-body" syle="width:700px;height:200px">
<p>Some transcripts have low abundance in all conditions in the expression profiles. For these genes, random
stochastic effects can cause sharp peaks in their profile. These are likely <strong>not</strong> biologically
relevant and should be interpreted with <strong>caution</strong>.</p>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
3 changes: 2 additions & 1 deletion planet/templates/search_specific_profiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ <h1><em>{{species.name}}</em> profiles specific for <strong>{{condition}}</stron
<td>{{ r.entropy|round(2) }}</td>
<td>{% if r.tau %}{{ r.tau|round(2) }}{% else %}<span class="text-muted">None</span>{% endif %}</td>
<td><a href="{{url_for('expression_profile.expression_profile_view', profile_id=r.profile_id)}}">view profile</a></td>
<td>{% if r.profile.low_abundance %}<span class="warning-message"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>{% endif %}</td>
<td>{% if r.profile.low_abundance %}<span class="warning-message qtip_tooltip"
qtip_href="{{ url_for('help.help_popup', topic='lowabundance') }}"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>{% endif %}</td>
</tr>
{% endif %}
{% endfor %}
Expand Down
7 changes: 7 additions & 0 deletions planet/templates/tooltips/low_abundance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div>
<div><strong>Low (Transcript) Abundance</strong></div>
<hr />
<p>Some transcripts have low abundance in all conditions in the expression profiles. For these genes, random
stochastic effects can cause sharp peaks in their profile. These are likely <strong>not</strong> biologically
relevant and should be interpreted with <strong>caution</strong>.</p>
</div>

0 comments on commit 655f0fa

Please sign in to comment.