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

@@ -80,5 +80,23 @@ class PostApprovalsControllerTest < ActionDispatch::IntegrationTest
should respond_to_search(post: {uploader_name: "komachi"}).with { @post_approval }
end
end
context "show action" do
setup do
@approval = create(:post_approval)
end
should "render for html" do
get post_approval_path(@approval)
assert_redirected_to post_approvals_path(search: { id: @approval.id })
end
should "render for json" do
get post_approval_path(@approval), as: :json
assert_response :success
end
end
end
end