.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| - if current_user.can_broadcast? .col-sm-3 = check_box_tag :broadcast, '0', f.object.broadcast_to.blank? ? false : true, class:'check1' label.string.optional.control-label.switch for=("broadcast") Broadcast .col-xs-12.col-sm-12 .group-selector class="#{'hide' unless f.object.broadcast_to.blank?}" = f.input :group_id, as: :select, prompt:'Select Group', label: false, collection: @groups .broadcast-related-fields class="#{'hide' if f.object.broadcast_to.blank?}" .col-sm-12.fs8 .col-sm-4 label span.regular.block.pull-left All Syrch Users = f.radio_button :broadcast_to, 'all_users', checked: "checked", :item_wrapper_class => 'plr10' .col-sm-4 label span.regular.block.pull-left Groups = f.radio_button :broadcast_to, 'group' .col-sm-12 .col-xs-12.col-sm-12.custom_group.hide = f.input :group_id, label: false, validate: true, input_html: {value: '', class: 'select2-field', placeholder: 'Search by name to add group to this feed.', autocomplete: :off, data: {url: groups_path(automated: true), multiple: false, always_open: false}} .col-xs-12.col-sm-4 - else .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