QR codes generation
Some checks failed
CI / scan_ruby (push) Failing after 31s
CI / scan_js (push) Successful in 16s
CI / lint (push) Successful in 16s
CI / test (push) Failing after 45s

This commit is contained in:
sto
2025-11-20 12:01:30 +01:00
parent 3e071f9281
commit 709719b801
16 changed files with 63 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ class ContestantsController < ApplicationController
include CompletionsConcern
include ContestantsConcern
before_action :set_contest, only: %i[ index edit new create update destroy import upload_csv convert_csv finalize_import export ]
before_action :set_contest, only: %i[ index edit new create update destroy import upload_csv convert_csv finalize_import export generate_qrcodes ]
before_action :set_contestant, only: %i[ destroy edit update]
before_action :set_completions, only: %i[edit update ]
skip_before_action :require_authentication, only: %i[ get_public_completion post_public_completion public_completion_updated ]
@@ -42,7 +42,7 @@ class ContestantsController < ApplicationController
if @contestant.update(contestant_params)
update_contestant_categories
redirect_to @contest, notice: t("contestants.edit.notice")
redirect_to contest_contestants_path(@contest), notice: t("contestants.edit.notice")
else
render :edit, status: :unprocessable_entity
end
@@ -120,6 +120,12 @@ class ContestantsController < ApplicationController
end
end
def generate_qrcodes
authorize @contest
@contestants = @contest.contestants.sort_by { |contestant| contestant.name }
end
def get_public_completion
skip_authorization