Replace manual activerecord translations with helpers
This commit is contained in:

committed by
Sebastian Serth

parent
e551c8a699
commit
f8330b39fb
@@ -17,9 +17,9 @@ h1.d-inline-block
|
||||
ul.dropdown-menu.dropdown-menu-end role='menu'
|
||||
li = link_to(t('exercises.index.implement'), implement_exercise_path(@exercise), 'data-turbolinks': 'false', class: 'dropdown-item') if policy(@exercise).implement?
|
||||
li = link_to(t('shared.statistics'), statistics_exercise_path(@exercise), 'data-turbolinks': 'false', class: 'dropdown-item') if policy(@exercise).statistics?
|
||||
li = link_to(t('activerecord.models.user_exercise_feedback.other'), feedback_exercise_path(@exercise), class: 'dropdown-item') if policy(@exercise).feedback?
|
||||
li = link_to(t('activerecord.models.request_for_comment.other'), exercise_request_for_comments_path(@exercise), class: 'dropdown-item') if policy(@exercise).rfcs_for_exercise?
|
||||
li = link_to(t('activerecord.models.programming_group.other'), exercise_programming_groups_path(@exercise), class: 'dropdown-item') if policy(@exercise).programming_groups_for_exercise?
|
||||
li = link_to(UserExerciseFeedback.model_name.human(count: :other), feedback_exercise_path(@exercise), class: 'dropdown-item') if policy(@exercise).feedback?
|
||||
li = link_to(RequestForComment.model_name.human(count: :other), exercise_request_for_comments_path(@exercise), class: 'dropdown-item') if policy(@exercise).rfcs_for_exercise?
|
||||
li = link_to(ProgrammingGroup.model_name.human(count: :other), exercise_programming_groups_path(@exercise), class: 'dropdown-item') if policy(@exercise).programming_groups_for_exercise?
|
||||
li = link_to(t('shared.destroy'), @exercise, data: {confirm: t('shared.confirm_destroy')}, method: :delete, class: 'dropdown-item') if policy(@exercise).destroy?
|
||||
li = link_to(t('exercises.index.clone'), clone_exercise_path(@exercise), data: {confirm: t('shared.confirm_destroy')}, method: :post, class: 'dropdown-item') if policy(@exercise).clone?
|
||||
li = link_to(t('exercises.export_codeharbor.label'), '', class: 'dropdown-item export-start', data: {'exercise-id': @exercise.id}) if policy(@exercise).export_external_confirm?
|
||||
@@ -38,7 +38,7 @@ h1.d-inline-block
|
||||
= row(label: 'exercise.hide_file_tree', value: @exercise.hide_file_tree?)
|
||||
= row(label: 'exercise.allow_file_creation', value: @exercise.allow_file_creation?)
|
||||
= row(label: 'exercise.allow_auto_completion', value: @exercise.allow_auto_completion?)
|
||||
= row(label: 'exercise.difficulty', value: @exercise.expected_difficulty)
|
||||
= row(label: 'exercise.expected_difficulty', value: @exercise.expected_difficulty)
|
||||
= row(label: 'exercise.uuid', value: @exercise.uuid)
|
||||
= row(label: 'exercise.tags', value: @exercise.exercise_tags.map {|et| "#{et.tag.name} (#{et.factor})" }.sort.join(', '))
|
||||
= row(label: 'exercise.embedding_parameters', class: 'mb-4') do
|
||||
@@ -48,7 +48,7 @@ h1.d-inline-block
|
||||
.mt-2
|
||||
= render(partial: 'tips_content')
|
||||
|
||||
h2.mt-4 = t('activerecord.attributes.exercise.files')
|
||||
h2.mt-4 = Exercise.human_attribute_name('files')
|
||||
|
||||
ul.list-unstyled#files
|
||||
- @exercise.files.each do |file|
|
||||
|
Reference in New Issue
Block a user