forum previews working
This commit is contained in:
25
app/views/forum_posts/_form.html.erb
Normal file
25
app/views/forum_posts/_form.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<div id="form-content">
|
||||
<%= error_messages_for("forum_post") %>
|
||||
|
||||
<%= simple_form_for(@forum_post) do |f| %>
|
||||
<% unless @forum_post.new_record? %>
|
||||
<%= f.input :topic_id, :as => :hidden %>
|
||||
<% end %>
|
||||
<%= f.input :body %>
|
||||
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<%= f.button :submit, "Preview" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="form-aside">
|
||||
<div id="preview">
|
||||
<div class="content dtext">
|
||||
|
||||
</div>
|
||||
<p><a href="#" name="toggle-preview">Hide</a></p>
|
||||
</div>
|
||||
<div id="dtext-help">
|
||||
<%= render "dtext/help" %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,7 +0,0 @@
|
||||
<div>
|
||||
<%= simple_form_for @search do |f| %>
|
||||
<%= f.input :body_matches %>
|
||||
<%= f.input :creator_name_equals %>
|
||||
<%= f.button :submit %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,10 +1,9 @@
|
||||
<div id="c-forum-topics">
|
||||
<div id="a-edit">
|
||||
<h1>Edit Forum Post</h1>
|
||||
|
||||
<%= simple_form_for(@forum_post) do |f| %>
|
||||
<%= f.input :body %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<% end %>
|
||||
|
||||
<%= render "form" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "forum_topics/secondary_links" %>
|
||||
@@ -1,6 +1,4 @@
|
||||
<%= render "search" %>
|
||||
|
||||
<table>
|
||||
<table width="100%" class="striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Topic</th>
|
||||
@@ -12,10 +10,10 @@
|
||||
<tbody>
|
||||
<% @forum_posts.each do |forum_post| %>
|
||||
<tr>
|
||||
<td><%= forum_post.topic.title %></td>
|
||||
<td><%= truncate forum_post.body, :length => 50 %></td>
|
||||
<td><%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %></td>
|
||||
<td><%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %></td>
|
||||
<td><%= forum_post.creator.name %></td>
|
||||
<td><%= forum_post.created_at %></td>
|
||||
<td><%= time_ago_in_words forum_post.created_at %> ago</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
@@ -24,3 +22,5 @@
|
||||
<div id="paginator">
|
||||
<%= will_paginate @forum_posts %>
|
||||
</div>
|
||||
|
||||
<%= render "forum_topics/secondary_links" %>
|
||||
@@ -1,11 +1,9 @@
|
||||
<div id="c-forum-topics">
|
||||
<div id="a-new">
|
||||
<h1>New Forum Post</h1>
|
||||
|
||||
<%= simple_form_for(@forum_post) do |f| %>
|
||||
<%= f.input :topic_id, :as => :hidden %>
|
||||
<%= f.input :body %>
|
||||
<%= f.button :submit, "Submit" %>
|
||||
<% end %>
|
||||
<%= render "form" %>
|
||||
<%= error_messages_for "forum_post" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "forum_topics/secondary_links" %>
|
||||
12
app/views/forum_posts/search.html.erb
Normal file
12
app/views/forum_posts/search.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<div id="c-forum-topics">
|
||||
<div id="a-search">
|
||||
<h1>Search Forum Posts</h1>
|
||||
<%= simple_form_for @search do |f| %>
|
||||
<%= f.input :topic_title_matches, :label => "Title" %>
|
||||
<%= f.input :body_matches, :label => "Body" %>
|
||||
<%= f.button :submit, "Search" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "forum_topics/secondary_links" %>
|
||||
7
app/views/forum_posts/show.html.erb
Normal file
7
app/views/forum_posts/show.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<div id="c-forum-topics">
|
||||
<div id="a-show" class="single-forum-post list-of-forum-posts">
|
||||
<%= render :partial => "forum_post", :locals => {:forum_post => @forum_post} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "forum_topics/secondary_links" %>
|
||||
Reference in New Issue
Block a user