File tree 3 files changed +11
-9
lines changed
3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ class Comment < ActiveRecord::Base
34
34
35
35
belongs_to :user , autosave : true
36
36
37
+ scope :showable , -> { with_states ( :active , :reported_as_spam ) }
38
+
37
39
alias_method :author , :user
38
40
alias_attribute :body , :comment
39
41
Original file line number Diff line number Diff line change 104
104
%div .tip-content {itemprop: :articleBody}
105
105
= raw sanitize(protip.to_html)
106
106
107
- - if include_comments
108
- %section .comments { class:('no-comments' if protip.comments.empty? ) }
109
- - if protip.comments.any?
110
- %h2.comments-header
111
- %i.fa.fa-comments
112
- Comments
113
- %ul.comment-list
114
- = render protip.comments.with_states(:active,:reported_as_spam)
115
- = render 'comments/add_comment'
107
+ = render('protip_comments', comments: protip.comments.showable) if include_comments
116
108
117
109
- if defined?(:job) && !job.nil?
118
110
.mobile-job
Original file line number Diff line number Diff line change
1
+ section .comments class =(' no-comments' if comments.empty? )
2
+ - if comments.any?
3
+ h2 .comments-header
4
+ i .fa .fa-comments
5
+ | Comments
6
+ ul .comment-list
7
+ = render comments
8
+ = render 'comments/add_comment'
You can’t perform that action at this time.
0 commit comments