Files
danbooru/app/controllers/artist_commentary_versions_controller.rb
BrokenEagle e23ee170f5 Add alternate comparison types to versions
- The types are:
-- Previous: The default and the previously used type
-- Subsequent: Compares against the next version
-- Current: Compares against the current version
- Allow switching between comparison types in index and diff views
-- Have links vary depending upon current comparison type
2020-03-17 18:31:20 +00:00

19 lines
631 B
Ruby

class ArtistCommentaryVersionsController < ApplicationController
respond_to :html, :xml, :json
def index
set_version_comparison
@commentary_versions = ArtistCommentaryVersion.paginated_search(params)
@commentary_versions = @commentary_versions.includes(:updater, post: :uploader) if request.format.html?
respond_with(@commentary_versions)
end
def show
@commentary_version = ArtistCommentaryVersion.find(params[:id])
respond_with(@commentary_version) do |format|
format.html { redirect_to artist_commentary_versions_path(search: { post_id: @commentary_version.post_id }) }
end
end
end