small fix for page render

This commit is contained in:
Harry Bomrah 2014-11-27 18:09:18 +08:00
parent 0623541d94
commit 03822379b2
2 changed files with 4 additions and 2 deletions

View File

@ -317,7 +317,9 @@ class PagesController < ApplicationController
@part_partials.each do |key, partial| @part_partials.each do |key, partial|
html_string = "" html_string = ""
partial.each do |p| partial.each do |p|
html_string = html_string + p if !p.nil?
html_string = html_string + p
end
end end
pp = doc.css("*[#{key}]") pp = doc.css("*[#{key}]")
if !pp.blank? if !pp.blank?

View File

@ -22,7 +22,7 @@ module ApplicationHelper
header = Nokogiri::HTML(header_file_html, nil, "UTF-8") header = Nokogiri::HTML(header_file_html, nil, "UTF-8")
sub_menu_html = site.sub_menu sub_menu_html = site.sub_menu
html = header.to_s html = header.to_s
html = html.gsub("{{site_name}}",site.title) html = html.gsub("{{site_name}}",(site.title rescue ""))
html = html.gsub("%7B%7Blogo_url%7D%7D",(site.site_logo.url.nil? ? "/assets/site-logo.png" : site.site_logo.url)) html = html.gsub("%7B%7Blogo_url%7D%7D",(site.site_logo.url.nil? ? "/assets/site-logo.png" : site.site_logo.url))
if site.sitemap_menu_in_header if site.sitemap_menu_in_header
sub_menu_html = sub_menu_html + "<a href='/#{I18n.locale.to_s}#{site.site_map_link}'>Sitemap</a>" sub_menu_html = sub_menu_html + "<a href='/#{I18n.locale.to_s}#{site.site_map_link}'>Sitemap</a>"