Sha256: 1fb5a6ae33735391261ab283b3360309ba923d7a2149cce907e6dfb3ae3fe94e

Contents?: true

Size: 1.83 KB

Versions: 3

Compression:

Stored size: 1.83 KB

Contents

<div class="media-modal modal fade" tabindex="-1" data-controller="remote-modal media-modal" data-name="<%= name %>" data-min="<%= min %>" data-max="<%= max %>">
  <div class="modal-dialog modal-lg modal-dialog-scrollable">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">
          <%= t(".title", count: min.to_i < 1 ? 1 : min.to_i) %>
        </h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<%= t(".close") %>"></button>
      </div>
      <div class="modal-body">
        <%= turbo_frame_tag "thumbnails", class: "d-flex flex-wrap gap-2" do %>
          <% @blobs.each do |blob| %>
            <%= render "headmin/media/item", blob: blob %>
          <% end %>
          <div data-media-modal-target="placeholder" class="<%= "d-none" if !@blobs.empty? %>">
            <p><%= t(".placeholder") %></p>
          </div>
        <% end %>
      </div>
      <div class="modal-footer">
        <%= form_with url: headmin_media_path, multipart: true, data: {"media-modal-target": "form"}, class: "me-auto" do |form| %>
          <%= form.label :files, class: "btn h-btn-outline-light" do %>
            <%= bootstrap_icon("upload") %>
            <%= t(".upload") %>
            <%= form.file_field :files, class: "d-none", multiple: true, data: {action: "change->media-modal#submitForm"} %>
          <% end %>
        <% end %>
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><%= t(".close") %></button>
        <button type="button" class="btn btn-primary" data-bs-dismiss="modal" data-action="click->media-modal#select" data-media-modal-target="selectButton">
          <%= t(".select") %> (<span data-media-modal-target="count">0</span><%= t(".maximum", count: max.to_i) if max.present? %>)
        </button>
      </div>
    </div>
  </div>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
headmin-0.5.5 app/views/headmin/media/_modal.html.erb
headmin-0.5.4 app/views/headmin/media/_modal.html.erb
headmin-0.5.3 app/views/headmin/media/_modal.html.erb