attachment_thumbnails_in_issue_history-20151007.diff

Go MAEDA, 2015-10-07 06:59

Download (1.52 KB)

View differences:

app/views/issues/_history.html.erb (working copy)
13 13
       <li><%= string %></li>
14 14
      <% end %>
15 15
    </ul>
16
    <% if Setting.thumbnails_enabled? %>
17
      <% thumbnail_attachments = journal.details.map{|d| d.property == 'attachment' && d.value.present? && Attachment.find_by_id(d.prop_key)}.select{|a| a.try(:thumbnailable?)} %>
18
      <% if thumbnail_attachments.any? %>
19
        <div class="thumbnails">
20
          <% thumbnail_attachments.each do |attachment| %>
21
            <div><%= thumbnail_tag(attachment) %></div>
22
          <% end %>
23
        </div>
24
      <% end %>
16 25
    <% end %>
26
    <% end %>
17 27
    <%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
18 28
    </div>
19 29
  </div>
public/stylesheets/application.css (working copy)
593 593

  
594 594
div.thumbnails {margin-top:0.6em;}
595 595
div.thumbnails div {background:#fff;border:2px solid #ddd;display:inline-block;margin-right:2px;}
596
div.thumbnails img {margin: 3px;}
596
div.thumbnails img {margin: 3px; vertical-align: middle;}
597
#history div.thumbnails {margin-left: 2em;}
597 598

  
598 599
p.other-formats { text-align: right; font-size:0.9em; color: #666; }
599 600
.other-formats span + span:before { content: "| "; }