clean some kfet templates

This commit is contained in:
Aurélien Delobelle 2017-04-02 05:17:26 +02:00
parent 55116f7179
commit 96597aa146
3 changed files with 43 additions and 39 deletions

View file

@ -13,12 +13,17 @@
{% if account.user == request.user %}
<script type="text/javascript" src="{% static 'kfet/js/Chart.bundle.js' %}"></script>
<script type="text/javascript" src="{% static 'kfet/js/statistic.js' %}"></script>
<script>
jQuery(document).ready(function() {
var stat_last = new StatsGroup("{% url 'kfet.account.stat.last' trigramme=account.trigramme %}",
$("#stat_last"));
var stat_balance = new StatsGroup("{% url 'kfet.account.stat.balance' trigramme=account.trigramme %}",
$("#stat_balance"));
<script type="text/javascript">
$(document).ready(function() {
var stat_last = new StatsGroup(
"{% url 'kfet.account.stat.last' trigramme=account.trigramme %}",
$("#stat_last"),
);
var stat_balance = new StatsGroup(
"{% url 'kfet.account.stat.balance' trigramme=account.trigramme %}",
$("#stat_balance"),
);
});
</script>
{% endif %}
@ -66,22 +71,22 @@
{% if account.user == request.user %}
<div class="content-right-block content-right-block-transparent">
<h2>Statistiques</h2>
<div class="row">
<div class="col-sm-12 nopadding">
<div class="panel-md-margin">
<h3>Ma balance</h3>
<div id="stat_balance" class"stat-graph"></div>
</div>
<div class="row">
<div class="col-sm-12 nopadding">
<div class="panel-md-margin">
<h3>Ma balance</h3>
<div id="stat_balance" class"stat-graph"></div>
</div>
</div><!-- /row -->
<div class="row">
<div class="col-sm-12 nopadding">
<div class="panel-md-margin">
<h3>Ma consommation</h3>
<div id="stat_last" class"stat-graph"></div>
</div>
</div>
</div><!-- /row -->
<div class="row">
<div class="col-sm-12 nopadding">
<div class="panel-md-margin">
<h3>Ma consommation</h3>
<div id="stat_last" class"stat-graph"></div>
</div>
</div><!-- /row -->
</div>
</div><!-- /row -->
</div>
{% endif %}
<div class="content-right-block">

View file

@ -1,5 +0,0 @@
{% if account.user == request.user %}
Mon compte
{% else %}
Informations du compte {{ account.trigramme }}
{% endif %}

View file

@ -1,6 +1,11 @@
{% extends 'kfet/base.html' %}
{% load staticfiles %}
{% block extra_head %}
<script type="text/javascript" src="{% static 'kfet/js/Chart.bundle.js' %}"></script>
<script type="text/javascript" src="{% static 'kfet/js/statistic.js' %}"></script>
{% endblock %}
{% block title %}Informations sur l'article {{ article }}{% endblock %}
{% block content-header-title %}Article - {{ article.name }}{% endblock %}
@ -82,27 +87,26 @@
</div>
<div class="content-right-block content-right-block-transparent">
<h2>Statistiques</h2>
<div class="row">
<div class="col-sm-12 nopadding">
<div class="panel-md-margin">
<h3>Ventes de {{ article.name }}</h3>
<div id="stat_last"></div>
</div>
<div class="row">
<div class="col-sm-12 nopadding">
<div class="panel-md-margin">
<h3>Ventes de {{ article.name }}</h3>
<div id="stat_last"></div>
</div>
</div><!-- /row -->
</div>
</div><!-- /row -->
</div>
</div>
</div>
</div>
{% endblock %}
{% block extra_head %}
<script type="text/javascript" src="{% static 'kfet/js/Chart.bundle.js' %}"></script>
<script type="text/javascript" src="{% static 'kfet/js/statistic.js' %}"></script>
<script>
jQuery(document).ready(function() {
var stat_last = new StatsGroup("{% url 'kfet.article.stat.last' article.id %}",
$("#stat_last"));
<script type="text/javascript">
$(document).ready(function() {
var stat_last = new StatsGroup(
"{% url 'kfet.article.stat.last' article.id %}",
$("#stat_last"),
);
});
</script>
{% endblock %}