replacements: link to old and new media assets.

On the /post_events and /post_replacements pages, include links to the old and new media assets
pages so you can compare the two images.
This commit is contained in:
evazion
2022-11-10 21:53:20 -06:00
parent 6f61abc6a7
commit 0a792fbb8a
4 changed files with 49 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ class PostEventsController < ApplicationController
end
@post_events = authorize PostEvent.paginated_search(params, defaults: { post_id: @post&.id }, count_pages: @post.present?)
@post_events = @post_events.includes(:creator, :post, model: [:post]) if request.format.html?
@post_events = @post_events.includes(:creator, :post, model: [:post, :media_asset, :old_media_asset]) if request.format.html?
respond_with(@post_events)
end

View File

@@ -31,7 +31,7 @@ class PostReplacementsController < ApplicationController
def index
params[:search][:post_id] = params.delete(:post_id) if params.key?(:post_id)
@post_replacements = authorize PostReplacement.paginated_search(params)
@post_replacements = @post_replacements.includes(:creator, post: [:uploader, :media_asset]) if request.format.html?
@post_replacements = @post_replacements.includes(:creator, :old_media_asset, :media_asset, post: [:uploader, :media_asset]) if request.format.html?
respond_with(@post_replacements)
end