Sha256: 6a0c3193a0b576628876011a2f5f47e8af49122bfe8cc607e645cc029129229b

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

- uid = (attachment.persisted? ? attachment.id : Time.now.to_f.to_s.split('.')[1] + Random.rand(10000).to_s)
- hidden ||= false

%li.attachment
  .attachment-title.caption
    - if attachment_links
      = link_to attachment.asset.title, attachment.asset.url, :target => '_blank'
    - else
      = attachment.asset.title

  - if attachment_actions.include?('remove')
    %a.attachment-remove{:href => '#'}
      = image_tag('effective_assets/icon_close.png', alt: 'Remove')

  - if attachment.persisted?
    = hidden_field_tag("#{attachable_object_name}[attachments_attributes][#{uid}][id]", attachment.id)
  = hidden_field_tag("#{attachable_object_name}[attachments_attributes][#{uid}][asset_id]", attachment.asset_id)
  = hidden_field_tag("#{attachable_object_name}[attachments_attributes][#{uid}][box]", attachment.box)
  = hidden_field_tag("#{attachable_object_name}[attachments_attributes][#{uid}][_destroy]", attachment.marked_for_destruction? ? 1 : nil, :class => 'asset-box-remove')
  = hidden_field_tag("#{attachable_object_name}[attachments_attributes][#{uid}][position]", 1)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
effective_assets-1.6.2 app/views/asset_box_input/_attachment_as_list.html.haml
effective_assets-1.6.1 app/views/asset_box_input/_attachment_as_list.html.haml
effective_assets-1.6.0 app/views/asset_box_input/_attachment_as_list.html.haml
effective_assets-1.5.9 app/views/asset_box_input/_attachment_as_list.html.haml