-@page_title = 'Comments' = render :partial => 'shared/admin_nav' = bootstrap_form_for @search, :url => admin_comments_path, :layout => :horizontal do |f| %h2=:search.l = f.text_field :author_email_or_user_email_cont, :label => :email.l = f.form_group :submit_group do = f.primary :search.l = bootstrap_form_tag :url => delete_selected_comments_path, :method => :delete, :id => 'comments' do %table.table.table-bordered.table-striped %tr %th=:delete.l %th=:author.l %th{:width => "50%"}=:body_text.l %th=:on_commentable.l %th=:actions.l - @comments.each do |comment| %tr{:id => "comment-#{comment.id}"} %td= check_box_tag "delete[]", comment.id %td .left -if comment.user = link_to h(comment.user.login), user_path(comment.user) %br %small= comment.user.email -else = link_to_unless(comment.author_url.blank?, h(comment.username), h(comment.author_url)){ h(comment.username) } %br %small=comment.author_email %br %small="(#{comment.author_url})" %td{:style => 'overflow:hidden;'} = comment.comment.html_safe %td -if comment.commentable_name.blank? =link_to comment.commentable_type, commentable_url(comment) -else =link_to comment.commentable_name, commentable_url(comment) %td =link_to :delete.l, commentable_comment_path(comment.commentable_type, comment.commentable_id, comment), :method => :delete, 'data-manual-confirm' => "Are you sure you want to permanently delete this comment", :class => 'btn btn-danger delete-via-ajax', 'data-target' => "comment_#{comment.id}" -if @comments.any? %p %a.btn.btn-default{:href=>"#", :onclick=>"checkboxes.each(function(e){ e.checked = (e.checked == 0 ? 1 : 0) }); return false;"} Toggle all = submit_tag :delete_selected.l, :class => 'btn btn-danger' = paginate @comments, :theme => 'bootstrap' -content_for :end_javascript do :javascript var form = $('comments'); checkboxes = form.getInputs('checkbox');