2014-12-14 07:24:18 +01:00
|
|
|
<div class="comment comment_form_container"
|
|
|
|
data-shortid="<%= comment.short_id if comment.persisted? %>">
|
2014-02-12 20:14:25 +01:00
|
|
|
<%= form_for comment,
|
|
|
|
:html => { :id => "edit_comment_#{comment.short_id}" } do |f| %>
|
2014-01-13 08:11:34 +01:00
|
|
|
<% if comment.errors.any? %>
|
2012-09-14 23:17:45 +02:00
|
|
|
<%= errors_for comment %>
|
|
|
|
<% end %>
|
|
|
|
|
2014-04-15 06:12:50 +02:00
|
|
|
<%= hidden_field_tag "story_id", comment.story.short_id %>
|
2014-01-16 04:55:31 +01:00
|
|
|
|
2014-01-16 03:21:05 +01:00
|
|
|
<% if comment.parent_comment %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<%= hidden_field_tag "parent_comment_short_id",
|
2014-01-16 03:21:05 +01:00
|
|
|
comment.parent_comment.short_id %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<% end %>
|
|
|
|
|
2012-07-02 03:14:32 +02:00
|
|
|
<div style="width: 100%;">
|
2012-06-30 18:18:36 +02:00
|
|
|
<%= text_area_tag "comment", comment.comment, :rows => 5,
|
2017-05-20 15:11:35 +02:00
|
|
|
:disabled => !@user,
|
2016-11-09 16:10:40 +01:00
|
|
|
:placeholder => (@user ? "" : t('.mustbelogged'))
|
2014-04-15 06:12:50 +02:00
|
|
|
%>
|
2012-06-30 18:18:36 +02:00
|
|
|
|
|
|
|
<p></p>
|
|
|
|
|
|
|
|
<div class="markdown_help_toggler">
|
2014-04-15 06:12:50 +02:00
|
|
|
<% if @user %>
|
|
|
|
<div class="markdown_help_label">
|
2016-11-09 16:10:40 +01:00
|
|
|
<%= t('.markdown') %>
|
2014-04-15 06:12:50 +02:00
|
|
|
</div>
|
|
|
|
<div class="markdown_help_label markdown_help_label_mobile"
|
|
|
|
style="display: none;">
|
|
|
|
[M↓]
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2012-06-30 18:18:36 +02:00
|
|
|
|
2016-11-09 16:10:40 +01:00
|
|
|
<%= button_tag "#{comment.new_record?? t('.post') : t('.update')}",
|
2014-04-15 06:12:50 +02:00
|
|
|
:class => "comment-post", :type => "button",
|
|
|
|
:disabled => !@user %>
|
2012-06-30 18:18:36 +02:00
|
|
|
|
2016-11-09 16:10:40 +01:00
|
|
|
<%= button_tag t('.preview'), :class => "comment-preview",
|
2014-04-15 06:12:50 +02:00
|
|
|
:type => "button", :disabled => !@user %>
|
2014-12-14 07:24:18 +01:00
|
|
|
<% if comment.persisted? || comment.parent_comment_id %>
|
2014-01-16 03:21:05 +01:00
|
|
|
|
2016-11-09 16:10:40 +01:00
|
|
|
<%= button_tag t('.cancel'), :class => "comment-cancel",
|
2014-01-16 03:21:05 +01:00
|
|
|
:type => "button" %>
|
|
|
|
<% end %>
|
|
|
|
|
2014-11-14 21:09:28 +01:00
|
|
|
<% if @user && @user.hats.any? %>
|
|
|
|
<div style="display: inline-block; margin-left: 1em;">
|
2016-11-09 16:10:40 +01:00
|
|
|
<%= t('.putonhat') %>
|
2014-11-14 21:09:28 +01:00
|
|
|
<%= select_tag "hat_id",
|
|
|
|
options_from_collection_for_select(@user.hats, "id", "hat",
|
|
|
|
comment.hat_id), :include_blank => true %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2012-06-30 18:18:36 +02:00
|
|
|
<div style="clear: both;"></div>
|
|
|
|
|
2014-04-15 06:12:50 +02:00
|
|
|
<% if @user %>
|
|
|
|
<%= render :partial => "global/markdownhelp" %>
|
|
|
|
<% end %>
|
2012-06-30 18:18:36 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p></p>
|
2012-09-04 18:33:49 +02:00
|
|
|
<% end %>
|
2012-09-14 23:17:45 +02:00
|
|
|
<% if defined?(show_comment) && show_comment.valid? %>
|
2014-01-16 04:25:20 +01:00
|
|
|
<div class="preview">
|
2014-01-13 08:11:34 +01:00
|
|
|
<%= render "comments/comment", :comment => show_comment %>
|
2014-01-16 04:25:20 +01:00
|
|
|
</div>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% end %>
|
2012-06-30 18:18:36 +02:00
|
|
|
</div>
|