71 lines
2.1 KiB
Plaintext
71 lines
2.1 KiB
Plaintext
<div class="comment comment_form_container"
|
|
data-shortid="<%= comment.short_id if comment.persisted? %>">
|
|
<%= form_with url: comment, :id => "edit_comment_#{comment.short_id}" do |f| %>
|
|
<% if comment.errors.any? %>
|
|
<%= errors_for comment %>
|
|
<% end %>
|
|
|
|
<%= f.hidden_field "story_id", :value => comment.story.short_id %>
|
|
|
|
<% if comment.parent_comment %>
|
|
<%= f.hidden_field "parent_comment_short_id",
|
|
comment.parent_comment.short_id %>
|
|
<% end %>
|
|
|
|
<div style="width: 100%;">
|
|
<%= f.text_area "comment", :body => comment.comment, :rows => 5,
|
|
:disabled => !@user,
|
|
:placeholder => (@user ? "" : "You must be logged in to leave a comment.")
|
|
%>
|
|
|
|
<p></p>
|
|
|
|
<div class="markdown_help_toggler">
|
|
<% if @user %>
|
|
<div class="markdown_help_label">
|
|
Markdown formatting available
|
|
</div>
|
|
<div class="markdown_help_label markdown_help_label_mobile"
|
|
style="display: none;">
|
|
[M↓]
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= f.submit "#{comment.new_record?? "Post" : "Update"}",
|
|
:class => "comment-post", :disabled => !@user %>
|
|
|
|
<%= f.button "Preview", :class => "comment-preview",
|
|
:type => "button", :disabled => !@user %>
|
|
<% if comment.persisted? || comment.parent_comment_id %>
|
|
|
|
<%= f.button "Cancel", :class => "comment-cancel",
|
|
:type => "button" %>
|
|
<% end %>
|
|
|
|
<% if @user && @user.wearable_hats.any? %>
|
|
<div style="display: inline-block; margin-left: 1em;">
|
|
Put on hat:
|
|
<%= f.select "hat_id",
|
|
options_from_collection_for_select(@user.wearable_hats, "id", "hat",
|
|
comment.hat_id), :include_blank => true %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
<% if @user %>
|
|
<%= render :partial => "global/markdownhelp" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<p></p>
|
|
<% end %>
|
|
<% if defined?(show_comment) && show_comment.valid? %>
|
|
<div class="preview">
|
|
<%= render "comments/comment", :comment => show_comment,
|
|
:show_tree_lines => defined?(show_tree_lines) && show_tree_lines %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|