Fixed wiki pages.
This commit is contained in:
parent
acdb331e36
commit
699fb9b233
19 changed files with 200 additions and 220 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue