diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 5d5463a..f07ca3d 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -1,11 +1,10 @@ class Admin::ArchiveFilesController < OrbitAdminController def index - @table_fields = [:status, :category, :title, :update_at,:last_modified,"archive.downloaded_times"] + @table_fields = [:status, :category, :title, :updated_at,:last_modified,"archive.downloaded_times"] @categories = @module_app.categories @tags = @module_app.tags @filter_fields = filter_fields(@categories, @tags) - @archives = ArchiveFile.order_by(sort) .with_categories(filters("category")) .with_tags(filters("tag")) @@ -83,23 +82,17 @@ class Admin::ArchiveFilesController < OrbitAdminController def setup_vars @module_app = ModuleApp.where(:key => "archive").first end - def sort - unless params[:sort].blank? - case params[:sort] - when "status" - @sort = [[:is_top, params[:order]], - [:is_hot, params[:order]], - [:is_hidden,params[:order]]] - when "category" - @sort = {:category_id=>params[:order]} - when "title" - @sort = {:title=>params[:order]} - when "last_modified" - @sort = {:update_user_id=>params[:order]} - end - else - @sort = {:created_at=>'desc'} - end - @sort - end + # def sort + # unless params[:sort].blank? + # case params[:sort] + # when "downloaded_times" + + # else + # @sort = sort + # end + # else + # @sort = sort + # end + # @sort + # end end diff --git a/app/views/admin/archive_files/_index.html.erb b/app/views/admin/archive_files/_index.html.erb index a06d5b9..902e03e 100644 --- a/app/views/admin/archive_files/_index.html.erb +++ b/app/views/admin/archive_files/_index.html.erb @@ -6,7 +6,11 @@ <% @table_fields.each do |f| %> - <%= thead(f) %> + <% if f == "archive.downloaded_times" %> + <%= thead(f,true,false) %> + <% else %> + <%= thead(f) %> + <% end %> <% end %>