Files
nairobi/app/views/comments/_form.html.erb
2015-09-02 17:22:21 +02:00

25 lines
1.3 KiB
Plaintext

<div id="js-comment-form-<%= dom_id(commentable) %>" <%= "style='display:none'".html_safe if toggeable %>>
<%= form_for [commentable, Comment.new], remote: true do |f| %>
<%= label_tag "comment-body-#{dom_id(commentable)}", t("comments.form.leave_comment") %>
<%= f.text_area :body, id: "comment-body-#{dom_id(commentable)}", label: false %>
<%= f.hidden_field :commentable_type, value: commentable.class %>
<%= f.hidden_field :commentable_id, value: commentable.id %>
<%= f.hidden_field :parent_id, value: parent_id %>
<%= f.submit comment_button_text(parent_id), class: "button radius small inline-block" %>
<% if can? :comment_as_moderator, commentable %>º
<div class="right">
<%= f.check_box :as_moderator, id: "comment-as-moderator-#{dom_id(commentable)}", label: false %>
<%= label_tag "comment-as-moderator-#{dom_id(commentable)}", t("comments.form.comment_as_moderator"), class: "checkbox" %>
</div>
<% end %>
<% if can? :comment_as_administrator, commentable %>
<div class="right">
<%= f.check_box :as_administrator, id: "comment-as-administrator-#{dom_id(commentable)}",label: false %>
<%= label_tag "comment-as-administrator-#{dom_id(commentable)}", t("comments.form.comment_as_admin"), class: "checkbox" %>
</div>
<% end %>
<% end %>
</div>