Sha256: 263086f8bb481586ab1734fd2747a4c93345e4e3a98ea5f3ca41b1f69e546d0c

Contents?: true

Size: 1.23 KB

Versions: 19

Compression:

Stored size: 1.23 KB

Contents

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

.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
      = link_to attachment.asset.title, attachment.asset.url, :target => '_blank'

    - if attachment_actions.include?('remove')
      %a.attachment-remove{:href => '#'}
        %img{:src => asset_path('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

19 entries across 19 versions & 1 rubygems

Version Path
effective_assets-1.4.6 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.4.5 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.4.4 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.4.3 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.4.2 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.4.1 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.4.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.3.2 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.3.1 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.3.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.2.5 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.2.4 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.2.3 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.2.2 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.2.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.1.2 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.1.1 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.1.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml
effective_assets-1.0.0 app/views/asset_box_input/_attachment_as_thumbnail.html.haml