Class: Decidim::Posts::CommentsCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::Posts::CommentsCell
- Includes:
- IconHelper
- Defined in:
- app/cells/decidim/posts/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
- #comments_loading ⇒ 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/posts/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
31 32 33 34 35 36 |
# File 'app/cells/decidim/posts/comments_cell.rb', line 31 def blocked_comments_warning return unless comments_blocked? return unless user_comments_blocked? render :blocked_comments_warning end |
#comments_loading ⇒ Object
25 26 27 28 29 |
# File 'app/cells/decidim/posts/comments_cell.rb', line 25 def comments_loading return if single_comment? render :comments_loading end |
#single_comment_warning ⇒ Object
19 20 21 22 23 |
# File 'app/cells/decidim/posts/comments_cell.rb', line 19 def single_comment_warning return unless single_comment? render :single_comment_warning end |
#user_comments_blocked_warning ⇒ Object
38 39 40 41 42 43 |
# File 'app/cells/decidim/posts/comments_cell.rb', line 38 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 |