Sha256: 7ce96a68e9c9bd453cfd3f880f8604e34da3a47c8b43e299fd0c0d6de751fd9b

Contents?: true

Size: 1.41 KB

Versions: 12

Compression:

Stored size: 1.41 KB

Contents

<%
  # formstrap/media/item
  #
  # ==== Required parameters
  # * +form+ - Form object
  # * +url+ - URL for the media modal
  #
  # ==== Optional parameters
  # * +sort+ - Allow sorting by dragging items. `active_storage_attachments` must have a position column.
  # * +width+ - Width of the thumbnail
  # * +height+ - Height of the thumbnail
  # * +edit_url+ - URL for the edit modal
  #

  media_item = Formstrap::MediaItemView.new(local_assigns)
%>

<div class="formstrap-file-thumbnail media-drag-sort-handle" title="<%= "#{media_item.filename} (#{media_item.size})" %>" data-media-target="item">
  <%= form.hidden_field(:id) %>
  <%= form.hidden_field(:blob_id) %>
  <%= form.hidden_field(:position, value: media_item.position_value) if media_item.sort %>
  <%= form.hidden_field(:_destroy) %>

  <a href="<%= media_item.url %>" data-turbo-frame="modal" data-media-target="modalButton">
    <%= render "formstrap/shared/thumbnail", media_item.thumbnail_options %>
  </a>

  <div class="formstrap-file-thumbnail-actions">
    <!-- Edit -->
    <% if media_item.edit_url %>
      <a href="<%= media_item.edit_url %>" class="formstrap-file-thumbnail-edit" data-turbo-frame="modal" data-media-target="editButton">
        <%= bootstrap_icon("pencil") %>
      </a>
    <% end %>

    <!-- Remove -->
    <div class="formstrap-file-thumbnail-remove" data-action="click->media#destroy">
      <%= bootstrap_icon("x") %>
    </div>
  </div>
</div>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
formstrap-0.4.5 app/views/formstrap/media/_item.html.erb
formstrap-0.4.4 app/views/formstrap/media/_item.html.erb
formstrap-0.4.3 app/views/formstrap/media/_item.html.erb
formstrap-0.4.2 app/views/formstrap/media/_item.html.erb
formstrap-0.3.5 app/views/formstrap/media/_item.html.erb
formstrap-0.3.4 app/views/formstrap/media/_item.html.erb
formstrap-0.3.3 app/views/formstrap/media/_item.html.erb
formstrap-0.3.2 app/views/formstrap/media/_item.html.erb
formstrap-0.3.1 app/views/formstrap/media/_item.html.erb
formstrap-0.3.0 app/views/formstrap/media/_item.html.erb
formstrap-0.2.1 app/views/formstrap/media/_item.html.erb
formstrap-0.2.0 app/views/formstrap/media/_item.html.erb