Disallow valuation comment creation on finished budget

This commit is contained in:
Bertocq
2018-01-31 16:36:06 +01:00
parent b926740a32
commit 9cb4b03276
4 changed files with 21 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
<% commentable = comment_tree.commentable %>
<% valuation = local_assigns.fetch(:valuation, false) %>
<% allow_comments = local_assigns.fetch(:allow_comments, true) %>
<% 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">
@@ -24,7 +25,7 @@
<div data-alert class="callout primary">
<%= t("comments.verified_only", verify_account: link_to(t("comments.verify_account"), verification_path )).html_safe %>
</div>
<% else %>
<% elsif allow_comments %>
<%= render 'comments/form', { commentable: commentable,
parent_id: nil,
toggeable: false,
@@ -44,7 +45,8 @@
comment_flags: comment_flags,
valuation: valuation,
allow_votes: !valuation,
allow_flagging: !valuation } %>
allow_flagging: !valuation,
allow_comments: allow_comments } %>
<% end %>
<%= paginate comment_tree.root_comments %>
</div>