Class: Decidim::Comments::CommentsCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Comments::CommentsCell
- Includes:
- IconHelper
- Defined in:
- app/cells/decidim/comments/comments_cell.rb
Overview
A cell to display a comments section for a commentable object.
Instance Method Summary collapse
- #add_comment ⇒ Object
- #blocked_comments_warning ⇒ Object
- #single_comment_warning ⇒ Object
- #user_comments_blocked_warning ⇒ Object
Instance Method Details
#add_comment ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/cells/decidim/comments/comments_cell.rb', line 11 def add_comment return if single_comment? return if comments_blocked? return if user_comments_blocked? render :add_comment end |
#blocked_comments_warning ⇒ Object
25 26 27 28 29 30 |
# File 'app/cells/decidim/comments/comments_cell.rb', line 25 def blocked_comments_warning return unless comments_blocked? return unless user_comments_blocked? render :blocked_comments_warning end |
#single_comment_warning ⇒ Object
19 20 21 22 23 |
# File 'app/cells/decidim/comments/comments_cell.rb', line 19 def single_comment_warning return unless single_comment? render :single_comment_warning end |
#user_comments_blocked_warning ⇒ Object
32 33 34 35 36 37 |
# File 'app/cells/decidim/comments/comments_cell.rb', line 32 def user_comments_blocked_warning return if comments_blocked? # Shows already the general warning return unless user_comments_blocked? render :user_comments_blocked_warning end |