Sha256: 9da060d95c69b9012268c6cad46f6bc23684c09c1ae0f0cbdf1602dd31c3ccc3

Contents?: true

Size: 1.32 KB

Versions: 4

Compression:

Stored size: 1.32 KB

Contents

ruby:
  require_locals ['f'], local_assigns
  item        ||= f.object
  file_name   ||= :file
  the_file      = item.send(file_name)
  label       ||= file_name.to_s.humanize
  helper_text ||= ""
  required    ||= false

= f.simple_fields_for file_name do |i|
  .input.field
    = content_tag :label, class: ('required' if required) do
      - if required
        abbr title="required" *
      = label.html_safe
      - if helper_text.present?
        h6.helper_text = helper_text

    - if the_file.asset.present?
      .asset-actions.asset-actions--files
        = link_to 'Replace File', fae.delete_file_path(the_file.id), class: 'file_input-button js-asset-delete-link', remote: true, method: :delete, data: { confirm: t('fae.delete_confirmation') }

        = link_to '', fae.delete_file_path(the_file.id), class: 'icon-delete_x file_input-delete js-asset-delete-link', remote: true, method: :delete, data: { confirm: t('fae.delete_confirmation') }

        a href=the_file.asset.url target="_blank" = the_file.asset.file.filename

    .asset-inputs style="#{'display: none;' unless the_file.asset.blank?}"
      = i.input :asset, as: :file, label: false, input_html: { data: { limit: Fae.max_file_upload_size, exceeded: t('fae.exceeded_upload_limit') } }
      = i.input :asset_cache, as: :hidden
      = i.hidden_field :required, value: required

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fae-rails-1.2.5 app/views/fae/application/_file_uploader.html.slim
fae-rails-1.2.4 app/views/fae/application/_file_uploader.html.slim
fae-rails-1.2.3 app/views/fae/application/_file_uploader.html.slim
fae-rails-1.2.2 app/views/fae/application/_file_uploader.html.slim