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

@@ -1,23 +1,23 @@
h1 = InternalUser.model_name.human(count: 2)
h1 = InternalUser.model_name.human(count: :other)
- if current_user.admin?
= 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_internal_users, :id, :name, class: 'form-control', include_blank: true, 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_internal_users, :id, :name, class: 'form-control', include_blank: true, prompt: InternalUser.human_attribute_name('consumer'))
.col-sm
= f.label(:email_cont, t('activerecord.attributes.internal_user.email'), class: 'visually-hidden form-label')
= f.search_field(:email_cont, class: 'form-control', placeholder: t('activerecord.attributes.internal_user.email'))
= f.label(:email_cont, InternalUser.human_attribute_name('email'), class: 'visually-hidden form-label')
= f.search_field(:email_cont, class: 'form-control', placeholder: InternalUser.human_attribute_name('email'))
.col-auto
= f.select :platform_admin_true, [[t('shared.admin_filter.only'), 1], [t('shared.admin_filter.none'), 0]], {include_blank: t('shared.admin_filter.all'), selected: params[:q] ? params[:q][:platform_admin_true] : ''}
.table-responsive
table.table.mt-4
thead
tr
th = t('activerecord.attributes.internal_user.name')
th = t('activerecord.attributes.internal_user.consumer')
th = InternalUser.human_attribute_name('name')
th = InternalUser.human_attribute_name('consumer')
- if current_user.admin?
th = t('activerecord.attributes.internal_user.platform_admin')
th = InternalUser.human_attribute_name('platform_admin')
th colspan=3 = t('shared.actions')
tbody
- @users.each do |user|