beast rev 2066
[beast-modified.git] / app / views / posts / index.html.erb
blobe5a487e04004012ed5a4d8c27ce85cfe515bcd65
1 <% @page_title = search_posts_title -%>
3 <h1>
4 <% if params[:q].blank? -%>
5   <%= @page_title %>
6 <% else -%>
7   <%= 'Searching for'[] %> '<%= h params[:q] %>'
8 <% end -%>
9 </h1>
10 <p class="subtitle">
11   <%= feed_icon_tag @page_title, search_posts_path(true) %>
12   <%= '{count} post(s) found'[(count=@posts.total_entries)==1 ? :post_count_found : :posts_count_found, number_with_delimiter(count)] %>
13 </p>
15 <%= pagination @posts %>
17 <table border="0" cellspacing="0" cellpadding="0" class="posts wide">
18 <% for post in @posts do %>
19 <% unless post == @posts.first %>
20 <tr class="spacer">
21   <td colspan="2">&nbsp;</td>
22 </tr>
23 <% end %>
24 <tr class="post hentry" id="<%= dom_id post %>">
25   <td class="author vcard">
26     <div class="date">
27       <abbr class="updated" title="<%= post.created_at.xmlschema %>">
28       <% if post.created_at > Time.now.utc-24.hours%>
29       <%= time_ago_in_words(post.created_at).sub(/about /, '') %>
30       <% else %>
31       <%= post.created_at.strftime("%b %e, %Y"[:date_format])%>
32       <% end %>
33       </abbr>
34     </div>
36     <%= avatar_for @users[post.user_id] %>
37     <span class="fn"><%= link_to truncate(h(@users[post.user_id].display_name), 15), user_path(post.user_id) %></span>
38     <span class="posts"><%= '{count} posts'[(count=@users[post.user_id].posts.size)==1 ? :post_count : :posts_count, number_with_delimiter(count)] %></span>
39   </td>
40   <td class="body entry-content">
41     <p class="topic">
42       <%= "Topic"[:topic_title] %>: <%= link_to h(post.forum_name), forum_path(post.forum_id) %> / 
43       <%= link_to h(post.topic_title), topic_path(post.forum_id, post.topic_id) %>
44     </p>
45     
46     <%= post.body_html %>
47   </td>
48 </tr>
50 <% end %>
51 </table>
53 <%= next_page @posts %>
54 <%= pagination @posts %>