diff --git a/db.py b/db.py index feb015b..5e9de69 100644 --- a/db.py +++ b/db.py @@ -306,6 +306,8 @@ class Game(db.Model): def restart_jeu(self): if (self.turn==0 and (self.atout=='' or self.atout is None)) or self.turn==N_TURN*N_PLAYERS: + if self.turn>0: + self.partie +=1 self.turn = -8 self.atout = None self.preneur = None @@ -315,8 +317,6 @@ class Game(db.Model): self.cumul_1 += self.points_1 self.points_0 = 0 self.points_1 = 0 - if self.turn>0: - self.partie +=1 self.first_player = 0 self.distribute() db.session.commit() diff --git a/static/game_script.js b/static/game_script.js index acd8c11..adc9083 100644 --- a/static/game_script.js +++ b/static/game_script.js @@ -154,7 +154,11 @@ var set_current_player = function(){ if(jeu['turn']==32 && jeu['admin']==jeu['players'][jeu['nr']]){ $('#suivant').show(); } - if(jeu['turn']==0 && (jeu['atout'] == null||jeu['atout']=='') && jeu['admin']==jeu['players'][jeu['nr']]){ + else if(jeu['turn']==0 && (jeu['atout'] == null||jeu['atout']=='') && jeu['admin']==jeu['players'][jeu['nr']]){ + $('#suivant').show(); + } + else + { $('#suivant').show(); } } diff --git a/templates/admin_games.html b/templates/admin_games.html index c62bc6e..a489184 100644 --- a/templates/admin_games.html +++ b/templates/admin_games.html @@ -6,7 +6,7 @@ {% block contenu %}
-
Ajouter un utilisateur +
Ajouter un jeu diff --git a/templates/base.html b/templates/base.html index 43b63a3..cedcf73 100644 --- a/templates/base.html +++ b/templates/base.html @@ -30,8 +30,10 @@ - {% if user.level > 9 %} + {% if user.level > 8 %} + {% endif %} + {% if user.level > 9 %} {% endif %} {% else %} diff --git a/templates/games.html b/templates/games.html index 04f48b9..f7db75f 100644 --- a/templates/games.html +++ b/templates/games.html @@ -15,6 +15,7 @@ {% endif %} {% if mesjeux|length > 0 %}
Mes jeux +
Recharger la liste des jeux
{% for g in mesjeux %}