Fixed wiki pages.

This commit is contained in:
benni 2012-10-09 02:31:10 +02:00
parent acdb331e36
commit 699fb9b233
19 changed files with 200 additions and 220 deletions

View file

@ -97,6 +97,23 @@ class PagesController < ApplicationController
end
def all
@pages = Page.non_redirected
@partial = params[:view] || 'recent_changes'
if params[:name]
@pages = @pages.where("title LIKE ?", "%#{params[:name]}%").limit(20).order('updated_at DESC')
@partial = 'title_list'
else
order = case @partial
when 'recent_changes' then
'updated_at DESC'
when 'site_map' then
'created_at DESC'
when 'title_list' then
'title DESC'
end
@pages.order(order)
end
end
def version