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()
|
||||
|
||||
not_banned = [{'id': row[0], 'firstname': row[1], 'name': row[2]} for row in rows]
|
||||
|
||||
|
||||
# Ensuite on applique les règles d'immunité
|
||||
with open(IMMUNITY_FILE, 'r') as f:
|
||||
immunity = f.read()
|
||||
|
@ -300,10 +300,10 @@ def banned():
|
|||
|
||||
if last_ban['target_id'] == player['id'] and last_ban['success'] == 1:
|
||||
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'])
|
||||
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()))
|
||||
|
||||
|
@ -356,14 +356,14 @@ def home():
|
|||
entry = ('ban', u'%s : %s %s a réussi à t\'avoir.' \
|
||||
% (date, source['firstname'], source['name']))
|
||||
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']))
|
||||
else:
|
||||
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']))
|
||||
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']))
|
||||
|
||||
bans_hist.append(entry)
|
||||
|
@ -381,7 +381,7 @@ def play():
|
|||
target_id = request.form['target_id']
|
||||
if target_id != 'none':
|
||||
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:
|
||||
success = cheat(player['id'], target_id)
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ a {
|
|||
|
||||
#banner {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "layout_banned.html" %}
|
||||
{% block content %}
|
||||
<h1>Tu es tranché</h1>
|
||||
<h1>Tu es tranché</h1>
|
||||
<p>
|
||||
{{ explanation }}
|
||||
</p>
|
||||
|
@ -8,9 +8,25 @@
|
|||
Rétablissement de la connexion externe dans approximativement :
|
||||
</p>
|
||||
<p style="text-align: center">
|
||||
<strong>{{ timeleft }}</strong>.
|
||||
<strong><span id="time"></span></strong>.
|
||||
</p>
|
||||
<p>
|
||||
(redémarrer le navigateur peut être nécessaire une fois ce délai écoulé)
|
||||
</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 %}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<h1>24 heures</h1>
|
||||
<h1>24 heures</h1>
|
||||
<h2>Toi aussi, joue au rézoman !</h2>
|
||||
<p>
|
||||
Jusqu'à samedi 11h, tu peux essayer de trancher tes
|
||||
camarades pour 30 min.
|
||||
Voici la rezo-roulette metzquetaire.
|
||||
</p>
|
||||
<p id="play" style="text-align: center; font-size: 1.5em">
|
||||
<a href="{{url_for('play')}}">Jouer</a>
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>asocial metzwork - 24h</title>
|
||||
<meta http-equiv="content-type"
|
||||
<title>Rezo-roulette Metzquetaires</title>
|
||||
<meta http-equiv="content-type"
|
||||
content="text/html;charset=utf-8" />
|
||||
<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') }}" />
|
||||
</head>
|
||||
|
||||
|
@ -29,14 +30,14 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<div id="content_bottomleft" class="corner">
|
||||
</div>
|
||||
<div id="content_bottomright" class="corner">
|
||||
</div>
|
||||
<div id="footer">contact technique : detraz@crans.org</div>
|
||||
<div id="footer">contact technique : roulette@metzquetaires.fr</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>asocial metzwork - 24h</title>
|
||||
<meta http-equiv="content-type"
|
||||
<title>Rezo-roulette Metzquetaires</title>
|
||||
<meta http-equiv="content-type"
|
||||
content="text/html;charset=utf-8" />
|
||||
<meta http-equiv="refresh" content="20">
|
||||
<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') }}" />
|
||||
</head>
|
||||
|
||||
|
@ -30,14 +31,14 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<div id="content_bottomleft" class="corner">
|
||||
</div>
|
||||
<div id="content_bottomright" class="corner">
|
||||
</div>
|
||||
<div id="footer">contact technique : detraz@crans.org</div>
|
||||
<div id="footer">contact technique : roulette@metzquetaires.fr</div>
|
||||
</div>
|
||||
</div>
|
||||
</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" %}
|
||||
{% block content %}
|
||||
<h1>Vous n'êtes pas inscrit</h1>
|
||||
<h1>Vous n'êtes pas inscrit</h1>
|
||||
<p>
|
||||
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)
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<h1>24 heures</h1>
|
||||
<h2>Trancher un joueur</h2>
|
||||
<p>
|
||||
Ta cible sera notifiée quelle que soit l'issue de ta tentative. Question
|
||||
|
|
Loading…
Reference in a new issue