Hide disabled categories.

This commit is contained in:
chiu 2021-12-13 14:42:38 +00:00
parent 2dcfaabb66
commit 90660a9036
1 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class Admin::ArchiveFilesController < OrbitAdminController
end
@choose = ArchiveSortOrder.first['sort_order']
@table_fields = [:status, :category, :title, :updated_at,:last_modified,"archive.downloaded_times"]
@categories = @module_app.categories
@categories = @module_app.categories.enabled
@tags = @module_app.tags
@filter_fields = filter_fields(@categories, @tags)
@archives = ArchiveFile.order_by(sort)
@ -54,14 +54,14 @@ class Admin::ArchiveFilesController < OrbitAdminController
def new
@archive_file = ArchiveFile.new
@tags = @module_app.tags
@categories = @module_app.categories
@categories = @module_app.categories.enabled
end
def edit
@archive_file = ArchiveFile.find(params[:id])
if can_edit_or_delete?(@archive_file)
@tags = @module_app.tags
@categories = @module_app.categories
@categories = @module_app.categories.enabled
else
render_401
end