Warning in offline settings when more than one puzzle
This commit is contained in:
@@ -1,20 +1,27 @@
|
||||
= render "settings_nav"
|
||||
|
||||
= form_with model: @contest, url: "/contests/#{@contest.id}/settings/offline" do |form|
|
||||
.row.mt-2.mb-3
|
||||
- if @contest.puzzles.length > 1
|
||||
.row
|
||||
.col
|
||||
- if @contest.puzzles.length <= 1
|
||||
.form-check.form-switch
|
||||
= form.check_box :offline_form, class: "form-check-input"
|
||||
= form.label :offline_form
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_warning")
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_description")
|
||||
- else
|
||||
.form-check.form-switch
|
||||
= form.check_box :offline_form_fake, class: "form-check-input", disabled: true
|
||||
= form.label :offline_form
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_warning")
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_description")
|
||||
.row.mt-4
|
||||
.col
|
||||
= form.submit t("helpers.buttons.update"), class: "btn btn-primary"
|
||||
.alert.alert-warning
|
||||
= t("contests.form.offline_single_puzzle_warning")
|
||||
|
||||
- if @contest.puzzles.length <= 1
|
||||
= form_with model: @contest, url: "/contests/#{@contest.id}/settings/offline" do |form|
|
||||
.row.mt-2.mb-3
|
||||
.col
|
||||
- if @contest.puzzles.length <= 1
|
||||
.form-check.form-switch
|
||||
= form.check_box :offline_form, class: "form-check-input"
|
||||
= form.label :offline_form
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_warning")
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_description")
|
||||
- else
|
||||
.form-check.form-switch
|
||||
= form.check_box :offline_form_fake, class: "form-check-input", disabled: true
|
||||
= form.label :offline_form
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_warning")
|
||||
.form-text = t("activerecord.attributes.contest.offline_form_description")
|
||||
.row.mt-4
|
||||
.col
|
||||
= form.submit t("helpers.buttons.update"), class: "btn btn-primary"
|
||||
Reference in New Issue
Block a user