Add footer parser
This commit is contained in:
1 parent
0246341aef
commit
e52119e258
3 files changed
+14
-1
No files matched your search
@@ -28,6 +28,7 @@ module ParserBackEnd
|
||||
parse_menu(body, page, true)
|
||||
public_r_tags = parse_content_edits(body, page, id)
|
||||
parse_images(body, page)
|
||||
parse_footer(body, page, true)
|
||||
|
||||
public_r_tags.each do |tag|
|
||||
send("parse_#{tag}s", body, page,id)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module ParserCommon
|
||||
|
||||
include ActionView::Helpers::TagHelper
|
||||
|
||||
def menu_level(page, current, menu, edit = false)
|
||||
res = ''
|
||||
if menu.levels > 0 && current <= menu.levels
|
||||
@@ -127,4 +128,14 @@ module ParserCommon
|
||||
end
|
||||
end
|
||||
|
||||
# page_menu
|
||||
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)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -26,6 +26,7 @@ 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)
|
||||
|
||||
public_r_tags.each do |tag|
|
||||
send("parse_#{tag}s", body, page,id)
|
||||
|
||||
Reference in new issue
Block a user