From c612d929babd199c5cf2a25ce6d119a5efd0158e Mon Sep 17 00:00:00 2001
From: guimoz
Date: Mon, 30 Jan 2017 02:02:12 +0100
Subject: [PATCH] Deplacement du graphe numero 200
---
roulette.py | 4 +--
static/javascript.js | 43 +++++++++++++++++++++++++++++
templates/home.html | 46 -------------------------------
templates/layout.html | 1 +
templates/layout_banned.html | 1 +
templates/layout_precampagne.html | 1 +
6 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/roulette.py b/roulette.py
index fd903fa..9974744 100644
--- a/roulette.py
+++ b/roulette.py
@@ -395,9 +395,9 @@ def home():
def play():
ip = get_ip()
player = get_player_from_ip(ip)
- if STATE == "down":
+ if "down" in STATE:
return render_template('down.html', user=player)
- elif STATE == "launched":
+ elif "up" in STATE:
# Traitement de la requête de bannissement
if request.method == 'POST':
target_id = request.form['target_id']
diff --git a/static/javascript.js b/static/javascript.js
index 756d4e4..b35dd39 100644
--- a/static/javascript.js
+++ b/static/javascript.js
@@ -14,3 +14,46 @@ 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/home.html b/templates/home.html
index e4cbac1..dd93226 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -20,50 +20,4 @@
{% endif %}
-
-
-
{% endblock %}
diff --git a/templates/layout.html b/templates/layout.html
index 58b02cb..eb3acc9 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -40,6 +40,7 @@
+