.horizontal-form-label = f.object.title .horizontal-form-content = f.fields_for :page_partable, f.object.page_partable do |ff| = link_to spina.photo_collection_select_admin_photos_path(ff.object_name, selected_photo_ids: (ff.object.photo_ids if ff.object.photos.any?)), remote: true, class: "media_picker" do .placeholder{class: ('pull-right' if ff.object.photos.any?)} %span.button.button-small.button-round %i.icon.icon-dots =t 'spina.pages.photos_picker' .photo-collection - if ff.object.photos.sorted_by_photo_collection.any? = render 'spina/admin/photos/photo_collection', photos: ff.object.photos.sorted_by_photo_collection - elsif ff.object.photos.any? = render 'spina/admin/photos/photo_collection', photos: ff.object.photos = ff.hidden_field :photo_tokens, value: ff.object.photo_ids.join(",") = ff.hidden_field :photo_positions, value: ff.object.photos.sorted_by_photo_collection.pluck(:photo_id).join(","), class: 'photo-positions'