replacements: link to old and new media assets.

On the /post_events and /post_replacements pages, include links to the old and new media assets
pages so you can compare the two images.
This commit is contained in:
evazion
2022-11-10 21:53:20 -06:00
parent 6f61abc6a7
commit 0a792fbb8a
4 changed files with 49 additions and 17 deletions

View File

@@ -32,10 +32,10 @@
<% if post_replacement.old_md5.present? && post_replacement.md5.present? %>
<dl>
<dt>Original MD5</dt>
<dd><%= post_replacement.old_md5 %></dd>
<dd><%= link_to_if post_replacement.old_media_asset.present?, post_replacement.old_md5, post_replacement.old_media_asset %></dd>
<dt>Replacement MD5</dt>
<dd><%= post_replacement.md5 %></dd>
<dd><%= link_to_if post_replacement.media_asset.present?, post_replacement.md5, post_replacement.media_asset %></dd>
</dl>
<% end %>
<% end %>
@@ -44,14 +44,12 @@
<dl>
<dt>Original Size</dt>
<dd>
<%= post_replacement.old_image_width %>x<%= post_replacement.old_image_height %>
(<%= post_replacement.old_file_size.to_formatted_s(:human_size, precision: 4) %>, <%= post_replacement.old_file_ext %>)
<%= link_to_if post_replacement.old_media_asset.present?, "#{post_replacement.old_image_width}x#{post_replacement.old_image_height} (#{post_replacement.old_file_size.to_fs(:human_size, precision: 4)}, #{post_replacement.old_file_ext})", post_replacement.old_media_asset %>
</dd>
<dt>Replacement Size</dt>
<dd>
<%= post_replacement.image_width %>x<%= post_replacement.image_height %>
(<%= post_replacement.file_size.to_formatted_s(:human_size, precision: 4) %>, <%= post_replacement.file_ext %>)
<%= link_to_if post_replacement.media_asset.present?, "#{post_replacement.image_width}x#{post_replacement.image_height} (#{post_replacement.file_size.to_fs(:human_size, precision: 4)}, #{post_replacement.file_ext})", post_replacement.media_asset %>
</dd>
</dl>
<% end %>