diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ab01ea6b..a57b4d70 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -96,9 +96,9 @@ class ApplicationController < ActionController::Base end # Render the page - def render_page(id = nil) + def render_page(param) if @item - render :text => process_page(@item, id), :layout => 'page_layout' + render :text => process_page(@item, param[:id],param), :layout => 'page_layout' else render :text => '404 Not Found' end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 4860ea2e..fab5b6a0 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -19,7 +19,7 @@ class PagesController < ApplicationController if @item && @item.is_published case @item._type when 'Page' - render_page(params[:id]) + render_page(params) when 'Link' redirect_to "http://#{@item[:url]}" end @@ -40,7 +40,9 @@ class PagesController < ApplicationController end def show_from_link - redirect_to "/#{@item.full_name}?id=#{params[:id]}" + # debugger + # a=1 + redirect_to "/#{@item.full_name}?id=#{params[:id]}&preview=#{params[:preview]}" end def load_orbit_bar diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6e76b1a2..ab8d163f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -116,8 +116,8 @@ module ApplicationHelper ' active' if (@filter[type].include?(id.to_s) rescue nil) end - def process_page(page, id) - parse_page_noko(page, id) + def process_page(page, id,params) + parse_page_noko(page, id,params) end def page_metas(page) diff --git a/app/views/admin/ad_banners/index.html.erb b/app/views/admin/ad_banners/index.html.erb index d70afab3..47a9ec4d 100644 --- a/app/views/admin/ad_banners/index.html.erb +++ b/app/views/admin/ad_banners/index.html.erb @@ -1,7 +1,7 @@ <% content_for :page_specific_css do -%> <%#= stylesheet_link_tag "admin/ad_banner_preview" %> <% end -%> -<% content_for :page_specific_css do -%> +<% content_for :page_specific_javascript do -%> <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> <%= javascript_include_tag "inc/modal-preview" %> <% end -%> diff --git a/app/views/admin/module_apps/edit.html.erb b/app/views/admin/module_apps/edit.html.erb index 52142fea..7fb64d17 100644 --- a/app/views/admin/module_apps/edit.html.erb +++ b/app/views/admin/module_apps/edit.html.erb @@ -17,17 +17,17 @@