Added account_flags_block partial to admin pages

• Added:
- account_flags_block partial to admin pages (groups, accounts, reports) so admin/moderators can easily see pro, verified, investor, donor, spam flags of an account
This commit is contained in:
Developer 2021-02-18 16:49:14 -05:00
parent c7df309df5
commit fa74c34095
5 changed files with 21 additions and 16 deletions

View File

@ -9,14 +9,4 @@
%td %td
%samp= number_with_delimiter account.statuses.count %samp= number_with_delimiter account.statuses.count
%td %td
%div{ :style => "display:flex;flex-direction:row;" } = render 'admin/accounts/account_flags_block', :account => account
- if account.is_flagged_as_spam
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#781600;border-radius:6px;color:#fff;width:40px;line-height:22px;font-weight:600;padding:2px 0 0 6px;" } SPAM
- if account.is_pro
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#FFD700;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } P
- if account.is_verified
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#fff;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } V
- if account.is_donor
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#4EA6FF;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } D
- if account.is_investor
%span{ :style => "display:inline-block;font-size:12px;background-color:#6DD900;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } I

View File

@ -0,0 +1,11 @@
%div{ :style => "display:flex;flex-direction:row;" }
- if account.is_flagged_as_spam
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#781600;border-radius:6px;color:#fff;width:40px;line-height:22px;font-weight:600;padding:2px 0 0 6px;" } SPAM
- if account.is_pro
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#FFD700;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } P
- if account.is_verified
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#fff;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } V
- if account.is_donor
%span{ :style => "display:inline-block;margin-right:4px;font-size:12px;background-color:#4EA6FF;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } D
- if account.is_investor
%span{ :style => "display:inline-block;font-size:12px;background-color:#6DD900;border-radius:6px;color:#292929;width:24px;line-height:22px;font-weight:600;text-align:center;padding:2px 0 0 2px;" } I

View File

@ -85,14 +85,16 @@
%th Role %th Role
%tbody %tbody
%tr %tr
%td %td{style: "display:flex;flex-direction:row;align-items:center;"}
= admin_account_link_to(@group.account) = admin_account_link_to(@group.account)
%div{style:"margin-left:10px;"}= render 'admin/accounts/account_flags_block', :account => @group.account
%td %td
%span Group Creator %span Group Creator
- @admins.each do |acct| - @admins.each do |acct|
%tr %tr
%td %td{style: "display:flex;flex-direction:row;align-items:center;"}
= admin_account_link_to(acct.account) = admin_account_link_to(acct.account)
%div{style:"margin-left:10px;"}= render 'admin/accounts/account_flags_block', :account => acct.account
%td %td
%span Admin %span Admin
- @mods.each do |acct| - @mods.each do |acct|

View File

@ -27,13 +27,13 @@
%th= t('admin.reports.reported_account') %th= t('admin.reports.reported_account')
%td= admin_account_link_to @report.target_account %td= admin_account_link_to @report.target_account
%td= table_link_to 'flag', pluralize(@report.target_account.targeted_reports.count, t('admin.reports.account.report')), admin_reports_path(target_account_id: @report.target_account.id) %td= table_link_to 'flag', pluralize(@report.target_account.targeted_reports.count, t('admin.reports.account.report')), admin_reports_path(target_account_id: @report.target_account.id)
%td= table_link_to 'file', pluralize(@report.target_account.targeted_moderation_notes.count, t('admin.reports.account.note')), admin_reports_path(target_account_id: @report.target_account.id) %td= render 'admin/accounts/account_flags_block', :account => @report.target_account
%tr %tr
%th= t('admin.reports.reported_by') %th= t('admin.reports.reported_by')
- if @report.account.local? - if @report.account.local?
%td= admin_account_link_to @report.account %td= admin_account_link_to @report.account
%td= table_link_to 'flag', pluralize(@report.account.targeted_reports.count, t('admin.reports.account.report')), admin_reports_path(target_account_id: @report.account.id) %td= table_link_to 'flag', pluralize(@report.account.targeted_reports.count, t('admin.reports.account.report')), admin_reports_path(target_account_id: @report.account.id)
%td= table_link_to 'file', pluralize(@report.account.targeted_moderation_notes.count, t('admin.reports.account.note')), admin_reports_path(target_account_id: @report.account.id) %td= render 'admin/accounts/account_flags_block', :account => @report.account
- else - else
%td{ colspan: 3 }= @report.account.domain %td{ colspan: 3 }= @report.account.domain
%tr %tr

View File

@ -10,8 +10,10 @@
= image_tag account.avatar.url, alt: '', width: 48, height: 48, class: 'u-photo' = image_tag account.avatar.url, alt: '', width: 48, height: 48, class: 'u-photo'
.display-name .display-name
%span{id: "default_account_display_name", style: "display:none;"}= account.username %span{id: "default_account_display_name", style: "display:none;"}= account.username
%bdi %span{style: "display:flex;flex-direction:row;align-items:center;"}
%strong.emojify.p-name= display_name(account, custom_emojify: true) %strong.emojify.p-name= display_name(account, custom_emojify: true)
%div{style: "margin-left:auto;"}
= render 'admin/accounts/account_flags_block', :account => @account
%span %span
= acct(account) = acct(account)
= fa_icon('lock') if account.locked? = fa_icon('lock') if account.locked?