journalduhacker/app/views/comments/_commentbox.html.erb
2012-08-24 11:41:35 -05:00

46 lines
1.3 KiB
Plaintext

<div class="comment_form_container">
<%= form_tag((comment.new_record? ? "/comments/post_to/#{story.short_id}" :
"/comments/#{comment.short_id}/update"), { :id => "comment_form" }) do |f| %>
<% if comment.parent_comment_short_id.present? %>
<%= hidden_field_tag "parent_comment_short_id",
comment.parent_comment_short_id %>
<% end %>
<div style="width: 100%;">
<%= text_area_tag "comment", comment.comment, :rows => 5,
:style => "width: 100%;", :autocomplete => "off" %>
<p></p>
<div class="markdown_help_toggler">
<div class="markdown_help_label">
<span class="fakea">Markdown formatting available</span>
</div>
<%= button_tag "#{comment.new_record?? "Post" : "Update"} Comment",
:class => "comment-post", :type => "button" %>
&nbsp;
<%= button_tag "Preview Comment", :class => "comment-preview",
:type => "button" %>
<div style="clear: both;"></div>
<%= render :partial => "global/markdownhelp" %>
</div>
</div>
<p></p>
<% if defined?(show_comment) %>
<% if show_comment.valid? %>
<ol class="comments comments1 preview">
<%= render :partial => "comments/comment",
:locals => { :comment => show_comment, :story => story } %>
</ol>
<% else %>
<%= errors_for comment %>
<% end %>
<% end %>
<% end %>
</div>