Merge branch 'design_team' of github.com:Rulingcom/orbit into design_team

This commit is contained in:
Christophe Vilayphiou committed 2012-05-08 17:24:40 +08:00
commit d2e07f537a
19 files changed
+104 -135

No files matched your search

+1
View File
@@ -29,6 +29,7 @@ module ParserBackEnd
public_r_tags = parse_content_edits(body, page, id)
parse_images(body, page)
parse_footer(body, page, true)
parse_sub_menu(body, page, true)
public_r_tags.each do |tag|
send("parse_#{tag}s", body, page,id)
+25 -7
View File
@@ -3,7 +3,7 @@ module ParserCommon
def menu_level(page, current, menu, edit = false)
res = ''
if page.children.size > 0
if page.ordered_and_visible_children.size > 0
res << "<ul class='"
res << menu.values["class_#{current}"] rescue nil
res << "'>"
@@ -127,14 +127,32 @@ module ParserCommon
end
end
# page_menu
# page_footer
def parse_footer(body, page, edit=nil)
page_footer = body.css('.page_footer').first
res = "<div, id='footer', class='footer'>"
res << @site.footer[I18n.locale]
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_footer.swap(fragment) rescue nil
if page_footer
res = "<div id='#{page_footer['id']}', class='#{page_footer['class']}'>"
res << @site.footer[I18n.locale] rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_footer.swap(fragment) rescue nil
else
''
end
end
# page_sub_menu
def parse_sub_menu(body, page, edit=nil)
page_sub_menu = body.css('.page_sub_menu').first
if page_sub_menu
res = "<div id='#{page_sub_menu['id']}', class='#{page_sub_menu['class']}'>"
res << @site.sub_menu[I18n.locale] rescue nil
res << "</div>"
fragment = Nokogiri::HTML::DocumentFragment.new(body ,res)
page_sub_menu.swap(fragment) rescue nil
else
''
end
end
end
+2 -1
View File
@@ -26,7 +26,8 @@ module ParserFrontEnd
parse_menu(body, page)
public_r_tags = parse_contents(body, page, id,params[:preview])
parse_images(body, page)
parse_footer(body, page, true)
parse_footer(body, page)
parse_sub_menu(body, page)
public_r_tags.each do |tag|
send("parse_#{tag}s", body, page,id)