Added search to admin reports page
• Added: - search to admin reports page
This commit is contained in:
parent
7c6ef8bb9d
commit
285aa17024
@ -55,6 +55,7 @@ module Admin
|
|||||||
params.permit(
|
params.permit(
|
||||||
:account_id,
|
:account_id,
|
||||||
:resolved,
|
:resolved,
|
||||||
|
:comment,
|
||||||
:target_account_id
|
:target_account_id
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -23,6 +23,8 @@ class ReportFilter
|
|||||||
Report.where(account_id: value)
|
Report.where(account_id: value)
|
||||||
when :target_account_id
|
when :target_account_id
|
||||||
Report.where(target_account_id: value)
|
Report.where(target_account_id: value)
|
||||||
|
when :comment
|
||||||
|
Report.where(comment: value)
|
||||||
else
|
else
|
||||||
raise "Unknown filter: #{key}"
|
raise "Unknown filter: #{key}"
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,16 @@
|
|||||||
%li= filter_link_to t('admin.reports.unresolved'), resolved: nil
|
%li= filter_link_to t('admin.reports.unresolved'), resolved: nil
|
||||||
%li= filter_link_to t('admin.reports.resolved'), resolved: '1'
|
%li= filter_link_to t('admin.reports.resolved'), resolved: '1'
|
||||||
|
|
||||||
|
= form_tag admin_reports_url, method: 'GET', class: 'simple_form' do
|
||||||
|
.fields-group
|
||||||
|
- %i(comment).each do |key|
|
||||||
|
.input.string.optional
|
||||||
|
= text_field_tag key, params[key], class: 'string optional', placeholder: "#{key}"
|
||||||
|
|
||||||
|
.actions
|
||||||
|
%button= t('admin.accounts.search')
|
||||||
|
= link_to t('admin.accounts.reset'), admin_accounts_path, class: 'button negative'
|
||||||
|
|
||||||
- @reports.group_by(&:target_account_id).each do |target_account_id, reports|
|
- @reports.group_by(&:target_account_id).each do |target_account_id, reports|
|
||||||
- target_account = reports.first.target_account
|
- target_account = reports.first.target_account
|
||||||
.report-card
|
.report-card
|
||||||
|
Loading…
x
Reference in New Issue
Block a user