Sha256: 69437d8b2b4eb7d3670ec1f662e129b7f2d6c71523d36c102a3ad4351f84c993

Contents?: true

Size: 1.51 KB

Versions: 41

Compression:

Stored size: 1.51 KB

Contents

<div class="relative min-h-full max-w-full flex-1 flex flex-col justify-between space-y-3">
  <% if @file.present? %>
    <% if @file.representable? && @is_image %>
      <%= image_tag helpers.main_app.url_for(@file), class: 'rounded-lg max-h-168 max-w-full' %>
    <% else %>
      <div class="relative flex flex-col justify-evenly items-center px-2 rounded-lg border bg-white border-gray-500 py-6 flex-1">
        <div class="flex flex-col justify-center items-center w-full">
          <%= helpers.svg 'document-text', class: 'h-10 text-gray-800 mb-2' %>
          <div class="block w-full truncate text-center text-sm">
            <%= @file.filename %>
          </div>
        </div>
      </div>
    <% end %>

    <div class="flex justify-between lg:flex-col lg:space-y-2 2xl:flex-row 2xl:space-y-0">
      <%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: 'text-center', size: :xs do %>
        <%= helpers.svg 'download' %> <span class="hidden lg:block lg:flex-1"><%= t('avo.download_file') %></span>
      <% end %>
      <%= a_link "/avo/resources/#{@resource.model.model_name.route_key}/#{@resource.model.id
      }/active_storage_attachments/#{@id}/#{@file.id}", color: :red, variant: :outlined, size: :xs, class: 'text-center', 'data-turbo-frame': 'destroy_attachment_form', data: { confirm: t('avo.are_you_sure')} do %>
        <%= helpers.svg 'trash' %> <span class="hidden lg:block lg:flex-1"><%= t 'avo.delete_file', item: @file.filename %></span>
      <% end %>
    </div>
  <% end %>
</div>

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
avo-1.5.4 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.5.3 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.5.2 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.5.1 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.5.0 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.5.pre.1 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.4.pre.1 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.4 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.3 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.2 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.1 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.0 app/components/avo/fields/common/multiple_file_viewer_component.html.erb
avo-1.4.0.pre.1 app/components/avo/common/multiple_file_viewer_component.html.erb
avo-1.3.5 app/components/avo/common/multiple_file_viewer_component.html.erb
avo-1.3.5.pre.1 app/components/avo/common/multiple_file_viewer_component.html.erb
avo-1.3.4 app/components/avo/common/multiple_file_viewer_component.html.erb
avo-1.3.3 app/components/avo/common/multiple_file_viewer_component.html.erb
avo-1.3.2 app/components/avo/common/multiple_file_viewer_component.html.erb
avo-1.3.1 app/components/avo/common/multiple_file_viewer_component.html.erb
avo-1.3.0 app/components/avo/common/multiple_file_viewer_component.html.erb