forum previews working

This commit is contained in:
albert
2011-03-12 16:09:11 -05:00
parent 21cc1cbafa
commit bd520f61f7
29 changed files with 1516 additions and 81 deletions

View 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>

View File

@@ -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>

View File

@@ -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" %>

View File

@@ -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" %>

View File

@@ -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" %>

View 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" %>

View 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" %>