posts: rework post events page.

* Add a global /post_events page that shows the history of all approvals,
  disapprovals, flags, appeals, and replacements on a single page.

* Redesign the /posts/:id/events page to show all approval, disapproval,
  flag, appeal, and replacement events for a single post (before it only
  showed approvals, flags, and appeals).

* Remove the replacement history link from the post show page. Replacements
  are now included in the post events page (closes #4948: Highlighed replacements).

* Add /post_approvals/:id and /post_replacements/:id routes (these are
  used by the "Details" link on the post events page).
This commit is contained in:
evazion
2022-09-24 17:41:23 -05:00
parent fc122cbc5a
commit 361af6a4cb
26 changed files with 455 additions and 201 deletions

View File

@@ -70,6 +70,7 @@ class Post < ApplicationRecord
has_many :favorites, dependent: :destroy
has_many :replacements, class_name: "PostReplacement", :dependent => :destroy
has_many :ai_tags, through: :media_asset
has_many :events, class_name: "PostEvent"
attr_accessor :old_tag_string, :old_parent_id, :old_source, :old_rating, :has_constraints, :disable_versioning, :post_edit
@@ -1631,7 +1632,7 @@ class Post < ApplicationRecord
def self.available_includes
# attributes accessible through the ?only= parameter
%i[
uploader approver flags appeals parent children notes
uploader approver flags appeals events parent children notes
comments approvals disapprovals replacements pixiv_ugoira_frame_data
artist_commentary media_asset ai_tags
]