Merge branch 'development' of https://github.com/Rulingcom/orbit into development

This commit is contained in:
saurabhbhatia committed 2013-07-11 17:18:58 +08:00
commit 91b1cf6edc
9 files changed
+76 -66

No files matched your search

@@ -144,7 +144,7 @@ class Admin::AuthorizationsController < OrbitBackendController
def setup_vars
@module_app = ModuleApp.first(conditions: {:key => params[:module]} ) if params[:module]
@category = Category.find(params[:category]) rescue nil
@category = Category.find(params[:id]) rescue nil
@type = params[:type]
end
+12 -18
View File
@@ -106,14 +106,16 @@ module OrbitBackendHelper
if object.is_hidden?
res << content_tag(:span, t(:hidden), class: "label") + ' '
end
if object.is_pending?
res << content_tag(:span, t(:pending), class: "label") + ' '
end
if object.is_checked?
res << content_tag(:span, t(:passed), class: "label") + ' '
end
if object.is_rejected?
res << content_tag(:span, t(:rejected), class: "label") + ' '
if @approvable
if object.is_pending?
res << content_tag(:span, t(:pending), class: "label") + ' '
end
if object.is_checked?
res << content_tag(:span, t(:passed), class: "label") + ' '
end
if object.is_rejected?
res << content_tag(:span, t(:rejected), class: "label") + ' '
end
end
when 'tags'
object.sorted_tags.each do |tag|
@@ -154,8 +156,8 @@ module OrbitBackendHelper
end
def set_default_index(&block)
@approvable = false
@authorization = false
@approvable = @module_app.is_approvable
@authorization = @module_app.is_authorizable
@fields = []
@filter_fields =[]
@filterable = false
@@ -167,14 +169,6 @@ module OrbitBackendHelper
protected
def approvable
@approvable = true
end
def authorization
@authorization = true
end
# ===============================================================
# type:
# check "get_value"
+1 -22
View File
@@ -13,25 +13,4 @@ class Category
scope :enabled, where(:disable.in => [false, nil, ''])
end
# base.instance_eval("scope :admin_manager_all,find(:all)")
# base.define_singleton_method :find do |*args|
# if args ==[:all]
# unscoped
# else
# res = unscoped.find(args)
# res.count == 1 ? res[0] : res
# end
# end
# base.define_singleton_method :first do |*args|
# all.first
# end
# base.define_singleton_method :last do |*args|
# all.last
# end
end
+2
View File
@@ -22,7 +22,9 @@ class ModuleApp
self[:widgets] = reg.get_widgets
self[:has_tag] = reg.get_has_tags
self[:has_category] = reg.get_has_category
self[:is_approvable] = reg.get_is_approvable
self[:is_authorizable] = reg.get_is_authorizable
self[:authorizable_models] = reg.get_authorizable_models
end