Browse Source

Layout home / Chart.js

master
root 8 years ago
parent
commit
13631616a7
  1. 0
      .gitignore
  2. 0
      README
  3. 3
      assholes
  4. 0
      dump.sql
  5. 0
      import_bdd.py
  6. 0
      players.db.bak
  7. 3
      roulette.py
  8. 0
      roulette.wsgi
  9. 0
      schema.sql
  10. 0
      state
  11. 10
      static/Chart.min.js
  12. 0
      static/favicon
  13. 0
      static/favicon.ico
  14. 0
      static/highcharts-custom.js
  15. 0
      static/highcharts.js
  16. 0
      static/img/banner.svg
  17. 0
      static/javascript.js
  18. 0
      static/jquery-3.1.1.min.js
  19. 0
      static/style.cs
  20. 152
      static/style.css
  21. 0
      static/style_red.css
  22. 0
      templates/banned.html
  23. 0
      templates/down.html
  24. 131
      templates/home.html
  25. 58
      templates/layout.html
  26. 0
      templates/layout_banned.html
  27. 0
      templates/layout_precampagne.html
  28. 0
      templates/not_subscribed.html
  29. 0
      templates/play.html
  30. 0
      templates/precampagne.html
  31. 1
      test.txt

0
.gitignore

0
README

3
assholes

@ -1,5 +1,2 @@
Luc Absil
Matthieu Michelet
Clara Husson
Melchior Garapin
Benjamin Criton

0
dump.sql

0
import_bdd.py

0
players.db.bak

3
roulette.py

