More translations, incl. attributes
Some checks failed
CI / scan_ruby (push) Failing after 13s
CI / scan_js (push) Successful in 12s
CI / lint (push) Successful in 12s
CI / test (push) Successful in 33s

This commit is contained in:
sto
2025-03-28 14:26:57 +01:00
parent 10fa821f19
commit 21f71f9d32
8 changed files with 81 additions and 23 deletions

View File

@@ -9,14 +9,13 @@
.form-check.form-switch
= form.check_box :team, class: "form-check-input"
= form.label :team
| Team contest
.form-text For UI display purposes mainly
.form-text = t("activerecord.attributes.contest.team_description")
.row.mb-3
.col
.form-check.form-switch
= form.check_box :allow_registration, class: "form-check-input"
= form.label :allow_registration
.form-text Generates a shareable registration form for this contest
.form-text = t("activerecord.attributes.contest.allow_registration_description")
.row
.col
= form.submit submit_text, class: "btn btn-primary"

View File

@@ -1 +1 @@
= render "form", contest: @contest, submit_text: "Save"
= render "form", contest: @contest, submit_text: t("helpers.buttons.save")

View File

@@ -15,7 +15,11 @@
.card-header
= contest.name
.card-body
.card-text.mb-2 = "#{contest.puzzles.length} puzzles - #{contest.contestants.length} participants"
.card-text.mb-2
= "#{contest.puzzles.length} #{t('puzzles.singular')}" if contest.puzzles.length <= 1
= "#{contest.puzzles.length} #{t('puzzles.plural')}" if contest.puzzles.length > 1
= " - #{contest.contestants.length} #{t('contestants.singular')}" if contest.contestants.length <= 1
= " - #{contest.contestants.length} #{t('contestants.plural')}" if contest.contestants.length > 1
.row
.col
- contest.puzzles.each do |puzzle|

View File

@@ -1 +1 @@
= render "form", contest: @contest, submit_text: "Create"
= render "form", contest: @contest, submit_text: t("helpers.buttons.create")

View File

@@ -13,15 +13,14 @@
a.btn.btn-primary href=edit_contest_path(@contest)
| Edit contest
p
|> Public scoreboard:
= t("contests.show.public_scoreboard")
= link_to root_url + "public/#{@contest.slug}", root_url + "public/#{@contest.slug}"
.row.mb-4
.col-6
.row
.col
h4
| Puzzles
h4 = t("puzzles.plural").capitalize
.row.row-cols-1.row-cols-md-3.g-4.mb-4
- @puzzles.each do |puzzle|
.col
@@ -38,11 +37,11 @@
.row
.col
a.btn.btn-primary href=new_contest_puzzle_path(@contest)
| Add puzzle
= t("contests.show.add_puzzle")
.col-6
.row
.col
h4 = t("contests.show.contestants")
h4 = t("contestants.plural").capitalize
table.table.table-striped.table-hover
thead
tr

View File

@@ -1,6 +1,6 @@
= form_with model: user, method: method do |form|
- if method == :patch
h4 General settings
h4 = t("users.edit.general_section")
.row.mb-3
.col
@@ -21,7 +21,6 @@
.form-floating
= form.select :lang, Languages::AVAILABLE_LANGUAGES.map { |lang| [ lang[:name], lang[:id] ] }, {}, class: "form-select"
= form.label :lang
| Language
- if method == :post
.row.mb-3
@@ -29,10 +28,10 @@
.form-floating
= form.password_field :password, autocomplete: "off", class: "form-control"
= form.label :password, class: "required"
= form.submit "Save", class: "btn btn-primary"
= form.submit t("helpers.buttons.save"), class: "btn btn-primary"
- if method == :patch
h4.mt-5 Change password
h4.mt-5 = t("users.edit.password_section")
= form_with model: user, method: method do |form|
.row.mb-3
@@ -40,5 +39,4 @@
.form-floating
= form.password_field :password, autocomplete: "off", class: "form-control"
= form.label :password, class: "required"
| New password
= form.submit "Save new password", class: "btn btn-primary"
= form.submit t("helpers.buttons.save"), class: "btn btn-primary"