adds comments labels per comment

fixes #265
This commit is contained in:
Juanjo Bazán
2015-08-28 14:15:56 +02:00
committed by Juanjo Bazán
parent 4244ff4b04
commit fc8687a707
4 changed files with 19 additions and 18 deletions

View File

@@ -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 %>