Skip to content

Commit

Permalink
feat(report): allow section without feature toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed May 23, 2022
1 parent 44ce81c commit 486472d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion popmon/visualization/templates/card.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="col-md-{% if 'full_width' in metric %}12{% else %}6{% endif %} mb-5">
<a name="{{ feature.name }}-{{ metric.name }}"></a>
<a name="{% if feature%}{{ feature.name }}-{%endif%}{{ metric.name }}"></a>
<div class="card shadow-sm">
<div class="card-body" style="text-align: center">
<h4 class="card-title">{{metric.name | fmt_metric}}</h4>
Expand Down
31 changes: 21 additions & 10 deletions popmon/visualization/templates/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<div class="d-flex justify-content-between align-items-center">
<h2>{{ section_title }}</h2>
{% if features | length %}
<div class="dropdown feature-select">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Feature: {{ features[0].name }}
Expand All @@ -13,20 +14,30 @@ <h2>{{ section_title }}</h2>
{% endfor %}
</div>
</div>
{% endif %}
</div>
<hr>
{% if section_description|length %}
<div class="section-description">{{section_description}}</div><hr>
{% endif %}
{% for feature in features %}
<div class="row section_feature" data-section-feature="{{ feature.name }}">
{% for metric in feature.plots %}
{% with metric=metric %}
{% include 'card.html' %}
{% endwith %}
{% endfor %}
</div>
{% endfor %}

{% if features | length %}
{% for feature in features %}
<div class="row section_feature" data-section-feature="{{ feature.name }}">
{% for metric in feature.plots %}
{% with metric=metric %}
{% include 'card.html' %}
{% endwith %}
{% endfor %}
</div>
{% endfor %}
{% else %}
<div class="row" >
{% for metric in plots %}
{% with metric=metric %}
{% include 'card.html' %}
{% endwith %}
{% endfor %}
</div>
{% endif %}
</div>
</section>

0 comments on commit 486472d

Please sign in to comment.