This commit is contained in:
albert
2010-10-20 16:03:00 -04:00
parent 7b28eeea4d
commit d7eafdaaf5
6 changed files with 23 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
class CommentsController < ApplicationController
respond_to :html, :xml, :json
before_filter :member_only, :only => [:update, :create]
def index
@posts = Post.commented_before(params[:before_date] || Time.now).limit(8)

View File

@@ -0,0 +1,18 @@
module Paginators
class PostVersion < Base
attr_accessor :post_set
def initialize(post_set)
@post_set = post_set
end
def numbered_pagination_html(template)
raise NotImplementedError
end
protected
def sequential_link(template)
template.post_versions_path(:before_time => post_set.posts[-1].last_commented_at, :page => nil)
end
end
end

View File

@@ -6,7 +6,7 @@
</div>
<% end %>
<aside class="sidebar">
<aside id="sidebar">
<section id="search-box">
<h1>Search</h1>
<% form_tag(posts_path, :method => "get") do %>
@@ -69,7 +69,7 @@
</section>
</aside>
<section class="content">
<section id="content">
<h1>Posts</h1>
<%= @post_set.presenter.post_previews_html %>