created MultipleChartsView
This commit is contained in:
@@ -1,5 +1,2 @@
|
||||
<div class="row text-center" id="wrapper-{{ chart.get_html_id}}">
|
||||
<div id="{{ chart.get_html_id }}" style="width: {{ chart.width }}px; height: {{ chart.height }}px;"></div>
|
||||
<a class="btn btn-sm btn-default" href="#" id="image-{{ chart.get_html_id }}"><span class="glyphicon glyphicon-save-file"></span> Télécharger l'image</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation" {% active namespace="statistiques" viewname="pies" %}>
|
||||
<a href="{% url "statistiques:pies" %}?year={{year|default:0}}{% if month %}&month={{month}}{% endif %}">Typologie du public
|
||||
<span class="glyphicon glyphicon-adjust"></span>
|
||||
<a href="{% url "statistiques:pies" %}?year={{year|default:0}}{% if month %}&month={{month}}{% endif %}">Typologie
|
||||
<span class="glyphicon glyphicon-user"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li role="presentation" {% active namespace="statistiques" viewname="frequentation" %}>
|
||||
<a href="{% url "statistiques:frequentation" %}?year={{year|default:0}}{% if month %}&month={{month}}{% endif %}">Fréquentation
|
||||
<span class="glyphicon glyphicon-adjust"></span>
|
||||
<span class="glyphicon glyphicon-stats"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
43
statistiques/templates/statistiques/multiple_charts.html
Normal file
43
statistiques/templates/statistiques/multiple_charts.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% extends "statistiques/base.html" %}
|
||||
|
||||
{% block title %}{{block.super}} {{page_title}}{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}{{block.super}}<li>{{page_title}}</li>{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ block.super }}
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-body text-right">
|
||||
{% include "statistiques/filter_form.html" %}
|
||||
<hr />
|
||||
<p>Échantillon : {{ queryset_count }} objets</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_content %}
|
||||
<script type="text/javascript">
|
||||
function hideAll() {
|
||||
{% for _, graph in graphs %}{% with graph.get_html_id as id %}
|
||||
$("#tab-{{id}}").attr("class", "");
|
||||
$("#wrapper-{{id}}").hide();
|
||||
{% endwith %}{% endfor %}
|
||||
}
|
||||
|
||||
function showGraph(id) {
|
||||
hideAll();
|
||||
$("#tab-" + id).attr("class", "active");
|
||||
$("#wrapper-" + id).show();
|
||||
}
|
||||
</script>
|
||||
<ul class="nav nav-tabs">
|
||||
{% for title, graph in graphs %}<li role="presentation" id="tab-{{graph.get_html_id}}"><a href="#" onclick="showGraph('{{graph.get_html_id}}');">{{ title }}</a></li>{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% for title, graph in graphs %}
|
||||
<div class="row text-center" id="wrapper-{{ graph.get_html_id}}">
|
||||
{{ graph.as_html }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user