Added new flags to admin dashboard account search
• Added: - new flags to admin dashboard account search for PRO, investor, donor, verified - moved spam to the flags column instead of next to username • Removed: - IP Address in account list • Updated: - Title for flags in account moderation header
This commit is contained in:
parent
65d8c7ee86
commit
30c05a6e96
|
@ -215,6 +215,10 @@ module Admin
|
|||
:note,
|
||||
:status_count_gte,
|
||||
:sign_up_date_gte,
|
||||
:is_pro,
|
||||
:is_investor,
|
||||
:is_verified,
|
||||
:is_donor,
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Admin::FilterHelper
|
||||
ACCOUNT_FILTERS = %i(local remote by_domain active pending silenced suspended username display_name email ip note staff spam).freeze
|
||||
ACCOUNT_FILTERS = %i(local remote by_domain active pending silenced suspended username display_name email ip note staff spam is_pro is_investor is_donor is_verified).freeze
|
||||
REPORT_FILTERS = %i(resolved account_id target_account_id).freeze
|
||||
INVITE_FILTER = %i(available expired).freeze
|
||||
CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze
|
||||
|
|
|
@ -60,6 +60,14 @@ class AccountFilter
|
|||
Account.where("created_at >= ?", value)
|
||||
when "spam"
|
||||
Account.where(is_flagged_as_spam: true)
|
||||
when "is_pro"
|
||||
Account.where(is_pro: true)
|
||||
when "is_investor"
|
||||
Account.where(is_investor: true)
|
||||
when "is_donor"
|
||||
Account.where(is_donor: true)
|
||||
when "is_verified"
|
||||
Account.where(is_verified: true)
|
||||
else
|
||||
raise "Unknown filter: #{key}"
|
||||
end
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
%tr
|
||||
%td
|
||||
= admin_account_link_to(account)
|
||||
- if account.is_flagged_as_spam
|
||||
%span{ :style => "display:block;margin:5px 0 0 20px;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
|
||||
%td
|
||||
- if account.user_current_sign_in_ip
|
||||
%samp.ellipsized-ip{ title: account.user_current_sign_in_ip }= account.user_current_sign_in_ip
|
||||
- else
|
||||
\-
|
||||
%td
|
||||
- if account.user_current_sign_in_at
|
||||
%time.time-ago{ datetime: account.user_current_sign_in_at.iso8601, title: l(account.user_current_sign_in_at) }= l account.user_current_sign_in_at
|
||||
- else
|
||||
\-
|
||||
%td
|
||||
%samp= number_with_delimiter account.statuses.count
|
||||
%samp= number_with_delimiter account.statuses.count
|
||||
%td
|
||||
%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
|
|
@ -10,10 +10,14 @@
|
|||
%li= filter_link_to t('admin.accounts.moderation.suspended'), suspended: '1', silenced: nil, pending: nil
|
||||
|
||||
.filter-subset
|
||||
%strong Permissions
|
||||
%strong Flags
|
||||
%ul
|
||||
%li= filter_link_to "All", spam: nil
|
||||
%li= filter_link_to "All", spam: nil, is_pro: nil, is_donor: nil, is_investor: nil, is_verified: nil
|
||||
%li= filter_link_to "Spam", spam: '1'
|
||||
%li= filter_link_to "PRO", is_pro: '1'
|
||||
%li= filter_link_to "Donor", is_donor: '1'
|
||||
%li= filter_link_to "Investor", is_investor: '1'
|
||||
%li= filter_link_to "Verified", is_verified: '1'
|
||||
|
||||
.filter-subset
|
||||
%strong= t('admin.accounts.role')
|
||||
|
@ -47,9 +51,9 @@
|
|||
%thead
|
||||
%tr
|
||||
%th= t('admin.accounts.username')
|
||||
%th= t('admin.accounts.most_recent_ip')
|
||||
%th= t('admin.accounts.most_recent_activity')
|
||||
%th Status count
|
||||
%th Flags
|
||||
%th
|
||||
%tbody
|
||||
= render @accounts
|
||||
|
|
Loading…
Reference in New Issue