Sha256: 966f1a4c5a11812f3ab66eb1553e0b4fb68905935bbe62b462b52bab2d98ebff

Contents?: true

Size: 980 Bytes

Versions: 14

Compression:

Stored size: 980 Bytes

Contents

.fragment-attachments
  - attachments.each do |attachment|
    :ruby
      thumb_url = if attachment.variable?
        url_for(attachment.variant(combine_options: Occams::Cms::File::VARIANT_SIZE[:thumb]))
      end
      filename = attachment.filename.to_s
      truncated_filename = truncate(filename, length: 40, omission: "...#{filename.last(10)}")

      link_data = {
        cms_file_thumb_url: thumb_url,
        cms_file_link_tag: cms_page_file_link_tag(
          fragment_id:  fragment_id,
          attachment:   attachment,
          multiple:     multiple
        )
      }

    .fragment-attachment.btn-group.btn-group-sm.mb-1
      = link_to truncated_filename, attachment, data: link_data, class: "btn btn-light text-truncate", target: "_blank"
      = check_box_tag "#{object_name}[fragments_attributes][#{index}][file_ids_destroy][]", attachment.id, false, id: dom_id(attachment)
      %label.btn.btn-light{for: dom_id(attachment)}
        %i.fas.fa-fw.fa-times

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
occams-1.1.0 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.8 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.7.3 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.7.2 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.7.1 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.7 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.6.1 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.6 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.5 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.4 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.3 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.2 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.1 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml
occams-1.0.0 app/views/occams/admin/cms/fragments/_form_fragment_attachments.html.haml