From 188986404978cd515ad98490c3b31b645528627a Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 25 Jun 2017 10:22:16 -0500 Subject: [PATCH] /artist_commentary_versions: show post thumbnails. Show thumbnails in the /artist_commentary_versions listing. Don't show thumbnails when viewing the version history of a single post. --- app/models/artist_commentary_version.rb | 1 + app/views/artist_commentary_versions/index.html.erb | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/models/artist_commentary_version.rb b/app/models/artist_commentary_version.rb index 799f359bc..83f335919 100644 --- a/app/models/artist_commentary_version.rb +++ b/app/models/artist_commentary_version.rb @@ -1,5 +1,6 @@ class ArtistCommentaryVersion < ApplicationRecord before_validation :initialize_updater + belongs_to :post belongs_to :updater, :class_name => "User" scope :for_user, lambda {|user_id| where("updater_id = ?", user_id)} attr_accessible :post_id, :original_title, :original_description, :translated_title, :translated_description diff --git a/app/views/artist_commentary_versions/index.html.erb b/app/views/artist_commentary_versions/index.html.erb index cf6be852e..271026055 100644 --- a/app/views/artist_commentary_versions/index.html.erb +++ b/app/views/artist_commentary_versions/index.html.erb @@ -2,6 +2,8 @@

Artist Commentary Changes

+ <%= render "posts/partials/common/inline_blacklist" %> + @@ -21,7 +23,13 @@ <% @commentary_versions.each do |commentary_version| %> - +
<%= link_to commentary_version.post_id, post_path(commentary_version.post_id) %> + <% if params.dig(:search, :post_id).present? %> + <%= link_to commentary_version.post_id, post_path(commentary_version.post_id) %> + <% else %> + <%= PostPresenter.preview(commentary_version.post, :tags => "status:any") %> + <% end %> +

<%= h(commentary_version.original_title) %>

<%= h(commentary_version.original_description) %>