Add markdown preview; fix bug with deleted editor

This commit is contained in:
jomo
2014-05-11 06:43:56 +02:00
parent df030f4d2d
commit 19eb868a50
19 changed files with 135 additions and 39 deletions

View File

@@ -1,4 +1,4 @@
<%= form_for [reply.thread, reply] do |f| %>
<%= f.text_area :content, placeholder: "Text" %>
<%= render partial: "md_editor", locals: {name: "threadreply[content]", content: reply.content, mini: false} %>
<p><%= f.submit "Reply", class: "btn blue" %></p>
<% end %>

View File

@@ -1,8 +1,7 @@
<%= link_to @reply.thread.forum.group, forumgroup_path(@reply.thread.forum.group) %> → <%= link_to @reply.thread.forum, @reply.thread.forum %> → <%= link_to @reply.thread %> → Edit reply
<h1>Edit reply</h1>
<%= form_for [@reply.thread, @reply] do |f| %>
<%= render partial: "mdhelp" %>
<%= f.text_area :content, placeholder: "Text" %>
<%= render partial: "md_editor", locals: {name: "threadreply[content]", content: @reply.content, mini: false} %>
<p><%= f.submit "Reply", class: "btn blue left" %></p>
<% end %>
<p><%= button_to "Delete reply", [@reply.thread, @reply], method: "delete", data: {confirm: "Delete reply forever?"}, class: "btn red right" %></p>