Skip to content

Commit

Permalink
Hide comment voting at valuation comment threads
Browse files Browse the repository at this point in the history
  • Loading branch information
bertocq committed Jan 30, 2018
1 parent c87351d commit 9c81979
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions app/views/comments/_comment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
</div>

<div id="<%= dom_id(comment) %>_reply" class="reply">
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
<%= render 'comments/votes', comment: comment %>
</div>
<% if local_assigns.fetch(:allow_votes, true) %>
<div id="<%= dom_id(comment) %>_votes" class="comment-votes float-right">
<%= render 'comments/votes', comment: comment %>
</div>
<% end %>
<% if comment.children.size > 0 %>
<%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
Expand Down
8 changes: 5 additions & 3 deletions app/views/comments/_comment_tree.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% commentable = comment_tree.commentable %>
<% valuation = local_assigns.fetch(:valuation, false) %>
<% cache [locale_and_user_status, comment_tree.order, commentable_cache_key(commentable), comment_tree.comments, comment_tree.comment_authors, commentable.comments_count, comment_flags] do %>
<section class="expanded comments">
<div class="row">
Expand Down Expand Up @@ -28,7 +28,7 @@
<%= render 'comments/form', { commentable: commentable,
parent_id: nil,
toggeable: false,
valuation: local_assigns.fetch(:valuation, false) } %>
valuation: valuation } %>
<% end %>
<% else %>
<br>
Expand All @@ -40,7 +40,9 @@
<% end %>
<% comment_tree.root_comments.each do |comment| %>
<%= render 'comments/comment', {comment: comment, comment_flags: comment_flags} %>
<%= render 'comments/comment', { comment: comment,
comment_flags: comment_flags,
allow_votes: !valuation } %>
<% end %>
<%= paginate comment_tree.root_comments %>
</div>
Expand Down

0 comments on commit 9c81979

Please sign in to comment.