Worlds: stop bets at midnight before the start of the competition
This commit is contained in:
@@ -66,6 +66,9 @@ class WorldsController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
authorize :world_bet
|
authorize :world_bet
|
||||||
|
|
||||||
|
if DateTime.now > Time.new(2026, 9, 16, 23, 59, 59, "+02:00")
|
||||||
|
redirect_to "/wjpc_bets/#{@lang}/new" and return
|
||||||
|
end
|
||||||
|
|
||||||
@world_bet = WorldBet.new(world_bet_params)
|
@world_bet = WorldBet.new(world_bet_params)
|
||||||
@world_bet.score = 0
|
@world_bet.score = 0
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
= render "worlds_nav"
|
= render "worlds_nav"
|
||||||
|
|
||||||
.alert.alert-warning role="alert"
|
- if DateTime.now > Time.new(2026, 9, 16, 23, 59, 59, "+02:00")
|
||||||
|
.alert.alert-warning role="alert"
|
||||||
|
= t("worlds.new.too_late_message")
|
||||||
|
- else
|
||||||
|
.alert.alert-warning role="alert"
|
||||||
= t("worlds.about.one_bet_message")
|
= t("worlds.about.one_bet_message")
|
||||||
|
|
||||||
= form_with model: @world_bet, url: "/wjpc_bets/#{@lang}/new", method: :post do |form|
|
= form_with model: @world_bet, url: "/wjpc_bets/#{@lang}/new", method: :post do |form|
|
||||||
.alert.alert-primary role="alert"
|
.alert.alert-primary role="alert"
|
||||||
= t("worlds.new.message")
|
= t("worlds.new.message")
|
||||||
|
|
||||||
|
|||||||
@@ -466,6 +466,7 @@ en:
|
|||||||
message: To make a bet, you have to provide two ordered lists of 10 participants, one among all participants, and the other one only among French participants. The order matters! A score multiplier will be applied to each selected contestant (in parenthesis below). You can't select a participant twice on a list, but of course you can totally put a French contestant in both lists ;)
|
message: To make a bet, you have to provide two ordered lists of 10 participants, one among all participants, and the other one only among French participants. The order matters! A score multiplier will be applied to each selected contestant (in parenthesis below). You can't select a participant twice on a list, but of course you can totally put a French contestant in both lists ;)
|
||||||
notice: The bet has been made!
|
notice: The bet has been made!
|
||||||
tab: Make a bet!
|
tab: Make a bet!
|
||||||
|
too_late_message: Bets are now closed!
|
||||||
world_section: Bet over all participants
|
world_section: Bet over all participants
|
||||||
title: WJPC bets
|
title: WJPC bets
|
||||||
view:
|
view:
|
||||||
|
|||||||
@@ -439,6 +439,7 @@ fr:
|
|||||||
notice: Le pari est enregistré !
|
notice: Le pari est enregistré !
|
||||||
tab: Fais ton pari !
|
tab: Fais ton pari !
|
||||||
title: Nouveau pari
|
title: Nouveau pari
|
||||||
|
too_late_message: Les paris sont désormais fermés !
|
||||||
world_section: Pari sur l'ensemble des participant.e.s
|
world_section: Pari sur l'ensemble des participant.e.s
|
||||||
title: Les paris des WJPC
|
title: Les paris des WJPC
|
||||||
view:
|
view:
|
||||||
|
|||||||
Reference in New Issue
Block a user