Replace manual activerecord translations with helpers

This commit is contained in:
Sebastian Serth
2024-04-14 14:00:51 +02:00
committed by Sebastian Serth
parent e551c8a699
commit f8330b39fb
72 changed files with 265 additions and 264 deletions

View File

@@ -4,12 +4,12 @@
= f.label(:name, class: 'form-label')
= f.text_field(:name, class: 'form-control', required: true)
h3 = t('activerecord.attributes.study_group.members')
h3 = StudyGroup.human_attribute_name('members')
.table-responsive
table.table class=(@members.present? ? 'sortable' : '')
thead
tr
th = t('activerecord.attributes.exercise.selection')
th = Exercise.human_attribute_name('selection')
th = t('navigation.sections.users')
= collection_check_boxes :study_group, :study_group_membership_ids, @members, :id, :id do |b|
tr

View File

@@ -2,10 +2,10 @@
table.table.mt-4
thead
tr
th = t('activerecord.attributes.study_group.name')
th = t('activerecord.attributes.study_group.external_id')
th = t('activerecord.attributes.study_group.consumer')
th = t('activerecord.attributes.study_group.member_count')
th = StudyGroup.human_attribute_name('name')
th = StudyGroup.human_attribute_name('external_id')
th = StudyGroup.human_attribute_name('consumer')
th = StudyGroup.human_attribute_name('member_count')
th colspan=3 = t('shared.actions')
tbody
- study_groups.each do |group|

View File

@@ -1,12 +1,12 @@
h1 = StudyGroup.model_name.human(count: 2)
h1 = StudyGroup.model_name.human(count: :other)
= render(layout: 'shared/form_filters') do |f|
.col-auto
= f.label(:consumer_id_eq, t('activerecord.attributes.internal_user.consumer'), class: 'visually-hidden form-label')
= f.collection_select(:consumer_id_eq, Consumer.with_study_groups, :id, :name, class: 'form-control', prompt: t('activerecord.attributes.internal_user.consumer'))
= f.label(:consumer_id_eq, InternalUser.human_attribute_name('consumer'), class: 'visually-hidden form-label')
= f.collection_select(:consumer_id_eq, Consumer.with_study_groups, :id, :name, class: 'form-control', prompt: InternalUser.human_attribute_name('consumer'))
.col-auto
= f.label(:name_cont, t('activerecord.attributes.study_group.name'), class: 'visually-hidden form-label')
= f.search_field(:name_cont, class: 'form-control', placeholder: t('activerecord.attributes.study_group.name'))
= f.label(:name_cont, StudyGroup.human_attribute_name('name'), class: 'visually-hidden form-label')
= f.search_field(:name_cont, class: 'form-control', placeholder: StudyGroup.human_attribute_name('name'))
= render('table', study_groups: @study_groups)
= render('shared/pagination', collection: @study_groups_paginate)

View File

@@ -9,7 +9,7 @@ h1
= row(label: 'study_group.consumer', value: link_to_if(policy(@study_group).show?, @study_group.consumer, @study_group.consumer))
= row(label: 'study_group.member_count', value: @study_group.user_count)
h2.mt-4 = t('activerecord.attributes.study_group.members')
h2.mt-4 = StudyGroup.human_attribute_name('members')
.table-responsive
table.table class=(@study_group.users.present? ? 'sortable' : '')
thead