Manage Uploaded Files

Allow alternate sort-orders (by filename, by date).
Restrict to files in the given Web.
This commit is contained in:
Jacques Distler 2008-12-31 11:30:33 -06:00
parent 1d3f7007c6
commit b74d298196
4 changed files with 28 additions and 14 deletions

View file

@ -134,8 +134,8 @@ class AdminController < ApplicationController
flash[:info] = "File(s) successfully deleted." if some_deleted
else
flash[:error] = password_error(params['system_password'])
end
redirect_to :controller => 'wiki', :web => @web_name, :action => 'file_list'
end
redirect_to :back
end
private

View file

@ -54,7 +54,16 @@ class WikiController < ApplicationController
end
def file_list
@web.file_list
sort_order = params['sort_order'] || 'file_name'
case sort_order
when 'file_name'
@alt_sort_order = 'created_at'
@alt_sort_name = 'date'
else
@alt_sort_order = 'file_name'
@alt_sort_name = 'filename'
end
@file_list = @web.file_list(sort_order)
end
def export_html