Lint Slim files and fix offenses

The fixing was partially done manually and partially automatically.
This commit is contained in:
Sebastian Serth
2024-04-13 20:06:03 +02:00
committed by Dominic Sauer
parent ddfa06ffaa
commit 9a9efd5caa
91 changed files with 378 additions and 392 deletions

View File

@@ -22,38 +22,38 @@ h1 = Exercise.model_name.human(count: 2)
= t('activerecord.attributes.exercise.public')
- if policy(Exercise).batch_update?
br
span.batch = link_to(t('shared.batch_update'), '#', 'data-text' => t('shared.update', model: t('activerecord.models.exercise.other')))
span.batch = link_to(t('shared.batch_update'), '#', 'data-text': t('shared.update', model: t('activerecord.models.exercise.other')))
th.p-1 colspan=6 = t('shared.actions')
tbody
- @exercises.each do |exercise|
tr data-id=exercise.id
td.p-1.pt-2
= link_to_if(policy(exercise).show?, exercise.title, exercise, 'data-turbolinks' => "false")
= link_to_if(policy(exercise).show?, exercise.title, exercise, 'data-turbolinks': 'false')
- if exercise.internal_title.present?
p.mb-0.text-muted
i.fa-solid.fa-arrow-turn-up.fa-rotate-90
span = exercise.internal_title
td.p-1.pt-2 = link_to_if(exercise.execution_environment && policy(exercise.execution_environment).show?, exercise.execution_environment, exercise.execution_environment)
td.p-1.pt-2 = exercise.files.filter(&:teacher_defined_assessment?).length
td.p-1.pt-2 = exercise.files.count(&:teacher_defined_assessment?)
td.p-1.pt-2 = exercise.maximum_score
td.p-1.pt-2 = exercise.exercise_tags.length
td.p-1.pt-2 = exercise.expected_difficulty
td.p-1.pt-2.public data-value=exercise.public? = symbol_for(exercise.public?)
td.p-1.pt-2 = link_to(t('shared.edit'), edit_exercise_path(exercise)) if policy(exercise).edit?
td.p-1.pt-2 = link_to(t('.implement'), implement_exercise_path(exercise)) if policy(exercise).implement?
td.p-1.pt-2 = link_to(t('shared.statistics'), statistics_exercise_path(exercise), 'data-turbolinks' => "false") if policy(exercise).statistics?
td.p-1.pt-2 = link_to(t('shared.statistics'), statistics_exercise_path(exercise), 'data-turbolinks': 'false') if policy(exercise).statistics?
td.p-1
.btn-group
button.btn.btn-outline-primary.btn-sm.dropdown-toggle data-bs-toggle="dropdown" type="button" = t('shared.actions_button')
ul.dropdown-menu.float-end role="menu"
li = link_to(t('shared.show'), exercise, 'data-turbolinks' => "false", class: 'dropdown-item') if policy(exercise).show?
button.btn.btn-outline-primary.btn-sm.dropdown-toggle data-bs-toggle='dropdown' type='button' = t('shared.actions_button')
ul.dropdown-menu.float-end role='menu'
li = link_to(t('shared.show'), exercise, 'data-turbolinks': 'false', class: 'dropdown-item') if policy(exercise).show?
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(t('shared.destroy'), exercise, data: {confirm: t('shared.confirm_destroy')}, method: :delete, class: 'dropdown-item') if policy(exercise).destroy?
li = link_to(t('.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?
li = link_to(t('exercises.export_codeharbor.label'), '', class: 'dropdown-item export-start', data: {'exercise-id': exercise.id}) if policy(exercise).export_external_confirm?
= render('shared/pagination', collection: @exercises)
p = render('shared/new_button', model: Exercise)