From 188986404978cd515ad98490c3b31b645528627a Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 25 Jun 2017 10:22:16 -0500 Subject: [PATCH 1/2] /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| %> - + <% if CurrentUser.is_moderator? %>
<%= 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) %> From 4681812607bc16361f8a6bd674dbdd4cf870c19b Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 25 Jun 2017 10:28:46 -0500 Subject: [PATCH 2/2] /artist_commentary_versions: format commentary as dtext. --- app/views/artist_commentary_versions/index.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/artist_commentary_versions/index.html.erb b/app/views/artist_commentary_versions/index.html.erb index 271026055..4f8c20534 100644 --- a/app/views/artist_commentary_versions/index.html.erb +++ b/app/views/artist_commentary_versions/index.html.erb @@ -32,11 +32,15 @@

<%= h(commentary_version.original_title) %>

- <%= h(commentary_version.original_description) %> +
+ <%= format_text(commentary_version.original_description) %> +

<%= h(commentary_version.translated_title) %>

- <%= h(commentary_version.translated_description) %> +
+ <%= format_text(commentary_version.translated_description) %> +