1.Remove category column when category is specified

2.Showing category if not in category browsing
3.Redirect to home and show error if app page is not available for user language
4.Showing no context to display if object has no language for it.
5.Browse new and announcement by unit is now applicable.
This commit is contained in:
Matthew K. Fu JuYuan authored and Christophe Vilayphiou committed 2012-08-08 14:46:08 +08:00
1 parent b4c2dfe0ef
commit e8317e0a4b
21 files changed
+130 -42

No files matched your search

+4 -1
View File
@@ -23,7 +23,10 @@ class Item
before_destroy :destroy_children
after_rearrange :rebuild_path, :if => "parent_id_changed? || name_changed?"
def enabled_for_lang(lang)
enabled_for.include?(lang)
end
def self.find_by_name(item_name)
Item.first(:conditions => { :name => item_name, :is_published => true })
end
+2 -2
View File
@@ -6,8 +6,8 @@ class Page < Item
field :content
field :app_frontend_url
field :theme_id, :type => BSON::ObjectId, :default => nil
field :category
field :tag
field :category, :default => ''
field :tag, :default => ''
field :view_count, :type => Integer, :default => 0
field :page_title, localize: true
-5
View File
@@ -31,12 +31,7 @@ class User
VALID_LOCALES.each do |loc|
locale = loc.to_sym
# debugger
# if(self.cache_dept.nil?)
# self.build_cache_dept key: "dept_cache_user_#{self.id}"
# end
dept_hash[locale] = sub_roles.collect{|sr| sr.title}.join(',')
# self.cache_dept[locale] = sub_roles.collect{|sr| sr.title}.join(',')
end
self.cache_dept = dept_hash
self.save!