Sha256: be6d4640dcbec8d459970e915554556cb3435737fb0654e5198fb00789027deb

Contents?: true

Size: 1.71 KB

Versions: 3

Compression:

Stored size: 1.71 KB

Contents

<h1 style="width:100%;">
  Document &middot; Assets

  <% if params[:document_id] %>
    <%= link_to '+ Upload Assets', display_attach_form_admin_document_document_assets_url(@document), { class: 'btn btn-primary float-right mr-2' } %>
  <% end %>
</h1>
<% if params[:document_id] %>
  <h2 class='h3'>
    <%= link_to(@document.title, admin_document_path(@document)) %>
    &middot;
    <%= @document_assets.count %> assets
  </h2>
<% else %>
  <h2 class='h3'>Assets</h2>
<% end %>

<% if @pagy %>
<h6>
  <span class='float-left mt-3'>
    <%== pagy_info(@pagy, 'assets'.pluralize(@pagy.count)) %>
  </span>
  <span class='float-right'>
    <%== pagy_bootstrap_nav(@pagy) %>
  </span>
</h6>
<% end %>

<div class="table-responsive">
  <table class="table table-striped table-bordered sortable">
    <thead class="thead-dark">
      <tr>
        <th>Title</th>
        <th>MimeType</th>
        <th>Actions</th>
      </tr>
    </thead>

    <tbody>
      <% @document_assets.each do |document_asset| %>
        <tr>
          <td><%= link_to(document_asset.title, document_asset.file.url) %></td>
          <td>
            <%= document_asset.file_data["metadata"]["mime_type"] %>
            <span class="sr-only"><%= document_asset.inspect %></span>
          </td>
          <td><%= link_to 'Destroy', admin_document_document_asset_path(document_asset.parent, document_asset), method: :delete, data: { confirm: 'Are you sure?' } %></td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <% if @pagy %>
  <h6>
    <span class='float-left mt-3'>
      <%== pagy_info(@pagy, 'imports'.pluralize(@pagy.count)) %>
    </span>
    <span class='float-right'>
      <%== pagy_bootstrap_nav(@pagy) %>
    </span>
  </h6>
  <% end %>
</div>

<br>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geoblacklight_admin-0.3.2 app/views/admin/document_assets/index.html.erb
geoblacklight_admin-0.3.1 app/views/admin/document_assets/index.html.erb
geoblacklight_admin-0.3.0 app/views/admin/document_assets/index.html.erb