Sha256: 1ab7f5d29f69ec355b2cb093729da7523f1d09edb216b6d29bf170a2b4582bc0

Contents?: true

Size: 982 Bytes

Versions: 2

Compression:

Stored size: 982 Bytes

Contents

= photo_collection_form.fields_for :page_partable, photo_collection_form.object.page_partable do |form|
  = link_to spina.photo_collection_select_admin_photos_path(form.object_name, selected_photo_ids: (form.object.photo_ids if form.object.photos.any?)), remote: true, class: "media_picker" do
    .placeholder{class: ('pull-right' if form.object.photos.any?)}
      %span.button.button-small.button-round{data: {icon: 'U'}}=t 'spina.pages.photos_picker'

  .photo-collection
    - if form.object.photos.sorted_by_photo_collection.any?
      = render 'spina/admin/photos/photo_collection', photos: form.object.photos.sorted_by_photo_collection
    - elsif form.object.photos.any?
      = render 'spina/admin/photos/photo_collection', photos: form.object.photos
  = form.hidden_field :photo_tokens, value: form.object.photo_ids.join(",")
  = form.hidden_field :photo_positions, value: form.object.photos.sorted_by_photo_collection.pluck(:photo_id).join(","), class: 'photo-positions'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spina-0.6.14 app/views/spina/admin/page_partables/_photo_collection_form.html.haml
spina-0.6.13 app/views/spina/admin/page_partables/_photo_collection_form.html.haml