add inline forum editing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<%= error_messages_for("forum_post") %>
|
||||
|
||||
<%= simple_form_for(@forum_post) do |f| %>
|
||||
<%= simple_form_for(forum_post) do |f| %>
|
||||
<%= f.input :topic_id, :as => :hidden %>
|
||||
<%= dtext_field "forum_post", "body" %>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<%= format_text(forum_post.body) %>
|
||||
</div>
|
||||
<menu>
|
||||
<li><%= link_to "Quote", new_forum_post_path(:post_id => forum_post.id) %></li>
|
||||
<li><%= link_to "Quote", new_forum_post_path(:post_id => forum_post.id), :method => :get, :remote => true %></li>
|
||||
<% if CurrentUser.user.is_janitor? || CurrentUser.user.id == forum_post.creator_id %>
|
||||
<% if forum_post.is_deleted %>
|
||||
<li><%= link_to "Undelete", undelete_forum_post_path(forum_post.id), :method => :post, :remote => true %></li>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="a-edit">
|
||||
<h1>Edit Forum Post</h1>
|
||||
|
||||
<%= render "form" %>
|
||||
<%= render "form", :forum_post => @forum_post %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<h1>New Forum Post</h1>
|
||||
<% end %>
|
||||
|
||||
<%= render "form" %>
|
||||
<%= render "form", :forum_post => @forum_post %>
|
||||
<%= error_messages_for "forum_post" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
6
app/views/forum_posts/new.js.erb
Normal file
6
app/views/forum_posts/new.js.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
$("#forum_post_body").val("<%= escape_javascript @forum_post.body %>");
|
||||
$("#new-topic-response").show();
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $("#forum_post_body").offset().top - 100
|
||||
}, 500);
|
||||
Reference in New Issue
Block a user