Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0b1311f8b3
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 85 lines (68 sloc) 3.676 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
.yui-b.sidebar
  = render :partial => 'shared/admin_nav'

  -box do
    - form_for @search, :html => {:class => "MainForm"} do |f|
    
      = f.label :commentable_type.l
      = f.text_field :commentable_type_like

      =f.label :commentable_id.l
      =f.text_field :commentable_id

      =f.label :name.l
      =f.text_field :author_name_or_user_login_like

      =f.label :email.l
      =f.text_field :author_email_like

      =f.label :comment_web_site_label.l
      =f.text_field :author_url_like

      =f.label :body_text.l
      =f.text_field :comment_like

      %p= f.submit :search.l


- form_tag delete_selected_comments_path, :id => 'comments' do
  #yui-main
    -box :class => "yui-b" do
      %h3
        = AppConfig.community_name
        = :comments.l

      -if @comments.page_count > 1
        .pagination= paginating_links @comments, :link_to_current_page => true

      %table{"cellspacing"=>"0", "border"=>"0", "cellpadding"=>"0", "width"=>"100%", :style => "table-layout:fixed;"}
        %thead
          %tr
            %th{:width => '60px', :colspan => '3'}
            %th=:author.l
            %th{:width => "250px"}=:body_text.l
            %th=:on_commentable.l

        %tbody
          - @comments.each do |comment|
            %tr{:id => "comment_#{comment.id}"}
              %td
                =link_to_remote(image_tag('icons/delete.png', :plugin => 'community_engine'), {:url => comment_path(comment.commentable_type, comment.commentable_id, comment), :method => :delete, 500 => 'alert(\'Sorry, there was a server error\'); return false', :success => visual_effect(:fade, "comment_#{comment.id}"), :confirm => "Are you sure you want to permanently delete this comment"} )
              %td
                =link_to_remote(image_tag('icons/bad-flag.png', :plugin => 'community_engine'), {:url => comment_path(comment.commentable_type, comment.commentable_id, comment), :method => :delete, 500 => 'alert(\'Sorry, there was a server error\'); return false', :success => visual_effect(:fade, "comment_#{comment.id}"), :confirm => "Are you sure you want to permanently delete this comment and mark it as spam!?"} )
              
              %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
              %td
                =link_to comment.commentable_name, commentable_url(comment)
        %tfoot
          %tr
            %td{ :colspan => "4" }
              -if @comments.any?
                %a{:href=>"#", :onclick=>"checkboxes.each(function(e){ e.checked = (e.checked == 0 ? 1 : 0) }); return false;"} Toggle all
                %p= submit_tag :delete_selected.l
                %p= submit_tag :delete_selected_mark_as_spam.l


      -if @comments.page_count > 1
        .pagination= paginating_links @comments, :link_to_current_page => true

%script{:type => 'text/javascript'}
  var form = $('comments');
  checkboxes = form.getInputs('checkbox');
Something went wrong with that request. Please try again.