.row .col-xs-12.col-sm-12 = simple_nested_form_for @post || Post.new, validate: true, turboboost: true, html: {class: 'upload-attachments feeds-form', multipart: true} do |f| .col-xs-12.col-sm-4 = f.input :group_id, as: :select, prompt:'Select Group', label: false, collection: @groups .col-xs-12.col-sm-12 = f.input :body, placeholder: 'Share a link, ask a question, start a conversation...', label: false - if !@post.nil? and @post.persisted? .col-xs-12.col-sm-11.attachment-wrapper = f.fields_for :attachments do |a| - unless a.object.image? = link_to a.object.attachment_file_name, alt: a.object.attachment_file_name, title: a.object.attachment_file_name, target: :_blank .fa.fa-download.fs30 - else = link_to a.object.url, data: {toggle: :lightbox, gallery: "Feed-#{@post.feed.id}-gallery"}, 'data-gallery_parent_selector' => "#feed-#{@post.feed.id}-attachments" do = image_tag a.object.url(:thumb), alt: a.object.attachment_file_name, title: a.object.attachment_file_name = a.link_to_remove class: 'pull-right' do i.fa.fa-close .col-xs-12.col-sm-12 .col-xs-12.col-sm-12.fileupload-container class="#{'hide' unless @post}" .fileupload-buttonbar span.btn.btn-info.fileinput-button i.fa.fa-paperclip input.form-control name="attachments[]" type="file" button type='button' class='btn start' | Post .row table.table.table-striped tbody.files