Merge branch 'member_plugin' of https://github.com/Rulingcom/orbit into member_plugin
This commit is contained in:
commit
90c6c88f2f
378 files changed
+13884
-3186
No files matched your search
@@ -94,7 +94,12 @@ class Admin::DesignsController < OrbitBackendController
|
||||
|
||||
def destroy
|
||||
@design = Design.find(params[:id])
|
||||
@design.destroy
|
||||
if @site.design == @design
|
||||
flash[:error] = "Failed! You can not delete a design that used by default "
|
||||
else
|
||||
@design.destroy
|
||||
flash[:notice] = "Successfully deleted design."
|
||||
end
|
||||
redirect_to admin_designs_url
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
before_filter :user_has_sub_manager_privilege?, :only => [ :assign_sub_manager, :remove_sub_manager ]
|
||||
|
||||
layout "new_admin"
|
||||
|
||||
helper Admin::PagePartsHelper
|
||||
def index
|
||||
@module_apps = ModuleApp.all.entries
|
||||
end
|
||||
|
||||
@@ -4,7 +4,6 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
|
||||
|
||||
def setting
|
||||
|
||||
@sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user
|
||||
@ob_auth = ObjectAuth.find params[:object_auth_id]
|
||||
@options_from_collection_for_select_ob_auth = @ob_auth.siblings.collect{|oa| [oa.auth_obj.pp_object,oa.id] }
|
||||
@@ -60,6 +59,7 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
|
||||
def force_order
|
||||
authenticate_user!
|
||||
setup_vars
|
||||
check_if_user_can_do_object_auth
|
||||
end
|
||||
|
||||
@@ -76,15 +76,25 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
end
|
||||
|
||||
def setup_vars
|
||||
if request.env['HTTP_REFERER'].split('/')[4] == "object_auths"
|
||||
http_referer = request.env['HTTP_REFERER'] || ''
|
||||
if http_referer.split('/')[4] == "object_auths"
|
||||
@app_key = params[:app_key]
|
||||
else
|
||||
@app_key = request.env['HTTP_REFERER'].split('/')[4]
|
||||
@app_key = http_referer.split('/')[4]
|
||||
end
|
||||
|
||||
#@app_key = request.fullpath.split('/')[1] if(@app_key == "back_end")
|
||||
@app_key.gsub!(/[?].*/,'')
|
||||
@module_app = ModuleApp.first(conditions: {:key => @app_key} )
|
||||
if @app_key
|
||||
@app_key.gsub!(/[?].*/,'')
|
||||
@module_app = ModuleApp.first(conditions: {:key => @app_key} )
|
||||
if @module_app.nil?
|
||||
raise ObjectAuthError, 'Auth procress failed, module_app not exist '
|
||||
end
|
||||
else
|
||||
raise ObjectAuthError, 'Auth procress failed, pls redo your sop'
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -26,6 +26,7 @@ class Admin::PagePartsController < ApplicationController
|
||||
@part = PagePart.find(params[:id])
|
||||
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
|
||||
@module_app = @part.module_app ? @part.module_app : @module_apps[0]
|
||||
@user_choose = @part.widget_path
|
||||
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
|
||||
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
||||
|
||||
@@ -39,9 +40,9 @@ class Admin::PagePartsController < ApplicationController
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'news'
|
||||
@categories = NewsBulletinCategory.all
|
||||
@tags = NewsTag.all
|
||||
when 'gallery'
|
||||
@albums = GalleryAlbum.all
|
||||
@tags = []
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
@@ -90,6 +91,7 @@ class Admin::PagePartsController < ApplicationController
|
||||
end
|
||||
|
||||
def reload_widgets
|
||||
@part = PagePart.find params[:part_id]
|
||||
@categories =[]
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
|
||||
@@ -101,9 +103,9 @@ class Admin::PagePartsController < ApplicationController
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'news'
|
||||
@categories = NewsBulletinCategory.all
|
||||
@tags = NewsTag.all
|
||||
when 'gallery'
|
||||
@albums = GalleryAlbum.all
|
||||
@tags = []
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
@@ -112,6 +114,7 @@ class Admin::PagePartsController < ApplicationController
|
||||
@tags = ArchiveTag.all
|
||||
end
|
||||
|
||||
@part.widget_path = @module_app.widgets.first if @module_app.needs_to_widget_option?
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
@@ -119,9 +122,10 @@ class Admin::PagePartsController < ApplicationController
|
||||
|
||||
def reload_widget_styles
|
||||
@module_app = ModuleApp.find(params[:module_app_id])
|
||||
|
||||
@part = PagePart.find params[:part_id]
|
||||
@user_choose =@widget_path= params[:id]
|
||||
@widget_style = @module_app.widgets[params[:id]]
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::PagesController < Admin::ItemsController
|
||||
|
||||
helper Admin::PagePartsHelper
|
||||
def show
|
||||
@item = Page.find(params[:id])
|
||||
respond_to do |format|
|
||||
|
||||
@@ -46,12 +46,16 @@ class Admin::TagsController < OrbitBackendController
|
||||
|
||||
protected
|
||||
|
||||
def set_module_app
|
||||
@module_app ||= ModuleApp.first(:conditions => {:key => @app_title.underscore}) rescue nil
|
||||
end
|
||||
|
||||
def get_tags
|
||||
@tags = (@module_app ? @module_app.tags : Tag.all)
|
||||
end
|
||||
|
||||
def setup_vars
|
||||
@app_key = request.env['HTTP_REFERER'].split('/')[4]
|
||||
if @app_key
|
||||
@app_key.gsub!(/[?].*/, '')
|
||||
@module_app = ModuleApp.first(conditions: {:key => @app_key})
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -8,6 +8,12 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
before_filter :force_order_for_user,:except => [:index,:show]
|
||||
before_filter :set_attribute,:except => [:index,:show]
|
||||
|
||||
def setup_vars
|
||||
# @app_title ||= controller_path.split('/')[1].singularize
|
||||
# @module_app ||= ModuleApp.first(conditions: {:key => @app_title} )
|
||||
# raise ModuleAppError, 'Can not find ModuleApp' if @module_app.nil?
|
||||
end
|
||||
|
||||
def index
|
||||
get_tags
|
||||
get_sub_roles
|
||||
|
||||
Reference in new issue
Block a user