Add 'post as moderator' option for comments.
* Add 'post as moderator' option to comment form. This creates a so-called sticky comment. * Downvotes have no effect on stickied comments; they're always visible, regardless of comment thresholds. * Only mods may sticky comments. * Mods may sticky comments by other users.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<% if CurrentUser.is_member? %>
|
||||
<div class="new-comment">
|
||||
<p><%= link_to "Post comment", new_comment_path, :class => "expand-comment-response" %></p>
|
||||
<%= render "comments/partials/new/form", :post => post %>
|
||||
<%= render "comments/form", :post => post, :comment => post.comments.new %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<div class="comment-preview dtext dtext-preview">
|
||||
</div>
|
||||
|
||||
<%= form_tag(comments_path, :class => "simple_form comment-form") do %>
|
||||
<%= hidden_field "comment", "post_id", :value => post.id %>
|
||||
<%= dtext_field "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
|
||||
<%= submit_tag "Post", :data => { :disable_with => "Submitting..." } %>
|
||||
<%= dtext_preview_button "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
|
||||
<%= check_box "comment", "do_not_bump_post", :id => "comment_do_not_bump_post_#{post.id}" %> <label for="comment_do_not_bump_post_<%= post.id %>">No bump</label>
|
||||
<% end %>
|
||||
@@ -1,6 +1,6 @@
|
||||
<% if CurrentUser.is_moderator? || !comment.is_deleted? %>
|
||||
<a name="comment-<%= comment.id %>"></a>
|
||||
<article class="comment" data-post-id="<%= comment.post_id %>" data-comment-id="<%= comment.id %>" data-score="<%= comment.score %>" data-creator="<%= comment.creator.name %>">
|
||||
<article class="comment" data-post-id="<%= comment.post_id %>" data-comment-id="<%= comment.id %>" data-score="<%= comment.score %>" data-creator="<%= comment.creator.name %>" data-is-sticky="<%= comment.is_sticky %>">
|
||||
<div class="author">
|
||||
<h1>
|
||||
<%= link_to_user comment.creator %>
|
||||
@@ -39,7 +39,7 @@
|
||||
<% end %>
|
||||
</menu>
|
||||
<% if comment.editable_by?(CurrentUser.user) %>
|
||||
<%= render "comments/form", :comment => comment %>
|
||||
<%= render "comments/form", :post => comment.post, :comment => comment %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user