New UI changes(tags, categories, authorisations, module index…)
To run: - ruby lib/remove_old_tags.rb DB_NAME - rake new_ui:migrate_tags - rake new_ui:migrate_categories['APP_KEY,''MODEL_NAME'] (check new_ui.rake for more details)
This commit is contained in:
1 parent
07b3857465
commit
856898016b
1495 files changed
+52132
-9876
No files matched your search
-8
@@ -1,8 +0,0 @@
|
||||
class Panel::Archive::BackEnd::TagsController < Admin::TagsController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_title = 'archive'
|
||||
end
|
||||
|
||||
end
|
||||
Vendored
+1
-3
@@ -33,9 +33,7 @@ class Panel::Archive::FrontEnd::ArchiveFilesController < OrbitWidgetController
|
||||
|
||||
if !params[:category_id].blank? && !params[:tag_id].blank?
|
||||
@archive_files = @archive_files.default_sort(params[:sort]).can_display.where(:archive_file_category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num)
|
||||
|
||||
@current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil
|
||||
|
||||
@current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil
|
||||
elsif !params[:category_id].blank?
|
||||
@archive_files = ArchiveFile.default_sort(params[:sort]).can_display.where(:archive_file_category_id.in => params[:category_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num)
|
||||
@current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil
|
||||
|
||||
+3
-16
@@ -6,27 +6,18 @@ class ArchiveFile
|
||||
include Mongoid::MultiParameterAttributes
|
||||
include Mongoid::Sortable
|
||||
|
||||
include OrbitModel::Status
|
||||
include OrbitTag::Taggable
|
||||
|
||||
BelongsToCategory = :archive_file_category
|
||||
include OrbitCoreLib::BelongsToCategoryMayDisable
|
||||
|
||||
PAYMENT_TYPES = @site_valid_locales
|
||||
|
||||
include OrbitTag::Taggable
|
||||
taggable
|
||||
|
||||
field :title, localize: true
|
||||
|
||||
# has_and_belongs_to_many :tags, :class_name => "ArchiveTag"
|
||||
|
||||
field :create_user_id
|
||||
field :update_user_id
|
||||
|
||||
field :is_top, :type => Boolean, :default => false
|
||||
field :is_hot, :type => Boolean, :default => false
|
||||
field :is_hidden, :type => Boolean, :default => false
|
||||
|
||||
scope :can_display,where(is_hidden: false)
|
||||
|
||||
# belongs_to :archive_file_category
|
||||
|
||||
has_many :archive_file_multiples, :autosave => true, :dependent => :destroy
|
||||
@@ -68,10 +59,6 @@ class ArchiveFile
|
||||
|
||||
end
|
||||
|
||||
def is_top?
|
||||
self.is_top
|
||||
end
|
||||
|
||||
|
||||
def get_file_icon( file_data )
|
||||
file_icon = "<span class=\"o-archives-file-type\">#{file_data.split('.')[-1]}</span>".html_safe
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
class ArchiveTag < Tag
|
||||
|
||||
has_and_belongs_to_many :archive_files
|
||||
|
||||
|
||||
def get_visible_links(sort = :name)
|
||||
self.archive_files.where(:is_hidden => false).desc(:is_top, sort)
|
||||
end
|
||||
|
||||
end
|
||||
+6
-9
@@ -19,6 +19,7 @@ module Archive
|
||||
|
||||
category ["ArchiveFileCategory"]
|
||||
|
||||
authorizable
|
||||
taggable
|
||||
|
||||
widgets do
|
||||
@@ -59,29 +60,25 @@ module Archive
|
||||
:priority=>1,
|
||||
:active_for_action=>{:archive_files=>:index},
|
||||
:available_for => [:all]
|
||||
|
||||
context_link 'add',
|
||||
:link_path=>"new_panel_archive_back_end_archive_file_path" ,
|
||||
:priority=>2,
|
||||
:active_for_action=>{:archive_files=>:new},
|
||||
:available_for => [:sub_manager]
|
||||
|
||||
context_link 'categories',
|
||||
:link_path=>"panel_archive_back_end_archive_file_categorys_path" ,
|
||||
:priority=>3,
|
||||
:active_for_action=>{:archive_file_categorys=>:index},
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'tags',
|
||||
:link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Archive'}))" ,
|
||||
:link_path=>"admin_module_tags_path(module_app_id: get_module_app)" ,
|
||||
:priority=>4,
|
||||
# :active_for_action=>{:bulletin_categorys=>:index},
|
||||
:active_for_tag => 'Archive',
|
||||
:available_for => [:manager]
|
||||
|
||||
context_link 'module_authorization',
|
||||
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'Archive'}))",
|
||||
:priority=>6,
|
||||
:active_for_app_auth => 'Archive'
|
||||
:link_path=>"admin_authorizations_path(get_module_app.key)",
|
||||
:priority=>5,
|
||||
:available_for => [:manager]
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user