/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.
This commit is contained in:
evazion
2017-06-25 10:22:16 -05:00
parent 3e1b687b8d
commit 1889864049
2 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

@@ -2,6 +2,8 @@
<div id="a-index">
<h1>Artist Commentary Changes</h1>
<%= render "posts/partials/common/inline_blacklist" %>
<table width="100%" class="striped">
<thead>
<tr>
@@ -21,7 +23,13 @@
<tbody>
<% @commentary_versions.each do |commentary_version| %>
<tr>
<td><%= link_to commentary_version.post_id, post_path(commentary_version.post_id) %></td>
<td>
<% 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 %>
</td>
<td>
<h3><%= h(commentary_version.original_title) %></h3>
<%= h(commentary_version.original_description) %>