widget & frontend field
This commit is contained in:
1 parent
c0cac812c5
commit
d5c55c9697
19 files changed
+604
-100
No files matched your search
@@ -11,6 +11,11 @@ class Admin::ModuleAppsController < ApplicationController
|
||||
|
||||
def reload_frontend_pages
|
||||
@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
|
||||
|
||||
@@ -49,6 +49,10 @@ 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] )
|
||||
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('admin.update_success_content')
|
||||
@@ -74,11 +78,12 @@ class Admin::PagePartsController < ApplicationController
|
||||
def reload_widgets
|
||||
@module_app = ModuleApp.find(params[:id])
|
||||
|
||||
@widget_path = @module_app.widgets.keys[0]
|
||||
@widget_style = @module_app.widgets[@widget_path]
|
||||
@widget_path = @module_app.widgets.keys[0] if ( @module_app.widgets[0].blank? )
|
||||
|
||||
@widget_style = @module_app.widgets[@widget_path] if ( !@widget_path.blank? )
|
||||
|
||||
case @module_app.key
|
||||
when 'announcement'
|
||||
# @widget_style = @module_app.widgets['index']
|
||||
@categories = BulletinCategory.all
|
||||
@tags = AnnouncementTag.all
|
||||
when 'news'
|
||||
|
||||
@@ -28,10 +28,19 @@ class Admin::PagesController < ApplicationController
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
@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
|
||||
@module_app = @item.module_app
|
||||
|
||||
@frontend_path = @item.app_frontend_url ? @item.app_frontend_url : @module_app.widgets.keys[0]
|
||||
@frontend_style = @module_app.widgets[@frontend_path] if !@frontend_path.blank? && !@module_app.widgets.blank?
|
||||
|
||||
case @item.module_app.key
|
||||
when 'announcement'
|
||||
@categories = BulletinCategory.all
|
||||
@@ -45,6 +54,7 @@ class Admin::PagesController < ApplicationController
|
||||
end
|
||||
else
|
||||
@categories = nil
|
||||
@module_app = @module_apps[0]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -79,6 +89,9 @@ class Admin::PagesController < ApplicationController
|
||||
@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] )
|
||||
params[:page][:frontend_field_type] = nil
|
||||
|
||||
if @item.update_attributes(params[:page])
|
||||
flash[:notice] = t('admin.update_success_page')
|
||||
respond_to do |format|
|
||||
|
||||
Reference in new issue
Block a user