member plugin edit
This commit is contained in:
commit
bc44d38948
319 files changed
+5405
-2763
No files matched your search
@@ -9,32 +9,6 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
end
|
||||
|
||||
|
||||
def reload_frontend_pages
|
||||
@categories =[]
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
|
||||
@frontend_path = @module_app.widgets.keys[0] if ( !@module_app.widgets.blank? && @module_app.widgets[0].blank? )
|
||||
|
||||
@frontend_style = @module_app.widgets[@frontend_path] if ( !@frontend_path.blank? )
|
||||
|
||||
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
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def module_auth_proc
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
@@ -136,7 +110,6 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
end
|
||||
#user is not permited to do that
|
||||
flash[:notice] = t('app_auth.operation_not_permitted')
|
||||
render :nothing => true, :status => 403
|
||||
end
|
||||
|
||||
render :nothing => true,:status => 403
|
||||
end
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
class Admin::ObjectAuthsController < ApplicationController
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
layout "new_admin"
|
||||
before_filter :force_order
|
||||
# before_filter :is_admin? ,:only => :index
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
include OrbitCoreLib::PermissionUtility
|
||||
before_filter :force_order
|
||||
|
||||
|
||||
def set_module_app
|
||||
@module_app = ModuleApp.where(:title=>'Announcement').first
|
||||
end
|
||||
|
||||
|
||||
def setting
|
||||
@sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user
|
||||
@@ -59,6 +63,7 @@ class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
|
||||
|
||||
def force_order
|
||||
authenticate_user!
|
||||
set_module_app
|
||||
setup_vars
|
||||
check_if_user_can_do_object_auth
|
||||
end
|
||||
|
||||
@@ -25,31 +25,28 @@ class Admin::PagePartsController < ApplicationController
|
||||
def edit
|
||||
@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]
|
||||
@module_app = @part.module_app ? @part.module_app : nil
|
||||
@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
|
||||
|
||||
if @module_app
|
||||
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
|
||||
@widget_style = @module_app.get_widget_style[@widget_path][:style] unless @widget_path.nil? or @module_app.nil?
|
||||
end
|
||||
|
||||
|
||||
unless @module_app.nil?
|
||||
@categories = @module_app.get_categories
|
||||
@tags = @module_app.get_tags
|
||||
end
|
||||
|
||||
@widget_path = @part.widget_path ? @part.widget_path : (@module_app.widgets.keys[0] rescue nil)
|
||||
|
||||
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
|
||||
|
||||
if @module_app.widgets.any?{|b| b.class == Array}
|
||||
if @module_app && @module_app.widgets.any?{|b| b.class == Array}
|
||||
@widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank?
|
||||
end
|
||||
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'gallery'
|
||||
@albums = GalleryAlbum.all
|
||||
@tags = []
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -59,9 +56,12 @@ class Admin::PagePartsController < ApplicationController
|
||||
def update
|
||||
@part = PagePart.find(params[:id])
|
||||
|
||||
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field]
|
||||
params[:page_part][:widget_field_type] = nil
|
||||
|
||||
params[:page_part][:widget_field] = params[:page_part][:widget_field].zip( params[:page_part][:widget_field_type] ) if params[:page_part][:widget_field]
|
||||
params[:page_part][:widget_field_type] = nil
|
||||
|
||||
if params[:page_part][:module_app].blank?
|
||||
params[:page_part][:module_app] = nil
|
||||
end
|
||||
if @part.update_attributes(params[:page_part])
|
||||
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
|
||||
flash.now[:notice] = t('update.success.content')
|
||||
@@ -91,30 +91,14 @@ class Admin::PagePartsController < ApplicationController
|
||||
end
|
||||
|
||||
def reload_widgets
|
||||
@part = PagePart.find params[:part_id]
|
||||
@categories =[]
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
|
||||
@widget_path = @module_app.widgets.keys[0] if ( @module_app.widgets[0].blank? )
|
||||
|
||||
@part = PagePart.find params[:id]
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
|
||||
@categories =@module_app ? @module_app.get_categories : []
|
||||
@tags =@module_app ? @module_app.get_tags : []
|
||||
@widget_path = @module_app.widgets.keys[0] if (@module_app && @module_app.widgets[0].blank? )
|
||||
@widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? )
|
||||
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'gallery'
|
||||
@albums = GalleryAlbum.all
|
||||
@tags = []
|
||||
when 'web_resource'
|
||||
@categories = WebLinkCategory.all
|
||||
@tags = WebResourceTag.all
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
end
|
||||
|
||||
@part.widget_path = @module_app.widgets.first if @module_app.needs_to_widget_option?
|
||||
@part.widget_path = @module_app.widgets.first if( @module_app)
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
@@ -122,9 +106,11 @@ 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]]
|
||||
|
||||
@part = PagePart.find params[:id]
|
||||
@user_choose =@widget_path= params[:frontend]
|
||||
@widget_style = @module_app.widgets[@widget_path]
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
|
||||
@@ -19,15 +19,21 @@ helper Admin::PagePartsHelper
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
@item = @page =Page.find(params[:id])
|
||||
@user_choose = @item.app_frontend_url
|
||||
@apps = ModuleApp.excludes(app_pages: nil).entries
|
||||
|
||||
@module_apps = ModuleApp.excludes(widgets: nil).where(enable_frontend: true).order_by(:title, :asc)
|
||||
|
||||
@designs = Design.all.entries
|
||||
@design = @item.design ? @item.design : @designs.first
|
||||
@app_frontend_urls = @item.module_app.app_pages if @item.module_app
|
||||
|
||||
|
||||
if @item.module_app
|
||||
@app_frontend_urls = @item.module_app.app_pages.map{|t| [I18n.t(t[0]),t[1]]}
|
||||
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if @item.module_app.has_default_widget?
|
||||
end
|
||||
|
||||
|
||||
if @item.module_app
|
||||
@module_app = @item.module_app
|
||||
|
||||
@@ -84,13 +90,13 @@ helper Admin::PagePartsHelper
|
||||
def update
|
||||
@item = Page.find(params[:id])
|
||||
|
||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field]
|
||||
params[:page][:frontend_field_type] = nil
|
||||
if @item.module_app && @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
|
||||
params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field]
|
||||
params[:page][:frontend_field_type] = nil
|
||||
|
||||
if @item.update_attributes(params[:page])
|
||||
flash[:notice] = t('update.success.page')
|
||||
respond_to do |format|
|
||||
@@ -123,7 +129,42 @@ helper Admin::PagePartsHelper
|
||||
format.js { @item = @item.parent }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def reload_front_end_setting
|
||||
@page = Page.find params[:id]
|
||||
@module_app = ModuleApp.find params[:module_app_id]
|
||||
@chosen_frontend = @user_choose = params[:frontend]
|
||||
end
|
||||
|
||||
def reload_frontend_pages
|
||||
@page = Page.find params[:id] rescue nil
|
||||
# @categories =[]
|
||||
@module_app = ModuleApp.find(params[:module_app_id]) rescue nil
|
||||
@app_frontend_urls = @module_app.nil? ? nil : @module_app.app_pages.map{|t| [I18n.t(t[0]),t[1]]}
|
||||
@app_frontend_urls << [I18n.t('default_widget.name'),'default_widget'] if(@module_app && @module_app.has_default_widget?)
|
||||
|
||||
case (@module_app.nil? ? nil : @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
|
||||
when 'archive'
|
||||
@categories = ArchiveFileCategory.all
|
||||
@tags = ArchiveTag.all
|
||||
else
|
||||
@categories = []
|
||||
@tags = []
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js {}
|
||||
end
|
||||
end
|
||||
|
||||
def reload_themes
|
||||
@design = Design.find(params[:id])
|
||||
@themes = @design.themes
|
||||
|
||||
@@ -4,7 +4,7 @@ class Admin::PluginsController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
@plugins = OrbitApp::Module::Registration.all
|
||||
@plugins = OrbitApp::Plugin::Registration.all
|
||||
|
||||
if(!params[:show_plugin_profile].nil?)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||
|
||||
def show
|
||||
@user = User.find(params[:id])
|
||||
@plugins = OrbitApp::Module::Registration.all
|
||||
@plugins = OrbitApp::Plugin::Registration.all
|
||||
|
||||
@profile_data = []
|
||||
@teacher_data = []
|
||||
|
||||
Reference in new issue
Block a user