Lint Slim files and fix offenses
The fixing was partially done manually and partially automatically.
This commit is contained in:

committed by
Dominic Sauer

parent
ddfa06ffaa
commit
9a9efd5caa
@@ -1,4 +1,4 @@
|
||||
- model = controller_path.classify.constantize rescue nil
|
||||
- model = controller_path.classify.constantize rescue nil # rubocop:disable Style/RescueModifier
|
||||
- if model
|
||||
- object = model.find_by(id: params[:id])
|
||||
- if (parent_model = model.try(:parent_resource))
|
||||
@@ -26,7 +26,7 @@
|
||||
- active_action = t("breadcrumbs.#{controller_name}.#{params[:action]}")
|
||||
|
||||
|
||||
- title = "#{application_name}"
|
||||
- title = application_name.to_s
|
||||
- title = "#{active_action} - #{title}" unless %w[index show].include? params[:action]
|
||||
- content_for :breadcrumbs do
|
||||
.container.mb-4
|
||||
|
@@ -4,14 +4,14 @@ li.nav-item.dropdown
|
||||
span.caret
|
||||
ul.dropdown-menu.p-0.mt-1 role='menu'
|
||||
li
|
||||
button.dropdown-item.d-flex.align-items-center data={ 'bs-theme-value': 'light' }
|
||||
button.dropdown-item.d-flex.align-items-center data={'bs-theme-value': 'light'}
|
||||
i.fa-fw.fa-solid.fa-sun
|
||||
= t('shared.color_mode.light')
|
||||
li
|
||||
button.dropdown-item.d-flex.align-items-center data={ 'bs-theme-value': 'dark' }
|
||||
button.dropdown-item.d-flex.align-items-center data={'bs-theme-value': 'dark'}
|
||||
i.fa-fw.fa-solid.fa-moon
|
||||
= t('shared.color_mode.dark')
|
||||
li
|
||||
button.dropdown-item.d-flex.align-items-center data={ 'bs-theme-value': 'auto' }
|
||||
button.dropdown-item.d-flex.align-items-center data={'bs-theme-value': 'auto'}
|
||||
i.fa-fw.fa-solid.fa-wand-magic-sparkles
|
||||
= t('shared.color_mode.auto')
|
||||
|
@@ -2,6 +2,6 @@
|
||||
#flash.container.fixed_error_messages data-message-failure=t('shared.message_failure') data-websocket-failure=t('shared.websocket_failure')
|
||||
- ApplicationController._flash_types.each do |severity|
|
||||
- flash_mapping = {alert: :warning, notice: :success}
|
||||
div.alert.flash class="alert-#{flash_mapping.fetch(severity, severity)} alert-dismissible fade show"
|
||||
.alert.flash class="alert-#{flash_mapping.fetch(severity, severity)} alert-dismissible fade show"
|
||||
p.mb-0 id="flash-#{severity}" == flash[severity]
|
||||
button.btn-close type="button" data-bs-dismiss="alert" aria-label="Close"
|
||||
button.btn-close type='button' data-bs-dismiss='alert' aria-label='Close'
|
||||
|
@@ -3,5 +3,5 @@ li.nav-item.dropdown
|
||||
= t("locales.#{I18n.locale}")
|
||||
span.caret
|
||||
ul.dropdown-menu.p-0.mt-1 role='menu'
|
||||
- I18n.available_locales.sort_by { |locale| t("locales.#{locale}") }.each do |locale|
|
||||
li = link_to(t("locales.#{locale}"), AuthenticatedUrlHelper.add_query_parameters(request.url, locale: locale), 'data-turbolinks' => "false", class: 'dropdown-item')
|
||||
- I18n.available_locales.sort_by {|locale| t("locales.#{locale}") }.each do |locale|
|
||||
li = link_to(t("locales.#{locale}"), AuthenticatedUrlHelper.add_query_parameters(request.url, locale:), 'data-turbolinks': 'false', class: 'dropdown-item')
|
||||
|
@@ -1,4 +1,4 @@
|
||||
- if current_user.try(:admin?) or current_user.try(:teacher?)
|
||||
- if current_user.try(:admin?) || current_user.try(:teacher?)
|
||||
ul.nav.navbar-nav
|
||||
li.nav-item.dropdown
|
||||
a.nav-link.dropdown-toggle.mx-3 data-bs-toggle='dropdown' href='#'
|
||||
@@ -6,8 +6,8 @@
|
||||
span.caret
|
||||
ul.dropdown-menu.p-0.mt-1 role='menu'
|
||||
- if current_user.admin?
|
||||
li = link_to(t('breadcrumbs.dashboard.show'), admin_dashboard_path, class: 'dropdown-item', 'data-turbolinks' => "false") if policy([:admin, :dashboard]).show?
|
||||
li = link_to(t('breadcrumbs.rails_admin.show'), rails_admin.dashboard_path, class: 'dropdown-item', 'data-turbolinks' => "false") if policy([:admin, :dashboard]).show?
|
||||
li = link_to(t('breadcrumbs.dashboard.show'), admin_dashboard_path, class: 'dropdown-item', 'data-turbolinks': 'false') if policy(%i[admin dashboard]).show?
|
||||
li = link_to(t('breadcrumbs.rails_admin.show'), rails_admin.dashboard_path, class: 'dropdown-item', 'data-turbolinks': 'false') if policy(%i[admin dashboard]).show?
|
||||
li = link_to(t('breadcrumbs.statistics.show'), statistics_path, class: 'dropdown-item') if policy(:statistics).show?
|
||||
li.dropdown-divider role='separator'
|
||||
= render('navigation_submenu', title: t('activerecord.models.exercise.other'),
|
||||
|
@@ -1,7 +1,7 @@
|
||||
- if models.any? { |model| policy(model).index? }
|
||||
- if models.any? {|model| policy(model).index? }
|
||||
li.dropdown-submenu
|
||||
- link = link.nil? ? "#" : link
|
||||
a.dropdown-item.dropdown-toggle href=link data-bs-toggle="dropdown" = title
|
||||
- link = '#' if link.nil?
|
||||
a.dropdown-item.dropdown-toggle href=link data-bs-toggle='dropdown' = title
|
||||
ul.dropdown-menu.p-0
|
||||
- models.each do |model|
|
||||
= render('navigation_collection_link', model: model, cached: true)
|
||||
= render('navigation_collection_link', model:, cached: true)
|
||||
|
@@ -8,8 +8,8 @@
|
||||
li = link_to(t('request_for_comments.index.all'), request_for_comments_path, class: 'dropdown-item') if policy(:request_for_comment).index?
|
||||
li = link_to(t('request_for_comments.index.my_rfc_activity'), my_rfc_activity_path, class: 'dropdown-item')
|
||||
li = link_to(t('request_for_comments.index.my_comment_requests'), my_request_for_comments_path, class: 'dropdown-item')
|
||||
- if current_user.try(:admin?) or current_user.try(:teacher?) or current_user.try(:internal_user?)
|
||||
li = link_to(t('consumers.show.link'), current_user.consumer, class: 'dropdown-item') if current_user.consumer and policy(current_user.consumer).show?
|
||||
- if current_user.try(:admin?) || current_user.try(:teacher?) || current_user.try(:internal_user?)
|
||||
li = link_to(t('consumers.show.link'), current_user.consumer, class: 'dropdown-item') if current_user.consumer && policy(current_user.consumer).show?
|
||||
li = link_to(t('internal_users.show.link'), current_user, class: 'dropdown-item') if policy(current_user).show?
|
||||
li = link_to(t('sessions.destroy.link'), sign_out_path, method: :delete, class: 'dropdown-item')
|
||||
- else
|
||||
|
@@ -1,8 +1,8 @@
|
||||
- unless local_assigns[:modal]
|
||||
h1 = t('shared.help.headline')
|
||||
|
||||
- if local_assigns.has_key?(:execution_environment)
|
||||
h2 = t('shared.help.execution_environment_specific_help', execution_environment: execution_environment)
|
||||
- if local_assigns.key?(:execution_environment)
|
||||
h2 = t('shared.help.execution_environment_specific_help', execution_environment:)
|
||||
= render_markdown(execution_environment.help)
|
||||
|
||||
- content_for :modal_footer do
|
||||
|
@@ -1,8 +1,8 @@
|
||||
h1 = t('.title', application_name: application_name)
|
||||
h1 = t('.title', application_name:)
|
||||
|
||||
- if current_user.try(:admin?) or current_user.try(:teacher?)
|
||||
- if current_user.try(:admin?) || current_user.try(:teacher?)
|
||||
p = t('.text_signed_in_as_internal_user', user_name: current_user.displayname)
|
||||
- elsif current_user.try(:external_user?)
|
||||
p = t('.text_signed_in_as_external_user', application_name: application_name)
|
||||
p = t('.text_signed_in_as_external_user', application_name:)
|
||||
- else
|
||||
p == t('.text_signed_out', application_name: application_name, sign_in_path: sign_in_path)
|
||||
p == t('.text_signed_out', application_name:, sign_in_path:)
|
||||
|
Reference in New Issue
Block a user