From 7d712743f32e7c091b9ca543e705437d178b92c0 Mon Sep 17 00:00:00 2001 From: guimoz Date: Mon, 30 Jan 2017 02:16:13 +0100 Subject: [PATCH] Le JS doit etre dans les layout pour etre render correctement --- static/javascript.js | 43 ---------------------------- templates/layout.html | 47 ++++++++++++++++++++++++++++++- templates/layout_banned.html | 45 +++++++++++++++++++++++++++++ templates/layout_precampagne.html | 45 +++++++++++++++++++++++++++++ 4 files changed, 136 insertions(+), 44 deletions(-) diff --git a/static/javascript.js b/static/javascript.js index b35dd39..756d4e4 100644 --- a/static/javascript.js +++ b/static/javascript.js @@ -14,46 +14,3 @@ function startTimer(duration, display) { } }, 1000); } - -$(function () { - Highcharts.chart('container', { - chart: { - plotBackgroundColor: null, - plotBorderWidth: 0, - plotShadow: false - }, - title: { - text: 'Etat du Rezo', - align: 'center', - verticalAlign: 'middle', - y: 40 - }, - tooltip: { - pointFormat: '{series.name}: {point.percentage:.1f}%' - }, - plotOptions: { - pie: { - dataLabels: { - enabled: true, - distance: -50, - style: { - fontWeight: 'bold', - color: 'white' - } - }, - startAngle: -90, - endAngle: 90, - center: ['50%', '75%'] - }, - }, - series: [{ - type: 'pie', - name: 'Etat du Rezo', - innerSize: '50%', - data: [ - ['Tranchés', {{ stats[0] }}], - ['Vivants', {{ stats[1] }}] - ] - }] - }); -}); diff --git a/templates/layout.html b/templates/layout.html index eb3acc9..a454c5a 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -40,8 +40,53 @@
-
+
+ diff --git a/templates/layout_banned.html b/templates/layout_banned.html index 15bb958..e71bcca 100644 --- a/templates/layout_banned.html +++ b/templates/layout_banned.html @@ -42,5 +42,50 @@
+ diff --git a/templates/layout_precampagne.html b/templates/layout_precampagne.html index 8133223..e4e7a9d 100644 --- a/templates/layout_precampagne.html +++ b/templates/layout_precampagne.html @@ -40,5 +40,50 @@
+