From 28525b4ccad9aca42e4e1d9588c4f0724449f1c7 Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Wed, 14 Feb 2018 09:19:12 -0500 Subject: Build out basic blob template to match the editor's --- app/views/active_storage/blobs/_blob.html.erb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'app/views/active_storage/blobs/_blob.html.erb') diff --git a/app/views/active_storage/blobs/_blob.html.erb b/app/views/active_storage/blobs/_blob.html.erb index 2b17745c8d..c7c70c110e 100644 --- a/app/views/active_storage/blobs/_blob.html.erb +++ b/app/views/active_storage/blobs/_blob.html.erb @@ -1,7 +1,16 @@ -

Engine blob/_blob:

+
attachment--<%= blob.filename.extension %>"> + <% if blob.variable? %> + <%= image_tag blob.variant(resize: "1024x768>") %> + <% elsif blob.previewable? %> + <%= image_tag blob.preview(resize: "1024x768>") %> + <% end %> -<%= debug blob %> - -
- <%= image_tag rails_blob_path(blob) %> +
+ <% if caption = blob.try(:caption) %> + <%= caption %> + <% else %> + <%= blob.filename %> + <%= number_to_human_size blob.byte_size %> + <% end %> +
-- cgit v1.2.3