2019-04-26 06:17:10 -04:00
|
|
|
Report.add_report('flags') do |report|
|
|
|
|
category_filter = report.filters.dig(:category)
|
|
|
|
report.add_filter('category', default: category_filter)
|
|
|
|
|
2019-03-29 05:54:56 -04:00
|
|
|
report.icon = 'flag'
|
|
|
|
report.higher_is_better = false
|
|
|
|
|
|
|
|
basic_report_about(
|
|
|
|
report,
|
|
|
|
ReviewableFlaggedPost,
|
|
|
|
:count_by_date,
|
|
|
|
report.start_date,
|
|
|
|
report.end_date,
|
2019-04-26 06:17:10 -04:00
|
|
|
category_filter
|
2019-03-29 05:54:56 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
countable = ReviewableFlaggedPost.scores_with_topics
|
2019-04-26 06:17:10 -04:00
|
|
|
|
|
|
|
if category_filter
|
|
|
|
countable.merge!(Topic.in_category_and_subcategories(category_filter))
|
|
|
|
end
|
2019-03-29 05:54:56 -04:00
|
|
|
|
|
|
|
add_counts report, countable, 'reviewable_scores.created_at'
|
|
|
|
end
|