@ -434,7 +434,8 @@ def complete():
con = connect_sql()
cur = con.cursor()
cur.execute("""select id, firstname, name from players where
name like "{value}%" or firstname like "{value}%";""".format(value=v))
(name like "{value}%" or firstname like "{value}%")
and {time} > ban_end;""".format(value=v, time=time()))
rows = [[i[0], i[1]+' '+i[2]] for i in cur.fetchall()]
con.close()
return json.dumps(rows)

0
roulette.wsgi

0
schema.sql

0
state

10
static/Chart.min.js

File diff suppressed because one or more lines are too long

0
static/favicon

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

0
static/favicon.ico

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

0
static/highcharts-custom.js

0
static/highcharts.js

0
static/img/banner.svg

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

0
static/javascript.js

0
static/jquery-3.1.1.min.js

0
static/style.cs

152
static/style.css

@ -1,113 +1,123 @@
@import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono');
body {
background: #2ecc71;
color: white;
background: #d7ebff;
color: black;
text-align: center;
font-family: helvetica, sans;
font-family: 'Ubuntu Mono', monospace;
margin: 0;
}
a {
text-decoration: none;
color: grey;
.center {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
}
#body_bis {
margin-left: auto;
margin-right: auto;
width: 90%;
max-width: 1300px;
min-width: 550px;
a {
text-decoration: none;
color: black;
}
#banner {
height: 100px;
background: center center url('img/banner.svg') no-repeat;
padding: 10px 10px;
margin-bottom: 30px;
margin-top: 30px;
width: 75%;
max-width: 1000px;
margin: 32px;
}
#content_container {
margin-left: 200px;
margin-right: 200px;
position: relative;
#card {
margin: 32px auto;
padding: 32px 0 16px 0;
max-width: 600px;
background: white;
color: black;
padding-left: 12px;
padding-right: 12px;
padding-top: 10px;
padding-bottom: 10px;
border-radius:10px;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12),
0 1px 2px rgba(0, 0, 0, 0.24);
}
#content {
position: relative;
z-index: 5;
text-align: left;
@media screen and (max-width: 640px) {
#card {
width: 80%;
}
#banner {
margin: 32px 32px 0 32px;
}
}
#chart {
margin-bottom: 16px;
}
/* Contenu */
.sep {
width: 100%;
height: 1px;
background-color: #DADADA;
margin: 16px;
box-sizing: border-box;
}
#content h1 {
margin-top: 5px;
padding-left: 50px;
font-size: 130%;
.desc {
font-size: 18px;
margin: 16px 0;
padding: 0 16px;
}
#content h2, #content p {
margin-left: 20px;
margin-right: 20px;
#play {
width: 132px;
height: 54px;
font-size: 20px;
margin: 16px auto;
border-radius: 3px;
background-color: #9ce898;
font-weight: bold;
transition: all cubic-bezier(0.4, 0.0, 0.2, 1) 0.2s;
}
#content h2 {
margin-top:0px;
font-size: 100%;
margin-bottom: 5px;
padding-bottom: 0px;
#play:hover {
background-color: #7fd87b;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16),
0 3px 6px rgba(0, 0, 0, 0.23);
}
#content p {
text-indent: 2em;
margin-top: 0px;
font-size: 90%;
.title {
font-size: 24px;
}
#content ul#history {
padding-left: 60px;
#history {
margin: 16px;
padding: 0 16px;
list-style-type: decimal-leading-zero;
list-style-position: inside;
}
#content li.events {
font-size: 180%;
li {
text-align: left;
}
#content li .normal {
li .normal {
color: black;
font-size: 80%;
}
#content li.ban {
li.ban {
color: red;
}
#content li.warn {
li.warn {
color: orange;
}
#content li.ok {
li.ok {
color: #1D1;
}
#content_container #footer {
margin-top: 4em;
font-size: 70%;
}
p#play {
text-align: center;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.6em;
margin-bottom: 2em;
text-align: center;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.6em;
margin-bottom: 2em;
}
p#play a {
@ -133,16 +143,6 @@ form#select {
text-align: center;
}
ul.flashes {
font-size: 80%;
font-weight: bold;
color: #222;
list-style-type: none;
padding: 0;
width: 90%;
margin: .5em auto;
}
ul.flashes li {
background: #2E2;
border: 1px solid #191;

0
static/style_red.css

0
templates/banned.html

0
templates/down.html

131
templates/home.html

@ -1,77 +1,62 @@
{% extends "layout.html" %}
{% block content %}
<br>
<h2>Toi aussi abuse des pouvoirs du Rézo avec les Metzthernets !</h2>
<p id="play" style="text-align: center; font-size: 1.5em">
<a href="{{url_for('play')}}">Jouer</a>
</p>
{% extends "layout.html" %} {% block content %}
<canvas id="chart"></canvas>
<div id="container" style="min-width: 310px; max-width: 600px; margin: 0 auto"></div>
<h2>Historique personnel</h2>
<div class="sep"></div>
{% if bans_hist != [] %}
<ul id="history">
{% for entry in bans_hist %}
<li class="{{ entry[0] }}" class="events">
<span class="normal"> {{ entry[1] }}</span>
</li>
{% endfor %}
</ul>
{% else %}
<p>
Rien pour l'instant
</p>
<div class="desc">Toi aussi abuse des pouvoirs du Rézo avec les Metzthernets !</div>
{% endif %}
<script type="text/javascript">
$(function () {
Highcharts.chart('container', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: 'État du Rézo',
align: 'center',
verticalAlign: 'middle',
y: 60
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%']
},
},
series: [{
type: 'pie',
name: 'État du Rézo',
innerSize: '50%',
data: [
{
name: 'Tranchés',
y: {{ stats[0] }},
color: '#FF0000',
},{
name: 'Vivants',
y: {{ stats[1] }},
color: '#FFCC00',
}
]
}]
});
});
</script>
<a href="{{url_for('play')}}">
<div id="play" class="center">
JOUER
</div>
</a>
<div class="sep"></div>
<div class="desc title">Historique personnel</div>
{% if bans_hist != [] %}
<ul id="history">
{% for entry in bans_hist %}
<li class="{{ entry[0] }}" class="events">
<span class="normal">{{ entry[1] }}</span>
</li>
{% endfor %}
</ul>
{% else %}
<p>
Rien pour l'instant
</p>
{% endif %}
<div class="sep"></div>
<script type="text/javascript">
$(function () {
var ctx = document.getElementById("chart").getContext('2d');
var data = {
datasets: [{
data: [ {{ stats[0] }}, {{ stats[1] }} ],
backgroundColor: ['#ffd7d7', '#d7ebff']
}],
labels: ['Tranchés', 'Vivants']
};
var options = {
cutoutPercentage: 40,
rotation: -Math.PI,
circumference: Math.PI,
legend: { labels: { fontSize: 18 }},
tooltips: { bodyFontSize: 18 }
};
var chart = new Chart(ctx, {
type: 'doughnut',
data: data,
options: options
});
});
</script>
{% endblock %}

58
templates/layout.html

@ -1,38 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>Rézoroulette Metzthernet</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='highcharts.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='jquery-3.1.1.min.js') }}"></script>
<link rel="shortcut icon" type="image/x-icon"
href="{{ url_for('static', filename='favicon.ico') }}" />
</head>
<body>
<div id="body_bis">
<a href="/">
<div id="banner">
</div>
</a>
<head>
<title>Rézoroulette Metzthernet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='Chart.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='jquery-3.1.1.min.js') }}"></script>
<link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}" />
</head>
<div id="content_container">
<div id="content">
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
<body>
<a href="/">
<img id="banner" src="{{ url_for('static', filename='img/banner.svg') }}">
</a>
<div id="card">
<div id="content" class="center">
{% with messages = get_flashed_messages() %} {% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %} {% endwith %} {% block content %}{% endblock %}
</div>
<div id="footer">Contact technique : <a href="mailto:metzthernet@gmail.com">metzthernet@gmail.com</a></div>
<div id="footer">
<a href="mailto:metzthernet@gmail.com">metzthernet@gmail.com</a>
</div>
</div>
</div>
</body>
</html>

0
templates/layout_banned.html

0
templates/layout_precampagne.html

0
templates/not_subscribed.html

0
templates/play.html

0
templates/precampagne.html

1
test.txt

@ -0,0 +1 @@
This is only a test.
Loading…
Cancel
Save