Sha256: a4e28939ca22e1b3eed11a0a67af2f6b7aa86184091cdac34430f4ff5ffabde5

Contents?: true

Size: 1.36 KB

Versions: 32

Compression:

Stored size: 1.36 KB

Contents

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

.col-sm-3.attachment
  .thumbnail{:style => "#{(attachment.marked_for_destruction? || hidden) ? 'display: none;' : ''}", :title => effective_asset_title(attachment.asset)}
    = effective_asset_image_tag(attachment.asset)

    .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

32 entries across 32 versions & 1 rubygems

Version Path
effective_assets-1.12.2 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.12.1 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.12.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.11.5 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.11.4 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.11.3 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.11.2 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.11.1 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.11.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.10.1 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.10.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.14 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.13 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.12 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.11 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.10 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.9 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.8 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.7 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.9.6 app/views/asset_box_input/_attachment_as_thumbnail.html.haml