app/cells/decidim/comments/comment_cell.rb in decidim-comments-0.28.1 vs app/cells/decidim/comments/comment_cell.rb in decidim-comments-0.28.2
- old
+ new
@@ -37,9 +37,27 @@
super && has_replies_in_children? == false && current_user.blank?
end
private
+ def parent_element_id
+ return unless reply?
+
+ "comment_#{model.decidim_commentable_id}"
+ end
+
+ def comment_label
+ if reply?
+ t("decidim.components.comment.comment_label_reply", comment_id: model.id, parent_comment_id: model.decidim_commentable_id)
+ else
+ t("decidim.components.comment.comment_label", comment_id: model.id)
+ end
+ end
+
+ def reply?
+ model.decidim_commentable_type == model.class.name
+ end
+
def cache_hash
return @hash if defined?(@hash)
hash = []
hash.push(I18n.locale)