Sha256: 70228f68b3b425fea7834c05b80ba03615b119a1ff2eb3d7c37fed71059de171

Contents?: true

Size: 774 Bytes

Versions: 5

Compression:

Stored size: 774 Bytes

Contents

= node f, field do
  - file = f.object.send(field.name)
  - if file.present? && file.attachment.present?
    - file_blob_url = main_app.route_for(:rails_service_blob, file.blob.signed_id, file.blob.filename)
    - if file.blob.image?
      = link_to image_tag(main_app.route_for(:rails_representation, file.variant(resize: "200>")), class: 'uploaded_image'), file_blob_url
    - else
      = link_to file.blob.filename.to_s, file_blob_url, class: 'uploaded_file'

    - if f.object.respond_to?(:"#{field.name}_destroy")
      .file_delete
        = f.check_box "#{field.name}_destroy"
        = f.label "#{field.name}_destroy", t('bhf.helpers.file.delete')

  = f.file_field field.name, direct_upload: true, data: {:'direct-upload-url' => main_app.rails_direct_uploads_url}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bhf-1.0.0.beta10 app/views/bhf/form/column/_activestorage_attachment.html.haml
bhf-1.0.0.beta9 app/views/bhf/form/column/_activestorage_attachment.html.haml
bhf-1.0.0.beta8 app/views/bhf/form/column/_activestorage_attachment.html.haml
bhf-1.0.0.beta7 app/views/bhf/form/column/_activestorage_attachment.html.haml
bhf-1.0.0.beta6 app/views/bhf/form/column/_activestorage_attachment.html.haml