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:
chris committed 2013-07-02 16:46:44 +08:00
1 parent 07b3857465
commit 856898016b
1495 files changed
+52132 -9876

No files matched your search

@@ -1,8 +0,0 @@
class Panel::WebResource::BackEnd::TagsController < Admin::TagsController
def initialize
super
@app_title = 'web_resource'
end
end
+4 -26
View File
@@ -4,29 +4,21 @@ class WebLink
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include OrbitTag::Taggable
taggable
scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) }
include OrbitModel::LanguageRestrict
include OrbitModel::Status
include OrbitTag::Taggable
field :title, localize: true
field :context, localize: true
#has_and_belongs_to_many :tags, :class_name => "WebResourceTag"
field :url, localize: true
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 :web_link_category
before_save :update_avliable_language, :clean_tags
before_save :clean_tags
validates :title, :at_least_one => true
@@ -54,20 +46,6 @@ class WebLink
end
def is_top?
self.is_top
end
def update_avliable_language
VALID_LOCALES.each do |locale|
if (title_translations[locale].blank? rescue true)
self["available_for_#{locale}".to_sym] = false
else
self["available_for_#{locale}".to_sym] = true
end
end
end
protected
def add_http
@@ -1,10 +0,0 @@
class WebResourceTag < Tag
has_and_belongs_to_many :web_links
def get_visible_links(sort = :title)
self.web_links.where(:is_hidden => false).desc(:is_top, sort)
end
end
@@ -33,4 +33,4 @@
<% else %>
<%= link_to t(:more_plus), panel_web_resource_front_end_web_links_path %>
<% end %>
</div>
</div>
+5 -2
View File
@@ -18,6 +18,9 @@ module WebResource
taggable
authorizable
taggable
widgets do
# default_widget do
# query 'Bulletin.all'
@@ -59,9 +62,9 @@ module WebResource
:available_for => [:manager]
context_link 'tags',
:link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'WebResource'}))" ,
:link_path=>"admin_module_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'WebResource'}))" ,
:priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index},
:active_for_tag => 'WebResource',
:available_for => [:manager]
context_link 'module_authorization',