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

@@ -7,7 +7,7 @@
.clearfix role='button'
i.fa-solid aria-hidden='true'
span
= t('activerecord.models.tip.one')
= Tip.model_name.human
=< tip_prefix + index.to_s
= ": #{tip.title}" if tip.title?
.card.card-collapse.collapse id="tip-collapse-#{exercise_tip.id}" aria-labelledby="tip-heading-#{exercise_tip.id}" role='tabpanel' data-exercise-tip-id=exercise_tip.id

View File

@@ -14,7 +14,7 @@
= f.label(:description, class: 'form-label')
= f.markdown :description
.mb-3
= f.label(:file_type_id, t('activerecord.attributes.file.file_type_id'), class: 'form-label')
= f.label(:file_type_id, CodeOcean::File.human_attribute_name('file_type_id'), class: 'form-label')
= f.collection_select(:file_type_id, @file_types, :id, :name, {include_blank: true}, class: 'form-control')
.mb-3
= f.label(:example, class: 'form-label')

View File

@@ -1,11 +1,11 @@
h1 = Tip.model_name.human(count: 2)
h1 = Tip.model_name.human(count: :other)
.table-responsive
table.table class=(@tips.present? ? 'sortable' : '')
thead
tr
th = t('activerecord.attributes.tip.title')
th = t('activerecord.attributes.file.file_type')
th = Tip.human_attribute_name('title')
th = CodeOcean::File.human_attribute_name('file_type')
th colspan=3 = t('shared.actions')
tbody
- @tips.each do |tip|