Fix bus for pages and page content
This commit is contained in:
parent
f8d1d7242d
commit
8f531a6fe5
|
@ -61,7 +61,7 @@ class Admin::PagesController < ApplicationController
|
||||||
def update
|
def update
|
||||||
@item = Page.find(params[:id])
|
@item = Page.find(params[:id])
|
||||||
|
|
||||||
if @item.module_app.key == 'page_content' && @item.page_contexts.blank?
|
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 )
|
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class PagesController < ApplicationController
|
||||||
def show
|
def show
|
||||||
#begin
|
#begin
|
||||||
@item = Item.first(:conditions => {:full_name => params[:page_name]})
|
@item = Item.first(:conditions => {:full_name => params[:page_name]})
|
||||||
if @item.is_published
|
if @item && @item.is_published
|
||||||
case @item._type
|
case @item._type
|
||||||
when 'Page'
|
when 'Page'
|
||||||
render_page(params[:id])
|
render_page(params[:id])
|
||||||
|
|
|
@ -99,7 +99,7 @@ module ParserBackEnd
|
||||||
ret = ''
|
ret = ''
|
||||||
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
|
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
|
||||||
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true&page_id=#{page.id}"
|
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}?inner=true&page_id=#{page.id}"
|
||||||
ret << "&bulletin_category_id=#{page.category}" if page.category
|
ret << "&bulletin_category_id=#{page.category}" if page[:category]
|
||||||
ret << "'></div>"
|
ret << "'></div>"
|
||||||
else
|
else
|
||||||
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
|
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s }
|
||||||
|
|
|
@ -126,7 +126,7 @@ module ParserFrontEnd
|
||||||
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
|
ret << "<div id='appfrontend' class='dymanic_load' path='/panel/#{page.module_app.key}/front_end/#{page.app_frontend_url}"
|
||||||
ret << "/#{id}" if id
|
ret << "/#{id}" if id
|
||||||
ret << "?inner=true&page_id=#{page.id}"
|
ret << "?inner=true&page_id=#{page.id}"
|
||||||
ret << "&bulletin_category_id=#{page.category}" if page.category
|
ret << "&bulletin_category_id=#{page.category}" if page[:category]
|
||||||
ret << "'></div>"
|
ret << "'></div>"
|
||||||
else
|
else
|
||||||
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
|
part = page.page_parts.detect{ |p| p.name.to_s == tag.attr['name'].to_s } rescue nil
|
||||||
|
|
Reference in New Issue