Translations for the contest dashboard page
This commit is contained in:
parent
ec2201f9a8
commit
7444a09046
@ -13,7 +13,7 @@ class ContestsController < ApplicationController
|
|||||||
authorize @contest
|
authorize @contest
|
||||||
|
|
||||||
@title = I18n.t("contests.show.title", name: @contest.name)
|
@title = I18n.t("contests.show.title", name: @contest.name)
|
||||||
@action_name = "Edit"
|
@action_name = t("helpers.buttons.edit")
|
||||||
@action_path = edit_contest_path(@contest)
|
@action_path = edit_contest_path(@contest)
|
||||||
@contestants = @contest.contestants.order(:name)
|
@contestants = @contest.contestants.order(:name)
|
||||||
@puzzles = @contest.puzzles.order(:id)
|
@puzzles = @contest.puzzles.order(:id)
|
||||||
@ -75,8 +75,8 @@ class ContestsController < ApplicationController
|
|||||||
|
|
||||||
def set_badges
|
def set_badges
|
||||||
@badges = []
|
@badges = []
|
||||||
@badges.push("team") if @contest.team
|
@badges.push(t("helpers.badges.team")) if @contest.team
|
||||||
@badges.push("registration") if @contest.allow_registration
|
@badges.push(t("helpers.badges.registration")) if @contest.allow_registration
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_contest
|
def set_contest
|
||||||
|
@ -8,8 +8,7 @@
|
|||||||
= badge
|
= badge
|
||||||
|
|
||||||
.row.mb-4
|
.row.mb-4
|
||||||
.col
|
.col.alert.alert-success
|
||||||
p
|
|
||||||
= t("contests.show.public_scoreboard")
|
= t("contests.show.public_scoreboard")
|
||||||
= link_to root_url + "public/#{@contest.slug}", root_url + "public/#{@contest.slug}"
|
= link_to root_url + "public/#{@contest.slug}", root_url + "public/#{@contest.slug}"
|
||||||
|
|
||||||
@ -19,17 +18,17 @@
|
|||||||
.col
|
.col
|
||||||
h4
|
h4
|
||||||
= t("puzzles.plural").capitalize
|
= t("puzzles.plural").capitalize
|
||||||
a.ms-3.btn.btn-primary href=new_contest_puzzle_path(@contest) style="margin-top: -3px"
|
a.ms-3.btn.btn-sm.btn-primary href=new_contest_puzzle_path(@contest) style="margin-top: -3px"
|
||||||
| + #{t("helpers.buttons.add")}
|
| + #{t("helpers.buttons.add")}
|
||||||
table.table.table-striped.table-hover
|
table.table.table-striped.table-hover
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th scope="col"
|
th scope="col"
|
||||||
| Image
|
= t("activerecord.attributes.puzzle.image")
|
||||||
th scope="col"
|
th scope="col"
|
||||||
| Title
|
= t("activerecord.attributes.puzzle.name")
|
||||||
th scope="col"
|
th scope="col"
|
||||||
| Brand
|
= t("activerecord.attributes.puzzle.brand")
|
||||||
tbody
|
tbody
|
||||||
- @puzzles.each do |puzzle|
|
- @puzzles.each do |puzzle|
|
||||||
tr.align-middle scope="row"
|
tr.align-middle scope="row"
|
||||||
@ -41,7 +40,7 @@
|
|||||||
= puzzle.brand
|
= puzzle.brand
|
||||||
td
|
td
|
||||||
a.btn.btn-sm.btn-secondary href=edit_contest_puzzle_path(@contest, puzzle)
|
a.btn.btn-sm.btn-secondary href=edit_contest_puzzle_path(@contest, puzzle)
|
||||||
| Edit
|
= t("helpers.buttons.edit")
|
||||||
- if @messages
|
- if @messages
|
||||||
.row.mt-5
|
.row.mt-5
|
||||||
.col
|
.col
|
||||||
@ -50,11 +49,11 @@
|
|||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th scope="col"
|
th scope="col"
|
||||||
| Time
|
= t("activerecord.attributes.message.time")
|
||||||
th scope="col"
|
th scope="col"
|
||||||
| Author
|
= t("activerecord.attributes.message.author")
|
||||||
th scope="col"
|
th scope="col"
|
||||||
| Text
|
= t("activerecord.attributes.message.text")
|
||||||
tbody
|
tbody
|
||||||
- @messages.each do |message|
|
- @messages.each do |message|
|
||||||
tr.align-middle scope="row"
|
tr.align-middle scope="row"
|
||||||
@ -66,34 +65,30 @@
|
|||||||
= message.text
|
= message.text
|
||||||
td
|
td
|
||||||
a.btn.btn-sm.btn-secondary href=contest_message_convert_path(@contest, message) style="white-space: nowrap;"
|
a.btn.btn-sm.btn-secondary href=contest_message_convert_path(@contest, message) style="white-space: nowrap;"
|
||||||
| Add completion
|
= t("helpers.buttons.add_completion")
|
||||||
td
|
td
|
||||||
= link_to "Delete", contest_message_path(@contest, message), data: { turbo_method: :delete }, class: "btn btn-sm btn-danger"
|
= link_to t("helpers.buttons.delete"), contest_message_path(@contest, message), data: { turbo_method: :delete }, class: "btn btn-sm btn-danger"
|
||||||
.col-6
|
.col-6
|
||||||
.row
|
.row
|
||||||
.col
|
.col
|
||||||
h4
|
h4
|
||||||
= t("contestants.plural").capitalize
|
= t("contestants.plural").capitalize
|
||||||
a.ms-3.btn.btn-primary href=new_contest_contestant_path(@contest) style="margin-top: -3px"
|
a.ms-3.btn.btn-sm.btn-primary href=new_contest_contestant_path(@contest) style="margin-top: -3px"
|
||||||
| + #{t("helpers.buttons.add")}
|
| + #{t("helpers.buttons.add")}
|
||||||
a.ms-3.btn.btn-primary href=contest_import_path(@contest) style="margin-top: -3px"
|
a.ms-3.btn-sm.btn.btn-primary href=contest_import_path(@contest) style="margin-top: -3px"
|
||||||
| #{t("helpers.buttons.import")}
|
| #{t("helpers.buttons.import")}
|
||||||
table.table.table-striped.table-hover
|
table.table.table-striped.table-hover
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th scope="col"
|
th scope="col"
|
||||||
| Name
|
= t("activerecord.attributes.contestant.name")
|
||||||
th scope="col"
|
|
||||||
| Completed puzzles
|
|
||||||
tbody
|
tbody
|
||||||
- @contestants.each do |contestant|
|
- @contestants.each do |contestant|
|
||||||
tr scope="row"
|
tr scope="row"
|
||||||
td
|
td
|
||||||
= contestant.name
|
= contestant.name
|
||||||
td
|
|
||||||
= contestant.completions.length
|
|
||||||
td
|
td
|
||||||
a.btn.btn-sm.btn-secondary href=edit_contest_contestant_path(@contest, contestant)
|
a.btn.btn-sm.btn-secondary href=edit_contest_contestant_path(@contest, contestant)
|
||||||
| Open
|
= t("helpers.buttons.open")
|
||||||
a.btn.btn-sm.btn-secondary.ms-3 href=new_contest_completion_path(@contest, contestant_id: contestant.id)
|
a.btn.btn-sm.btn-secondary.ms-3 href=new_contest_completion_path(@contest, contestant_id: contestant.id)
|
||||||
| Add completion
|
= t("helpers.buttons.add_completion")
|
||||||
|
@ -19,7 +19,7 @@ html
|
|||||||
h1.mb-4
|
h1.mb-4
|
||||||
= @title
|
= @title
|
||||||
- if @action_path
|
- if @action_path
|
||||||
a.ms-3.btn.btn-primary href=@action_path style="margin-top: -4px"
|
a.ms-4.btn.btn-primary href=@action_path style="margin-top: -4px"
|
||||||
= @action_name
|
= @action_name
|
||||||
|
|
||||||
= yield
|
= yield
|
@ -11,7 +11,8 @@
|
|||||||
= form.label :brand, class: "required"
|
= form.label :brand, class: "required"
|
||||||
.row.mb-3
|
.row.mb-3
|
||||||
.col
|
.col
|
||||||
.form-text Select an image
|
.form-text.mb-1
|
||||||
|
= t("puzzles.image_select")
|
||||||
= form.file_field :image, accept: "image/*", class: "form-control"
|
= form.file_field :image, accept: "image/*", class: "form-control"
|
||||||
.row.mt-4
|
.row.mt-4
|
||||||
.col
|
.col
|
||||||
|
@ -1 +1 @@
|
|||||||
= render "form", contest: @contest, puzzle: @puzzle, submit_text: "Save", method: :patch, url: "/contests/#{@contest.id}/puzzles/#{@puzzle.id}"
|
= render "form", contest: @contest, puzzle: @puzzle, submit_text: t("helpers.buttons.save"), method: :patch, url: "/contests/#{@contest.id}/puzzles/#{@puzzle.id}"
|
@ -1 +1 @@
|
|||||||
= render "form", contest: @contest, puzzle: @puzzle, submit_text: "Add", method: :post, url: "/contests/#{@contest.id}/puzzles"
|
= render "form", contest: @contest, puzzle: @puzzle, submit_text: t("helpers.buttons.add"), method: :post, url: "/contests/#{@contest.id}/puzzles"
|
@ -44,6 +44,16 @@ en:
|
|||||||
team_description: "For UI display purposes mainly"
|
team_description: "For UI display purposes mainly"
|
||||||
allow_registration: "Allow registration"
|
allow_registration: "Allow registration"
|
||||||
allow_registration_description: "Generates a shareable registration form for this contest"
|
allow_registration_description: "Generates a shareable registration form for this contest"
|
||||||
|
contestant:
|
||||||
|
name: "Name"
|
||||||
|
message:
|
||||||
|
author: "Author"
|
||||||
|
text: "Content"
|
||||||
|
time: "Time"
|
||||||
|
puzzle:
|
||||||
|
brand: "Brand"
|
||||||
|
image: "Image"
|
||||||
|
name: "Name"
|
||||||
user:
|
user:
|
||||||
username: "Username"
|
username: "Username"
|
||||||
email_address: "Email address"
|
email_address: "Email address"
|
||||||
@ -107,10 +117,16 @@ en:
|
|||||||
singular: "team"
|
singular: "team"
|
||||||
plural: "teams"
|
plural: "teams"
|
||||||
helpers:
|
helpers:
|
||||||
|
badges:
|
||||||
|
registration: "registration"
|
||||||
|
team: "team"
|
||||||
buttons:
|
buttons:
|
||||||
add: "Add"
|
add: "Add"
|
||||||
|
add_completion: "Add completion"
|
||||||
confirm: "Confirm"
|
confirm: "Confirm"
|
||||||
create: "Create"
|
create: "Create"
|
||||||
|
delete: "Delete"
|
||||||
|
edit: "Edit"
|
||||||
import: "CSV Import"
|
import: "CSV Import"
|
||||||
save: "Save"
|
save: "Save"
|
||||||
field: "Field"
|
field: "Field"
|
||||||
@ -127,6 +143,7 @@ en:
|
|||||||
puzzles:
|
puzzles:
|
||||||
edit:
|
edit:
|
||||||
title: "Edit contest puzzle"
|
title: "Edit contest puzzle"
|
||||||
|
image_select: "Select an image"
|
||||||
new:
|
new:
|
||||||
title: "New contest puzzle"
|
title: "New contest puzzle"
|
||||||
singular: "puzzle"
|
singular: "puzzle"
|
||||||
|
@ -15,6 +15,16 @@ fr:
|
|||||||
team_description: "Principalement pour des raisons d'affichage"
|
team_description: "Principalement pour des raisons d'affichage"
|
||||||
allow_registration: "Autoriser l'inscription via l'interface"
|
allow_registration: "Autoriser l'inscription via l'interface"
|
||||||
allow_registration_description: "Génère un formulaire d'inscription pour ce concours"
|
allow_registration_description: "Génère un formulaire d'inscription pour ce concours"
|
||||||
|
contestant:
|
||||||
|
name: "Nom"
|
||||||
|
message:
|
||||||
|
author: "Auteur.ice"
|
||||||
|
text: "Contenu"
|
||||||
|
time: "Temps"
|
||||||
|
puzzle:
|
||||||
|
brand: "Marque"
|
||||||
|
image: "Image"
|
||||||
|
name: "Nom"
|
||||||
user:
|
user:
|
||||||
username: "Nom d'utilisateur.ice"
|
username: "Nom d'utilisateur.ice"
|
||||||
email_address: "Adresse email"
|
email_address: "Adresse email"
|
||||||
@ -78,10 +88,16 @@ fr:
|
|||||||
singular: "équipe"
|
singular: "équipe"
|
||||||
plural: "équipes"
|
plural: "équipes"
|
||||||
helpers:
|
helpers:
|
||||||
|
badges:
|
||||||
|
registration: "auto-inscription"
|
||||||
|
team: "équipes"
|
||||||
buttons:
|
buttons:
|
||||||
add: "Ajouter"
|
add: "Ajouter"
|
||||||
|
add_completion: "Ajouter une complétion"
|
||||||
confirm: "Confirmer"
|
confirm: "Confirmer"
|
||||||
create: "Créer"
|
create: "Créer"
|
||||||
|
delete: "Supprimer"
|
||||||
|
edit: "Modifier"
|
||||||
import: "Importer un CSV"
|
import: "Importer un CSV"
|
||||||
save: "Modifier"
|
save: "Modifier"
|
||||||
field: "Champ"
|
field: "Champ"
|
||||||
@ -98,6 +114,7 @@ fr:
|
|||||||
puzzles:
|
puzzles:
|
||||||
edit:
|
edit:
|
||||||
title: "Modifier le puzzle"
|
title: "Modifier le puzzle"
|
||||||
|
image_select: "Choisis une image"
|
||||||
new:
|
new:
|
||||||
title: "Nouveau puzzle"
|
title: "Nouveau puzzle"
|
||||||
singular: "puzzle"
|
singular: "puzzle"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user