Merge branch 'master' into hidden_comments
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<span class="js-flag-as-inappropiate-actions">
|
||||
<%= render 'comments/flag_as_inappropiate_actions', comment: comment %>
|
||||
<span class="js-flag-actions">
|
||||
<%= render 'comments/flag_actions', comment: comment %>
|
||||
</span>
|
||||
|
||||
<span class='js-moderation-actions'>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<% if can? :flag_as_inappropiate, comment %>
|
||||
<% if can? :flag, comment %>
|
||||
<span class="divider"> | </span>
|
||||
<a id="flag-expand-comment-<%= comment.id %>" data-dropdown="flag-drop-comment-<%= comment.id %>" aria-controls="flag-drop-comment-<%= comment.id %>" aria-expanded="false" title="<%= t('shared.flag_as_inappropiate') %>">
|
||||
<a id="flag-expand-comment-<%= comment.id %>" data-dropdown="flag-drop-comment-<%= comment.id %>" aria-controls="flag-drop-comment-<%= comment.id %>" aria-expanded="false" title="<%= t('shared.flag') %>">
|
||||
<i class="icon-flag flag-disable"></i>
|
||||
</a>
|
||||
<ul id="flag-drop-comment-<%= comment.id %>" class="f-dropdown" data-dropdown-content aria-hidden="true" tabindex="-1">
|
||||
<li>
|
||||
<%= link_to t("shared.flag_as_inappropiate"), flag_as_inappropiate_comment_path(comment), method: :put, remote: true, id: "flag-comment-#{comment.id}" %>
|
||||
<%= link_to t("shared.flag"), flag_comment_path(comment), method: :put, remote: true, id: "flag-comment-#{comment.id}" %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% if can? :undo_flag_as_inappropiate, comment %>
|
||||
<% if can? :unflag, comment %>
|
||||
<span class="divider"> | </span>
|
||||
<a id="unflag-expand-comment-<%= comment.id %>" data-dropdown="unflag-drop-comment-<%= comment.id %>" aria-controls="unflag-drop-comment-<%= comment.id %>" aria-expanded="false" title="<%= t('shared.undo_flag_as_inappropiate') %>">
|
||||
<a id="unflag-expand-comment-<%= comment.id %>" data-dropdown="unflag-drop-comment-<%= comment.id %>" aria-controls="unflag-drop-comment-<%= comment.id %>" aria-expanded="false" title="<%= t('shared.unflag') %>">
|
||||
<i class="icon-flag flag-active"></i>
|
||||
</a>
|
||||
<ul id="unflag-drop-comment-<%= comment.id %>" class="f-dropdown" data-dropdown-content aria-hidden="true" tabindex="-1">
|
||||
<li>
|
||||
<%= link_to t("shared.undo_flag_as_inappropiate"), undo_flag_as_inappropiate_comment_path(comment), method: :put, remote: true, id: "unflag-comment-#{comment.id}" %>
|
||||
<%= link_to t("shared.unflag"), unflag_comment_path(comment), method: :put, remote: true, id: "unflag-comment-#{comment.id}" %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
@@ -1,6 +1,7 @@
|
||||
<div id="js-comment-form-<%= dom_id(parent) %>" <%= "style='display:none'".html_safe if toggeable %>>
|
||||
<%= form_for [@debate, Comment.new], remote: true do |f| %>
|
||||
<%= f.text_area :body, label: t("comments.form.leave_comment") %>
|
||||
<%= label_tag "comment-body-#{dom_id(parent)}", t("comments.form.leave_comment") %>
|
||||
<%= f.text_area :body, id: "comment-body-#{dom_id(parent)}", label: false %>
|
||||
<%= f.hidden_field :commentable_type, value: parent.class %>
|
||||
<%= f.hidden_field :commentable_id, value: parent.id %>
|
||||
|
||||
@@ -8,14 +9,14 @@
|
||||
|
||||
<% if can? :comment_as_moderator, @debate %>
|
||||
<div class="right">
|
||||
<%= f.check_box :as_moderator, label: false %>
|
||||
<%= f.label :as_moderator, t("comments.form.comment_as_moderator"), class: "checkbox" %>
|
||||
<%= f.check_box :as_moderator, id: "comment-as-moderator-#{dom_id(parent)}", label: false %>
|
||||
<%= label_tag "comment-as-moderator-#{dom_id(parent)}", t("comments.form.comment_as_moderator"), class: "checkbox" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if can? :comment_as_administrator, @debate %>
|
||||
<div class="right">
|
||||
<%= f.check_box :as_administrator, label: false %>
|
||||
<%= f.label :as_administrator, t("comments.form.comment_as_admin"), class: "checkbox" %>
|
||||
<%= f.check_box :as_administrator, id: "comment-as-administrator-#{dom_id(parent)}",label: false %>
|
||||
<%= label_tag "comment-as-administrator-#{dom_id(parent)}", t("comments.form.comment_as_admin"), class: "checkbox" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
1
app/views/comments/_refresh_flag_actions.js.erb
Normal file
1
app/views/comments/_refresh_flag_actions.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#<%= dom_id(@comment) %> .js-flag-actions").html('<%= j render("comments/flag_actions", comment: @comment) %>');
|
||||
@@ -1 +0,0 @@
|
||||
$("#<%= dom_id(@comment) %> .js-flag-as-inappropiate-actions").html('<%= j render("comments/flag_as_inappropiate_actions", comment: @comment) %>');
|
||||
@@ -1,2 +1,2 @@
|
||||
var field_with_errors = "#js-comment-form-<%= dom_id(@parent) %> #comment_body";
|
||||
var field_with_errors = "#js-comment-form-<%= dom_id(@parent) %> #comment-body-<%= dom_id(@parent) %>";
|
||||
App.Comments.display_error(field_with_errors, "<%= j render('comments/errors') %>");
|
||||
|
||||
Reference in New Issue
Block a user