forum: make status labels into clickable filters.

* Make it so that you can click the stickied / locked / deleted icons or
  the new / approved / pending / rejected labels to filter topics by
  that status.

* Replace the `mod_only` search param with `is_private`.
This commit is contained in:
evazion
2020-03-16 17:32:26 -05:00
parent 95d65b25e2
commit 8253df84d9
6 changed files with 54 additions and 20 deletions

View File

@@ -19,6 +19,9 @@ class BulkUpdateRequest < ApplicationRecord
scope :pending_first, -> { order(Arel.sql("(case status when 'pending' then 0 when 'approved' then 1 else 2 end)")) }
scope :pending, -> {where(status: "pending")}
scope :approved, -> { where(status: "approved") }
scope :rejected, -> { where(status: "rejected") }
scope :has_topic, -> { where.not(forum_topic: nil) }
scope :expired, -> {where("created_at < ?", TagRelationship::EXPIRY.days.ago)}
scope :old, -> {where("created_at between ? and ?", TagRelationship::EXPIRY.days.ago, TagRelationship::EXPIRY_WARNING.days.ago)}