Add ActiveModel-scoped locales for `Announcement` model

This commit is contained in:
Andreas Nedbal 2022-01-24 21:47:03 +01:00 committed by Andreas Nedbal
parent ac83995dfc
commit 3404b337eb
3 changed files with 21 additions and 12 deletions

View File

@ -1,4 +1,4 @@
- provide(:title, generate_title('Edit announcement')) - provide(:title, generate_title(t(".title")))
.container-lg.container--main .container-lg.container--main
.card .card
.card-body .card-body
@ -15,21 +15,19 @@
%li= err %li= err
.row .row
.col-md-12 .col-md-12
= f.text_area :content, label: 'Content' = f.text_area :content
.row .row
.col-md-6 .col-md-6
= f.url_field :link_href, label: 'Link URL' = f.url_field :link_href
.col-md-6 .col-md-6
= f.text_field :link_text, label: 'Link text' = f.text_field :link_text
.row .row
.col-md-6 .col-md-6
= f.datetime_field :starts_at, = f.datetime_field :starts_at,
label: 'Start time',
class: 'datetimepicker-input', class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_starts_at', 'date-format': 'YYYY-MM-DD hh:mm A' } data: { toggle: 'datetimepicker', target: '#announcement_starts_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.col-md-6 .col-md-6
= f.datetime_field :ends_at, = f.datetime_field :ends_at,
label: 'End time',
class: 'datetimepicker-input', class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_ends_at', 'date-format': 'YYYY-MM-DD hh:mm A' } data: { toggle: 'datetimepicker', target: '#announcement_ends_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.row .row

View File

@ -1,4 +1,4 @@
- provide(:title, generate_title('Add new announcement')) - provide(:title, generate_title(t(".title")))
.container-lg.container--main .container-lg.container--main
.card .card
.card-body .card-body
@ -15,21 +15,19 @@
%li= err %li= err
.row .row
.col-md-12 .col-md-12
= f.text_area :content, label: 'Content' = f.text_area :content
.row .row
.col-md-6 .col-md-6
= f.url_field :link_href, label: 'Link URL' = f.url_field :link_href
.col-md-6 .col-md-6
= f.text_field :link_text, label: 'Link text' = f.text_field :link_text
.row .row
.col-md-6 .col-md-6
= f.datetime_field :starts_at, = f.datetime_field :starts_at,
label: 'Start time',
class: 'datetimepicker-input', class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_starts_at', 'date-format': 'YYYY-MM-DD hh:mm A' } data: { toggle: 'datetimepicker', target: '#announcement_starts_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.col-md-6 .col-md-6
= f.datetime_field :ends_at, = f.datetime_field :ends_at,
label: 'End time',
class: 'datetimepicker-input', class: 'datetimepicker-input',
data: { toggle: 'datetimepicker', target: '#announcement_ends_at', 'date-format': 'YYYY-MM-DD hh:mm A' } data: { toggle: 'datetimepicker', target: '#announcement_ends_at', 'date-format': 'YYYY-MM-DD hh:mm A' }
.row .row

View File

@ -0,0 +1,13 @@
en:
activerecord:
models:
announcement:
one: "Announcement"
other: "Announcements"
attributes:
announcement:
content: "Content"
link_href: "Link URL"
link_text: "Link text"
starts_at: "Start time"
ends_at: "End time"