Merge branch 'design_team' into ldap
Conflicts: Gemfile.lock app/controllers/admin/module_apps_controller.rb app/controllers/application_controller.rb vendor/built_in_modules/web_resource/web_resource.json
This commit is contained in:
commit
ebc8dd33ec
108 files changed
+1148
-619
No files matched your search
@@ -15,6 +15,12 @@ class Admin::ItemsController < ApplicationController
|
||||
@item = get_homepage
|
||||
end
|
||||
end
|
||||
|
||||
def update_position
|
||||
item = Item.find(params[:id])
|
||||
item.shift_to(params[:parent_id], params[:position])
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
@@ -12,13 +12,16 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
def reload_frontend_pages
|
||||
@categories =[]
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
unless (@module_app.category.nil? rescue true)
|
||||
@module_app.category.each do |category|
|
||||
@categories << eval(category).all.entries
|
||||
end
|
||||
@categories.flatten!
|
||||
else
|
||||
@categories = nil
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'news'
|
||||
@categories = NewsBulletinCategory.all
|
||||
@tags = NewsTag.all
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
class Admin::NewInterfaceModuleAppsController < ApplicationController
|
||||
class Admin::ModuleAppsNewInterfaceController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
include AdminHelper
|
||||
@@ -6,7 +6,7 @@ class Admin::NewInterfaceModuleAppsController < ApplicationController
|
||||
layout "new_admin"
|
||||
|
||||
def setting
|
||||
@sys_users = User.all
|
||||
@sys_users = User.all(conditions: {admin: false})
|
||||
@module_app = ModuleApp.find(params[:module_app_id])
|
||||
@options_from_collection_for_select_bulletin_categorys = [@module_app].collect{|ma| [ma.title,ma.id] }
|
||||
# if params.has_key? :category
|
||||
@@ -0,0 +1,71 @@
|
||||
class Admin::ObjectAuthsNewInterfaceController < ApplicationController
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
layout "new_admin"
|
||||
before_filter :force_order
|
||||
|
||||
layout "new_admin"
|
||||
|
||||
|
||||
def setting
|
||||
@sys_users = User.all(conditions: {admin: false})
|
||||
@ob_auth = ObjectAuth.find params[:object_auth_id]
|
||||
@options_from_collection_for_select_ob_auth = [@ob_auth].collect{|oa| [oa.auth_obj.pp_object,oa.id] }
|
||||
@users_array = @ob_auth.privilege_users rescue []
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def update_setting
|
||||
ob_auth = update_setting_by_params
|
||||
if ob_auth.save!
|
||||
flash[:notice] = t("admin.object_auth.update_done")
|
||||
else
|
||||
flash[:notice] = t("admin.object_auth.update_failed")
|
||||
end
|
||||
end
|
||||
|
||||
def user_list
|
||||
@ob_auth = ObjectAuth.find params[:ob_auth][:id]
|
||||
end
|
||||
|
||||
protected
|
||||
def update_setting_by_params
|
||||
oa = ObjectAuth.find params[:ob_auth][:id]
|
||||
user_sat = User.find params[:users].keys
|
||||
users_to_new = user_sat - oa.auth_users
|
||||
users_to_remove = oa.auth_users - user_sat
|
||||
|
||||
users_to_new.each do |new_user|
|
||||
oa.add_user_to_privilege_list(new_user)
|
||||
end
|
||||
|
||||
users_to_remove.each do |remove_user|
|
||||
oa.remove_user_from_privilege_list(remove_user)
|
||||
end
|
||||
oa
|
||||
end
|
||||
|
||||
# def get_categorys(id = nil)
|
||||
# @bulletin_categorys = []
|
||||
# if(is_manager? || is_admin?)
|
||||
# @bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
||||
# elsif is_sub_manager?
|
||||
# @bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new')
|
||||
# end
|
||||
# end
|
||||
|
||||
def force_order
|
||||
authenticate_user!
|
||||
check_if_user_can_do_object_auth
|
||||
end
|
||||
|
||||
def check_if_user_can_do_object_auth
|
||||
unless check_permission(:manager)
|
||||
render :nothing => true, :status => 403
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -20,14 +20,14 @@ class Admin::PagesController < ApplicationController
|
||||
def new
|
||||
@item = Page.new
|
||||
@item.parent = Item.find(params[:parent_id]) rescue nil
|
||||
@apps = ModuleApp.all
|
||||
@apps = ModuleApp.excludes(app_pages: nil).entries
|
||||
@designs = Design.all.entries
|
||||
@design = Design.first
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
@apps = ModuleApp.all
|
||||
@apps = ModuleApp.excludes(app_pages: nil).entries
|
||||
@designs = Design.all.entries
|
||||
@design = @item.design ? @item.design : @designs.first
|
||||
@app_frontend_urls = @item.module_app.app_pages if @item.module_app
|
||||
@@ -35,10 +35,13 @@ class Admin::PagesController < ApplicationController
|
||||
case @item.module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'news'
|
||||
@categories = NewsBulletinCategory.all
|
||||
@tags = NewsTag.all
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
end
|
||||
else
|
||||
@categories = nil
|
||||
|
||||
Reference in new issue
Block a user