aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2018-02-14 09:19:12 -0500
committerJavan Makhmali <javan@javan.us>2018-02-14 09:19:12 -0500
commit28525b4ccad9aca42e4e1d9588c4f0724449f1c7 (patch)
tree1fc8bdf07cd10015832bad9ee383072882bbccbd /app
parent0f6e9b7cc59e3fe94013c5b9730129930ada370b (diff)
downloadrails-28525b4ccad9aca42e4e1d9588c4f0724449f1c7.tar.gz
rails-28525b4ccad9aca42e4e1d9588c4f0724449f1c7.tar.bz2
rails-28525b4ccad9aca42e4e1d9588c4f0724449f1c7.zip
Build out basic blob template to match the editor's
Diffstat (limited to 'app')
-rw-r--r--app/views/active_storage/blobs/_blob.html.erb19
1 files changed, 14 insertions, 5 deletions
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 @@
-<h2>Engine <code>blob/_blob</code>:</h2>
+<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> 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 %>
-
-<figure>
- <%= image_tag rails_blob_path(blob) %>
+ <figcaption class="attachment__caption">
+ <% if caption = blob.try(:caption) %>
+ <%= caption %>
+ <% else %>
+ <span class="attachment__name"><%= blob.filename %></span>
+ <span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
+ <% end %>
+ </figcaption>
</figure>