Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cluster actions now uses macro (to avoid having the same code at thre…
…e different places )
  • Loading branch information
proost committed Dec 7, 2015
1 parent cbe4850 commit d430133
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
10 changes: 2 additions & 8 deletions planet/templates/go.html
Expand Up @@ -2,6 +2,7 @@

{% block container %}
{% import 'macros/sequence_pagination.html' as macro %}
{% import 'macros/cluster_actions.html' as ca %}
<div class="top-pad">

{% if go %}
Expand Down Expand Up @@ -47,14 +48,7 @@ <h1>{{ go.label }}: <strong>{{ go.name }}</strong> <small>({{ go.type }})</small
<td>{{ cluster.cluster_percentage|round(2) }} %</td>
<td>{{ cluster.p_value|round(6) }}</td>
<td>{{ cluster.corrected_p_value|round(6) }}</td>
<td><a href="{{ url_for('expression_cluster.expression_cluster_view', cluster_id=cluster.cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as table"><i class="fa fa-list"></i></a>
<a href="{{ url_for('expression_cluster.expression_cluster_graph', cluster_id=cluster.cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as graph"><i class="fa fa-share-alt"></i></a>
<a href="{{ url_for('profile_comparison.profile_comparison_cluster', cluster_id=cluster.cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="Compare profiles in this cluster"><i class="fa fa-area-chart"></i></a>
<a href="{{ url_for('heatmap.heatmap_cluster', cluster_id=cluster.cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="Heatmap of profiles in this cluster"><i class="fa fa-table"></i></a>
<td>{{ ca.cluster_actions(cluster.cluster.id) }}
</td>
</tr>
{% endif %}
Expand Down
10 changes: 10 additions & 0 deletions planet/templates/macros/cluster_actions.html
@@ -0,0 +1,10 @@
{% macro cluster_actions(cluster_id) -%}
<a href="{{ url_for('expression_cluster.expression_cluster_view', cluster_id=cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as table"><i class="fa fa-list"></i></a>
<a href="{{ url_for('expression_cluster.expression_cluster_graph', cluster_id=cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as graph"><i class="fa fa-share-alt"></i></a>
<a href="{{ url_for('profile_comparison.profile_comparison_cluster', cluster_id=cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="Compare profiles in this cluster"><i class="fa fa-area-chart"></i></a>
<a href="{{ url_for('heatmap.heatmap_cluster', cluster_id=cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="Heatmap of profiles in this cluster"><i class="fa fa-table"></i></a>
{%- endmacro %}
10 changes: 2 additions & 8 deletions planet/templates/search_enriched_clusters.html
@@ -1,6 +1,7 @@
{% extends 'base.html' %}

{% block container %}
{% import 'macros/cluster_actions.html' as ca %}
<div class="top-pad">


Expand Down Expand Up @@ -32,14 +33,7 @@ <h1>Search results</h1>
<td>{{ c.p_value|round(5) }}</td>
<td>{{ c.corrected_p_value|round(5) }}</td>
<td>
<a href="{{ url_for('expression_cluster.expression_cluster_view', cluster_id=c.cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as table"><i class="fa fa-list"></i></a>
<a href="{{ url_for('expression_cluster.expression_cluster_graph', cluster_id=c.cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as graph"><i class="fa fa-share-alt"></i></a>
<a href="{{ url_for('profile_comparison.profile_comparison_cluster', cluster_id=c.cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="Compare profiles in this cluster"><i class="fa fa-area-chart"></i></a>
<a href="{{ url_for('heatmap.heatmap_cluster', cluster_id=c.cluster_id) }}" data-toggle="tooltip"
data-placement="top" title="Heatmap of profiles in this cluster"><i class="fa fa-table"></i></a>
{{ ca.cluster_actions(c.cluster_id) }}
</td>
</tr>
{% endfor %}
Expand Down
10 changes: 2 additions & 8 deletions planet/templates/sequence.html
@@ -1,6 +1,7 @@
{% extends 'base.html' %}

{% block container %}
{% import 'macros/cluster_actions.html' as ca %}
<div class="top-pad">

{% if sequence %}
Expand Down Expand Up @@ -211,14 +212,7 @@ <h3>Sequence details</h3>
<td><strong data-toggle="tooltip"
data-placement="top" title="{{ cluster.method.method }}">{{ cluster.name }}</strong></td>
<td>
<a href="{{ url_for('expression_cluster.expression_cluster_view', cluster_id=cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as table"><i class="fa fa-list"></i></a>
<a href="{{ url_for('expression_cluster.expression_cluster_graph', cluster_id=cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="View cluster as graph"><i class="fa fa-share-alt"></i></a>
<a href="{{ url_for('profile_comparison.profile_comparison_cluster', cluster_id=cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="Compare profiles in this cluster"><i class="fa fa-area-chart"></i></a>
<a href="{{ url_for('heatmap.heatmap_cluster', cluster_id=cluster.id) }}" data-toggle="tooltip"
data-placement="top" title="Heatmap of profiles in this cluster"><i class="fa fa-table"></i></a>
{{ ca.cluster_actions(cluster.id) }}
</td>
</tr>
{% endfor %}
Expand Down

0 comments on commit d430133

Please sign in to comment.