24 lines
894 B
Plaintext
24 lines
894 B
Plaintext
<%= turbo_frame_tag dom_id(entry, :images) do %>
|
|
<% if entry.images.attached? %>
|
|
<div class="entry-images">
|
|
<% entry.images.each do |image| %>
|
|
<figure class="entry-image">
|
|
<%= link_to rails_blob_path(image, disposition: "inline"), target: "_blank", rel: "noopener" do %>
|
|
<%= image_tag rails_blob_path(image, disposition: "inline"), alt: image.filename.to_s, class: "entry-image__thumbnail" %>
|
|
<% end %>
|
|
|
|
<figcaption><%= image.filename %></figcaption>
|
|
|
|
<%= button_to "Delete", delete_path_for.call(image), method: :delete, class: "button button--danger button--small" %>
|
|
</figure>
|
|
<% end %>
|
|
</div>
|
|
<% else %>
|
|
<span>No images attached.</span>
|
|
<% end %>
|
|
|
|
<p class="entry-images__actions">
|
|
<%= link_to "Add images", add_path, class: "button button--secondary button--small" %>
|
|
</p>
|
|
<% end %>
|