default widgets and sidebar.

This commit is contained in:
Matthew K. Fu JuYuan committed 2012-12-24 16:38:35 +08:00
1 parent 6995bb1622
commit 5f712622ad
28 files changed
+344 -162

No files matched your search

@@ -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,5 +1,5 @@
class Admin::ObjectAuthsNewInterfaceController < OrbitBackendController
include OrbitCoreLib::PermissionUnility
include OrbitCoreLib::PermissionUtility
before_filter :force_order
def set_module_app
+24 -21
View File
@@ -28,27 +28,29 @@ class Admin::PagePartsController < ApplicationController
@module_app = @part.module_app ? @part.module_app : @module_apps[0]
@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
@widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0]
@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?
@categories = @module_app.get_registration.get_categories
@tags = @module_app.get_registration.get_tags
# if @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 '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
# 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
end
def create
@@ -60,7 +62,7 @@ class Admin::PagePartsController < ApplicationController
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 @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')
@@ -95,7 +97,7 @@ class Admin::PagePartsController < ApplicationController
@widget_path = @module_app.widgets.keys[0] if ( @module_app.widgets[0].blank? )
@widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? )
@widget_style = @module_app.get_widget_style[@widget_path][:style] unless @widget_path.nil?
case @module_app.key
when 'announcement'
@@ -119,8 +121,9 @@ class Admin::PagePartsController < ApplicationController
def reload_widget_styles
@module_app = ModuleApp.find(params[:module_app_id])
@widget_style = @module_app.widgets[params[:id]]
style_ary = @module_app.get_widget_style[params[:id]]
@widget_style = style_ary[:style] unless style_ary.nil?
respond_to do |format|
format.js {}
end