.media-picker-grid#media_picker_grid - if @media_folder.present? = link_to spina.admin_media_picker_path, class: 'media-folder', data: {action: "media-picker#openFolder"} do .media-folder-thumbnail .media-folder-placeholder %i.icon.icon-picture-o .media-folder-shadow .media-folder-name=t "spina.images.all_images" - else = form_with model: Spina::Image.new, url: admin_images_path, local: false, data: {action: "ajax:success->media-picker#refresh ajax:before->media-picker#startUpload", media_picker_url: spina.admin_media_picker_path} do |f| .media-picker-uploader = f.file_field :files, multiple: true, accept: "image/*", data: {direct_upload_url: main_app.rails_direct_uploads_url} = f.submit - @media_folders.each do |media_folder| = link_to spina.admin_media_picker_path(media_folder_id: media_folder.id), class: 'media-folder', data: {action: "media-picker#openFolder"} do .media-folder-thumbnail{data: {badge: media_folder.images.size}} = image_tag main_app.url_for(media_folder.images.last.variant(resize: '144x144^', crop: "144x144+0+0")) .media-folder-shadow .media-folder-name= media_folder.name = render partial: 'image', collection: @images .media-picker-pagination = link_to_next_page @images, "Next", data: {remote: true, target: "infinite-scroll.link"}