Added wiki index by date.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@768 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-09-27 19:35:53 +00:00
parent d823c28484
commit 20aff7cc70
18 changed files with 74 additions and 25 deletions
+2 -1
View File
@@ -121,11 +121,12 @@ class WikiController < ApplicationController
page_title = params[:page].downcase
case page_title
# show pages index, sorted by title
when 'page_index'
when 'page_index', 'date_index'
# eager load information about last updates, without loading text
@pages = @wiki.pages.find :all, :select => "#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_on",
:joins => "LEFT JOIN #{WikiContent.table_name} ON #{WikiContent.table_name}.page_id = #{WikiPage.table_name}.id",
:order => 'title'
@pages_by_date = @pages.group_by {|p| p.updated_on.to_date}
# export wiki to a single html file
when 'export'
@pages = @wiki.pages.find :all, :order => 'title'