removed pulgin sort
This commit is contained in:
parent
fb8ea6ebc7
commit
11ef39743a
|
@ -1,11 +1,10 @@
|
||||||
class Admin::ArchiveFilesController < OrbitAdminController
|
class Admin::ArchiveFilesController < OrbitAdminController
|
||||||
|
|
||||||
def index
|
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
|
@categories = @module_app.categories
|
||||||
@tags = @module_app.tags
|
@tags = @module_app.tags
|
||||||
@filter_fields = filter_fields(@categories, @tags)
|
@filter_fields = filter_fields(@categories, @tags)
|
||||||
|
|
||||||
@archives = ArchiveFile.order_by(sort)
|
@archives = ArchiveFile.order_by(sort)
|
||||||
.with_categories(filters("category"))
|
.with_categories(filters("category"))
|
||||||
.with_tags(filters("tag"))
|
.with_tags(filters("tag"))
|
||||||
|
@ -83,23 +82,17 @@ class Admin::ArchiveFilesController < OrbitAdminController
|
||||||
def setup_vars
|
def setup_vars
|
||||||
@module_app = ModuleApp.where(:key => "archive").first
|
@module_app = ModuleApp.where(:key => "archive").first
|
||||||
end
|
end
|
||||||
def sort
|
# def sort
|
||||||
unless params[:sort].blank?
|
# unless params[:sort].blank?
|
||||||
case params[:sort]
|
# case params[:sort]
|
||||||
when "status"
|
# when "downloaded_times"
|
||||||
@sort = [[:is_top, params[:order]],
|
|
||||||
[:is_hot, params[:order]],
|
# else
|
||||||
[:is_hidden,params[:order]]]
|
# @sort = sort
|
||||||
when "category"
|
# end
|
||||||
@sort = {:category_id=>params[:order]}
|
# else
|
||||||
when "title"
|
# @sort = sort
|
||||||
@sort = {:title=>params[:order]}
|
# end
|
||||||
when "last_modified"
|
# @sort
|
||||||
@sort = {:update_user_id=>params[:order]}
|
# end
|
||||||
end
|
|
||||||
else
|
|
||||||
@sort = {:created_at=>'desc'}
|
|
||||||
end
|
|
||||||
@sort
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,8 +6,12 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="sort-header">
|
<tr class="sort-header">
|
||||||
<% @table_fields.each do |f| %>
|
<% @table_fields.each do |f| %>
|
||||||
|
<% if f == "archive.downloaded_times" %>
|
||||||
|
<%= thead(f,true,false) %>
|
||||||
|
<% else %>
|
||||||
<%= thead(f) %>
|
<%= thead(f) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
Loading…
Reference in New Issue