diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 0698ee129..650621624 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1645,7 +1645,6 @@ table { font-family: $font-sans; font-size: $small-font-size; line-height: $line-height; - margin: rem-calc(10) $line-height/2 $line-height/4 0; a { color: $text-light; @@ -1666,15 +1665,12 @@ table { .comment-body { margin-left: rem-calc(42); - p { - font-size: $small-font-size; - } - .reply { background: white; border: 1px solid $border; - font-family: $font-sans; - font-size: rem-calc(12); + border-left: 0; + border-right: 0; + font-size: $small-font-size; margin: rem-calc(6) 0; padding: rem-calc(6); diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index b728ba729..df928aa02 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,5 +1,5 @@ class CommentsController < ApplicationController - before_action :authenticate_user! + before_action :authenticate_user!, only: :create before_action :load_commentable, only: :create before_action :build_comment, only: :create @@ -15,6 +15,11 @@ class CommentsController < ApplicationController end end + def show + @comment = Comment.find(params[:id]) + set_comment_flags(@comment.subtree) + end + def vote @comment.vote_by(voter: current_user, vote: params[:value]) respond_with @comment diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 9ac29e4da..9d9d08075 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -13,8 +13,11 @@ module CommentsHelper end def child_comments_of(parent) - return [] unless @comment_tree - @comment_tree.children_of(parent) + if @comment_tree.present? + @comment_tree.ordered_children_of(parent) + else + parent.children + end end def user_level_class(comment) diff --git a/app/models/abilities/everyone.rb b/app/models/abilities/everyone.rb index d6b2a6d57..122d5db2a 100644 --- a/app/models/abilities/everyone.rb +++ b/app/models/abilities/everyone.rb @@ -5,6 +5,7 @@ module Abilities def initialize(user) can :read, Debate can :read, Proposal + can :read, Comment can :read, Legislation can :read, User can [:search, :read], Annotation diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 00d62ed5f..c001da74e 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -1,9 +1,9 @@ -<% cache [locale_and_user_status(comment), comment, commentable_cache_key(@commentable), comment.author, (@comment_flags[comment.id] if @comment_flags)] do %> +<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (@comment_flags[comment.id] if @comment_flags)] do %>
<%= t("comments.comment.deleted") %>