Secure public contestant forms by asking the code first
This commit is contained in:
@@ -126,9 +126,7 @@
|
||||
.row.mb-3
|
||||
.col
|
||||
.form-floating
|
||||
= form.text_field :code, autocomplete: "off", class: "form-control"
|
||||
= form.label :code
|
||||
= t("completions.form.code")
|
||||
= form.hidden_field :code, autocomplete: "off", class: "form-control"
|
||||
.row
|
||||
.col
|
||||
= form.submit submit_text, class: "btn btn-primary"
|
||||
20
app/views/completions/validate_organizer_code.html.slim
Normal file
20
app/views/completions/validate_organizer_code.html.slim
Normal file
@@ -0,0 +1,20 @@
|
||||
- if @public && @contestant.contest.puzzles.length == @contestant.completions.length
|
||||
h4
|
||||
= t("completions.form.validate_name", name: @contestant.name)
|
||||
.mt-3.alert.alert-warning
|
||||
= t("completions.form.all_finished", name: @contestant.name)
|
||||
- else
|
||||
.row.mt-2
|
||||
.col
|
||||
h4
|
||||
= t("completions.form.validate_name", name: @contestant.name)
|
||||
= form_with model: @completion, url: "/public/p/#{@contestant.id}/code", method: "post" do |form|
|
||||
.row.mt-3
|
||||
.col
|
||||
.form-floating
|
||||
= form.text_field :code, autocomplete: "off", class: "form-control"
|
||||
= form.label :code
|
||||
= t("completions.form.code")
|
||||
.row.mt-3
|
||||
.col
|
||||
= form.submit t("helpers.buttons.validate"), class: "btn btn-primary"
|
||||
Reference in New Issue
Block a user