Skip to content

Commit

Permalink
make comment id unique
Browse files Browse the repository at this point in the history
  • Loading branch information
CleverFool77 committed Apr 19, 2019
1 parent 7a8a563 commit 61b07ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/comments/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="comment-form-wrapper" style="background-color:#f8f8f8; border: 1px solid #e7e7e7;padding: 18px;">
<form class="comment-form" id="comment-form" data-remote="true" class="well" <% if !local_assigns[:is_answer].blank? %> action= "/answers/create/<%= @node.nid %>" <% elsif !local_assigns[:aid].blank? %> action= "/comment/answer_create/<%= aid %>" <% else %> action="/comment/create/<%= @node.nid %><%= "?type=question" if local_assigns[:type]=="question" %>" <% end %> <% if local_assigns[:aid].blank? %>method="post"<% end %>>
<form class="comment-form" id="comment-form-<%= Time.now.to_s.gsub(" ", "") %><%= rand(10000) %>" data-remote="true" class="well" <% if !local_assigns[:is_answer].blank? %> action= "/answers/create/<%= @node.nid %>" <% elsif !local_assigns[:aid].blank? %> action= "/comment/answer_create/<%= aid %>" <% else %> action="/comment/create/<%= @node.nid %><%= "?type=question" if local_assigns[:type]=="question" %>" <% end %> <% if local_assigns[:aid].blank? %>method="post"<% end %>>

<h4 style="margin-top:0;"><%= title %><% if current_user && current_user.id == @node.uid %> <small><a target="_blank" href="https://publiclab.org/comment-templates">Add a response template</a></small><% end %></h4>

Expand All @@ -26,7 +26,7 @@
body = Node.find_by(slug: @node.power_tag('comment-template')).try(:body)
end
%>
<textarea style="border: 1px solid #bbb;border-bottom-left-radius: 0;border-bottom-right-radius: 0;border-bottom: 0;padding: 10px;" onFocus="editing=true" name="body" class="form-control" id="text-input" rows="6" cols="40" placeholder="<%= placeholder %>"><% if local_assigns[:is_new_answer].blank? %> <%= body %><% end %></textarea>
<textarea style="border: 1px solid #bbb;border-bottom-left-radius: 0;border-bottom-right-radius: 0;border-bottom: 0;padding: 10px;" onFocus="editing=true" name="body" class="form-control" id="text-input-<%= Time.now.to_s.gsub(" ", "") %><%= rand(10000) %>" rows="6" cols="40" placeholder="<%= placeholder %>"><% if local_assigns[:is_new_answer].blank? %> <%= body %><% end %></textarea>
<div id="imagebar">

<div id="create_progress" style="display:none;" class="progress progress-striped active pull-right">
Expand All @@ -45,7 +45,7 @@

<!-- http://stackoverflow.com/questions/11235206/twitter-bootstrap-form-file-element-upload-button -->
<label id="input_label" class="" for="fileinput">
<input id="fileinput" type="file" name="image[photo]" style="display:none;" />
<input id="fileinput-<%= Time.now.to_s.gsub(" ", "") %><%= rand(10000) %>" type="file" name="image[photo]" style="display:none;" />
<a onClick="handleClick()" class="hidden-xs">choose one</a>
<span class="visible-xs">
<i class="fa fa-upload"></i>
Expand Down

0 comments on commit 61b07ec

Please sign in to comment.