fix for page date for sdk

This commit is contained in:
Harry Bomrah 2014-10-01 19:37:18 +08:00
parent c0fe4d9b2a
commit e89fd7c30e
1 changed files with 2 additions and 2 deletions

View File

@ -329,7 +329,7 @@ class PagesController < ApplicationController
pps = doc.css("*[data-pp]") pps = doc.css("*[data-pp]")
pps.each do |pp| pps.each do |pp|
number = pp.attributes["data-pp"].value number = pp.attributes["data-pp"].value
if pp.inner_html == "" if pp.inner_html.strip == ""
pp.inner_html = "<a href='/page_parts/new?part=#{number}&page_id=#{page.id.to_s}#{(!$mobile.blank? ? '&mobile_view=1' : '')}'> </a>" pp.inner_html = "<a href='/page_parts/new?part=#{number}&page_id=#{page.id.to_s}#{(!$mobile.blank? ? '&mobile_view=1' : '')}'> </a>"
else else
inner_html = pp.inner_html inner_html = pp.inner_html
@ -365,7 +365,7 @@ class PagesController < ApplicationController
dates.each do |d| dates.each do |d|
format = d.attributes["date-format"].value format = d.attributes["date-format"].value
date = DateTime.parse(d.inner_text) date = DateTime.parse(d.inner_text)
d.inner_html = d.inner_html.gsub(d.inner_text, " " + date.strftime(format)) d.inner_html = d.inner_html.gsub(d.inner_text.strip, " " + date.strftime(format))
end end
return doc.to_html return doc.to_html
end end