From d62b46b7dfc71449b22302ef73722e90bef0d473 Mon Sep 17 00:00:00 2001 From: sto Date: Mon, 3 Nov 2025 11:35:00 +0100 Subject: [PATCH] Offline participation: already submitted page --- app/controllers/contests_controller.rb | 4 ++++ app/views/contests/offline_already_submitted.html.slim | 2 ++ config/locales/en.yml | 1 + config/locales/fr.yml | 1 + 4 files changed, 8 insertions(+) create mode 100644 app/views/contests/offline_already_submitted.html.slim diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 6287eeb..40c0fd9 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -124,6 +124,10 @@ class ContestsController < ApplicationController if !@offline not_found and return end + + if @offline.images.length > 1 + render :offline_already_submitted and return + end end def offline_update diff --git a/app/views/contests/offline_already_submitted.html.slim b/app/views/contests/offline_already_submitted.html.slim new file mode 100644 index 0000000..8d73489 --- /dev/null +++ b/app/views/contests/offline_already_submitted.html.slim @@ -0,0 +1,2 @@ +.mt-3 + = t("offlines.form.already_submitted") \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 6d0f870..9ad5579 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -246,6 +246,7 @@ en: log_out: Log out offlines: form: + already_submitted: You have already completed the puzzle completed_message: Thanks for your participation! end_image_select: Take a photo of your completed puzzle start_image_select: Take a photo of the puzzle with the provided code written on a paper before starting it diff --git a/config/locales/fr.yml b/config/locales/fr.yml index cd4ad83..cf1e90d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -217,6 +217,7 @@ fr: log_out: Déconnexion offlines: form: + already_submitted: Tu as déjà complété ton puzzle completed_message: Merci pour ta participation ! end_image_select: Prends une photo du puzzle une fois complété start_image_select: Prends une photo du puzzle avant de le commencer, avec le code donné par l'organisateur.ice écrit sur du papier