Fix HAML codestyle of moderation views

This commit is contained in:
Andreas Nedbal 2022-07-30 05:11:29 +02:00
parent 9c08522a7a
commit 08033361f7
3 changed files with 17 additions and 17 deletions

View File

@ -2,21 +2,21 @@
.card.moderationbox{ data: { id: report.id } }
.card-header
%img.avatar-sm{ src: report.user.profile_picture.url(:medium) }
= t('.reported_html',
= t(".reported_html",
user: user_screen_name(report.user),
content: report.type.sub('Reports::', ''),
content: report.type.sub("Reports::", ""),
time: time_tooltip(report))
.card-body
%p
- if report.type == 'Reports::User'
- if report.type == "Reports::User"
= user_screen_name report.target
- else
= report.target.content
%p
%b= t('.reason.heading')
%b= t(".reason.heading")
%br
- if report.reason.nil? || report.reason.strip.blank?
= t('.reason.none')
= t(".reason.none")
- else
- report.reason.lines.each do |reason|
- next if reason.strip.blank?
@ -24,10 +24,10 @@
.row
.col-md-8.col-sm-8.col-xs-8.text-left
%a.btn.btn-primary{ href: content_url(report) }
= t('.view', content: report.type.sub('Reports::', ''))
= t(".view", content: report.type.sub("Reports::", ""))
- if report.target.respond_to?(:user) && report.target.user
%a.btn.btn-primary{ href: user_path(report.target.user) }
= t('.view', content: t('activerecord.models.user.one'))
= t(".view", content: t("activerecord.models.user.one"))
.col-md-4.col-sm-4.col-xs-4.text-right
%button.btn.btn-default.btn-sm{ type: :button, name: 'mod-delete-report', data: { id: report.id } }
%button.btn.btn-default.btn-sm{ type: :button, name: "mod-delete-report", data: { id: report.id } }
%i.fa.fa-trash-o

View File

@ -1,11 +1,11 @@
#reports
- @reports.each do |r|
= render 'moderation/moderationbox', report: r
= render "moderation/moderationbox", report: r
- unless @reports.count.zero?
= render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @reports_last_id, permitted_params: %i[type]
= render "shared/cursored_pagination_dummy", more_data_available: @more_data_available, last_id: @reports_last_id, permitted_params: %i[type]
- if @more_data_available
.d-flex.justify-content-center.justify-content-sm-start
%button.btn.btn-light#load-more-btn{ type: :button, data: { last_id: @reports_last_id } }
= t 'views.actions.load'
= t("voc.load")

View File

@ -1,9 +1,9 @@
.card
.list-group
= list_group_item t('.all'), moderation_path
= list_group_item t('.answers'), moderation_path('answer')
= list_group_item t('.comments'), moderation_path('comment')
= list_group_item t('.users'), moderation_path('user')
= list_group_item t('.questions'), moderation_path('question')
= list_group_item t(".all"), moderation_path
= list_group_item t(".answers"), moderation_path("answer")
= list_group_item t(".comments"), moderation_path("comment")
= list_group_item t(".users"), moderation_path("user")
= list_group_item t(".questions"), moderation_path("question")
.d-none.d-sm-block= render 'shared/links'
.d-none.d-sm-block= render "shared/links"