Modification du style
This commit is contained in:
parent
2b20eb9a0d
commit
a26e10963c
13 changed files with 59 additions and 42 deletions
14
roulette.py
14
roulette.py
|
@ -209,7 +209,7 @@ def get_players_not_banned():
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
not_banned = [{'id': row[0], 'firstname': row[1], 'name': row[2]} for row in rows]
|
not_banned = [{'id': row[0], 'firstname': row[1], 'name': row[2]} for row in rows]
|
||||||
|
|
||||||
# Ensuite on applique les règles d'immunité
|
# Ensuite on applique les règles d'immunité
|
||||||
with open(IMMUNITY_FILE, 'r') as f:
|
with open(IMMUNITY_FILE, 'r') as f:
|
||||||
immunity = f.read()
|
immunity = f.read()
|
||||||
|
@ -300,10 +300,10 @@ def banned():
|
||||||
|
|
||||||
if last_ban['target_id'] == player['id'] and last_ban['success'] == 1:
|
if last_ban['target_id'] == player['id'] and last_ban['success'] == 1:
|
||||||
source = get_player(last_ban['player_id'])
|
source = get_player(last_ban['player_id'])
|
||||||
explanation = u'Tu t\'es fait bannir par %s %s.' \
|
explanation = u'Tu t\'es fait trancher par %s %s.' \
|
||||||
% (source['firstname'], source['name'])
|
% (source['firstname'], source['name'])
|
||||||
else:
|
else:
|
||||||
explanation = u'Tu t\'es banni toi-même, pas de chance...'
|
explanation = u'Tu t\'es tranché toi-même, pas de chance...'
|
||||||
|
|
||||||
timeleft = duration_format(int(player['ban_end'] - time()))
|
timeleft = duration_format(int(player['ban_end'] - time()))
|
||||||
|
|
||||||
|
@ -356,14 +356,14 @@ def home():
|
||||||
entry = ('ban', u'%s : %s %s a réussi à t\'avoir.' \
|
entry = ('ban', u'%s : %s %s a réussi à t\'avoir.' \
|
||||||
% (date, source['firstname'], source['name']))
|
% (date, source['firstname'], source['name']))
|
||||||
else:
|
else:
|
||||||
entry = ('warn', u'%s : %s %s a essayé de te bannir, en vain.' \
|
entry = ('warn', u'%s : %s %s a essayé de te trancher, en vain.' \
|
||||||
% (date, source['firstname'], source['name']))
|
% (date, source['firstname'], source['name']))
|
||||||
else:
|
else:
|
||||||
if ban['success']:
|
if ban['success']:
|
||||||
entry = ('ok', u'%s : Tu as banni %s %s avec succès.' \
|
entry = ('ok', u'%s : Tu as tranché %s %s avec succès.' \
|
||||||
% (date, target['firstname'], target['name']))
|
% (date, target['firstname'], target['name']))
|
||||||
else:
|
else:
|
||||||
entry = ('ban', u'%s : Tu as échoué en voulant bannir %s %s.' \
|
entry = ('ban', u'%s : Tu as échoué en voulant trancher %s %s.' \
|
||||||
% (date, target['firstname'], target['name']))
|
% (date, target['firstname'], target['name']))
|
||||||
|
|
||||||
bans_hist.append(entry)
|
bans_hist.append(entry)
|
||||||
|
@ -381,7 +381,7 @@ def play():
|
||||||
target_id = request.form['target_id']
|
target_id = request.form['target_id']
|
||||||
if target_id != 'none':
|
if target_id != 'none':
|
||||||
if is_banned(target_id):
|
if is_banned(target_id):
|
||||||
flash(u'Utilisateur déjà banni, il faut en choisir un autre.')
|
flash(u'Utilisateur déjà tranché, il faut en choisir un autre.')
|
||||||
else:
|
else:
|
||||||
success = cheat(player['id'], target_id)
|
success = cheat(player['id'], target_id)
|
||||||
if success:
|
if success:
|
||||||
|
|
BIN
static/img/metzquetaires_or.png
Normal file
BIN
static/img/metzquetaires_or.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
static/img_red/metzquetaires_or.png
Normal file
BIN
static/img_red/metzquetaires_or.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
16
static/javascript.js
Normal file
16
static/javascript.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
function startTimer(duration, display) {
|
||||||
|
var timer = duration, minutes, seconds;
|
||||||
|
setInterval(function () {
|
||||||
|
minutes = parseInt(timer / 60, 10)
|
||||||
|
seconds = parseInt(timer % 60, 10);
|
||||||
|
|
||||||
|
minutes = minutes < 10 ? "0" + minutes : minutes;
|
||||||
|
seconds = seconds < 10 ? "0" + seconds : seconds;
|
||||||
|
|
||||||
|
display.textContent = minutes + ":" + seconds;
|
||||||
|
|
||||||
|
if (--timer < 0) {
|
||||||
|
timer = duration;
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ a {
|
||||||
|
|
||||||
#banner {
|
#banner {
|
||||||
height: 101px;
|
height: 101px;
|
||||||
background: center center url('img/asocial_metzwork_v1.png') no-repeat;
|
background: center center url('img/metzquetaires_or.png') no-repeat;
|
||||||
padding: 10px 10px;
|
padding: 10px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ a {
|
||||||
|
|
||||||
#banner {
|
#banner {
|
||||||
height: 101px;
|
height: 101px;
|
||||||
background: center center url('img_red/asocial_metzwork_v1.png') no-repeat;
|
background: center center url('img_red/metzquetaires_or.png') no-repeat;
|
||||||
padding: 10px 10px;
|
padding: 10px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{% extends "layout_banned.html" %}
|
{% extends "layout_banned.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Tu es tranché</h1>
|
<h1>Tu es tranché</h1>
|
||||||
<p>
|
<p>
|
||||||
{{ explanation }}
|
{{ explanation }}
|
||||||
</p>
|
</p>
|
||||||
|
@ -8,9 +8,25 @@
|
||||||
Rétablissement de la connexion externe dans approximativement :
|
Rétablissement de la connexion externe dans approximativement :
|
||||||
</p>
|
</p>
|
||||||
<p style="text-align: center">
|
<p style="text-align: center">
|
||||||
<strong>{{ timeleft }}</strong>.
|
<strong><span id="time"></span></strong>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
(redémarrer le navigateur peut être nécessaire une fois ce délai écoulé)
|
(redémarrer le navigateur peut être nécessaire une fois ce délai écoulé)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
var fiveMinutes = 60 * 5,
|
||||||
|
display = document.querySelector('#time');
|
||||||
|
startTimer(fiveMinutes, display);
|
||||||
|
};
|
||||||
|
|
||||||
|
<script type='text/javascript'>
|
||||||
|
window.onload = function () {
|
||||||
|
var fiveMinutes = 60 * 5,
|
||||||
|
display = document.querySelector('#time');
|
||||||
|
startTimer(fiveMinutes, display);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>24 heures</h1>
|
<h1>24 heures</h1>
|
||||||
<h2>Toi aussi, joue au rézoman !</h2>
|
<h2>Toi aussi, joue au rézoman !</h2>
|
||||||
<p>
|
<p>
|
||||||
Jusqu'à samedi 11h, tu peux essayer de trancher tes
|
Voici la rezo-roulette metzquetaire.
|
||||||
camarades pour 30 min.
|
|
||||||
</p>
|
</p>
|
||||||
<p id="play" style="text-align: center; font-size: 1.5em">
|
<p id="play" style="text-align: center; font-size: 1.5em">
|
||||||
<a href="{{url_for('play')}}">Jouer</a>
|
<a href="{{url_for('play')}}">Jouer</a>
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>asocial metzwork - 24h</title>
|
<title>Rezo-roulette Metzquetaires</title>
|
||||||
<meta http-equiv="content-type"
|
<meta http-equiv="content-type"
|
||||||
content="text/html;charset=utf-8" />
|
content="text/html;charset=utf-8" />
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" />
|
||||||
<link rel="shortcut icon" type="image/x-icon"
|
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
|
||||||
|
<link rel="shortcut icon" type="image/x-icon"
|
||||||
href="{{ url_for('static', filename='favicon.ico') }}" />
|
href="{{ url_for('static', filename='favicon.ico') }}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -29,14 +30,14 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
<div id="content_bottomleft" class="corner">
|
<div id="content_bottomleft" class="corner">
|
||||||
</div>
|
</div>
|
||||||
<div id="content_bottomright" class="corner">
|
<div id="content_bottomright" class="corner">
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">contact technique : detraz@crans.org</div>
|
<div id="footer">contact technique : roulette@metzquetaires.fr</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -2,12 +2,13 @@
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>asocial metzwork - 24h</title>
|
<title>Rezo-roulette Metzquetaires</title>
|
||||||
<meta http-equiv="content-type"
|
<meta http-equiv="content-type"
|
||||||
content="text/html;charset=utf-8" />
|
content="text/html;charset=utf-8" />
|
||||||
<meta http-equiv="refresh" content="20">
|
<meta http-equiv="refresh" content="20">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style_red.css') }}" />
|
<link rel="stylesheet" href="{{ url_for('static', filename='style_red.css') }}" />
|
||||||
<link rel="shortcut icon" type="image/x-icon"
|
<script type="text/javascript" src="{{ url_for('static', filename='javascript.js') }}"></script>
|
||||||
|
<link rel="shortcut icon" type="image/x-icon"
|
||||||
href="{{ url_for('static', filename='favicon.ico') }}" />
|
href="{{ url_for('static', filename='favicon.ico') }}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -30,14 +31,14 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
<div id="content_bottomleft" class="corner">
|
<div id="content_bottomleft" class="corner">
|
||||||
</div>
|
</div>
|
||||||
<div id="content_bottomright" class="corner">
|
<div id="content_bottomright" class="corner">
|
||||||
</div>
|
</div>
|
||||||
<div id="footer">contact technique : detraz@crans.org</div>
|
<div id="footer">contact technique : roulette@metzquetaires.fr</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
{% extends "layout.html" %}
|
|
||||||
{% block content %}
|
|
||||||
<h1>Login</h1>
|
|
||||||
{% if error %}<p class=error><strong>Error:</strong> {{ error }}{% endif %}
|
|
||||||
<form action="{{ url_for('login') }}" method=post>
|
|
||||||
|
|
||||||
<dl>
|
|
||||||
<dt>Identifiant :
|
|
||||||
<dd><input type=text name=username>
|
|
||||||
<dt>Mot de passe :
|
|
||||||
<dd><input type=password name=password>
|
|
||||||
<dd><input type=submit value=Login>
|
|
||||||
</dl>
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
|
|
@ -1,9 +1,9 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Vous n'êtes pas inscrit</h1>
|
<h1>Vous n'êtes pas inscrit</h1>
|
||||||
<p>
|
<p>
|
||||||
Si vous désirez participer malgré les risques que le jeu comporte, veuillez
|
Si vous désirez participer malgré les risques que le jeu comporte, veuillez
|
||||||
envoyer un email à detraz@crans.org .
|
envoyer un email à roulette@metzquetaires.fr .
|
||||||
(Vous ne pouvez pas jouer depuis Supélec)
|
(Vous ne pouvez pas jouer depuis Supélec)
|
||||||
</p>
|
</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>24 heures</h1>
|
|
||||||
<h2>Trancher un joueur</h2>
|
<h2>Trancher un joueur</h2>
|
||||||
<p>
|
<p>
|
||||||
Ta cible sera notifiée quelle que soit l'issue de ta tentative. Question
|
Ta cible sera notifiée quelle que soit l'issue de ta tentative. Question
|
||||||
|
|
Loading…
Reference in a new issue