Fix several bus when there is no design

This commit is contained in:
Christophe Vilayphiou 2012-04-02 02:41:42 +08:00
parent 32b7d95669
commit 32519f308f
3 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,7 @@ class Page < Item
end end
def set_key def set_key
if title.new_record? if title && title.new_record?
title.key = 'title' title.key = 'title'
end end
end end

View File

@ -47,9 +47,9 @@ module ParserBackEnd
ret << "'></div>" ret << "'></div>"
else else
part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil
ret << "<div id='#{content['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>" ret << "<div id='#{content['name']}' part_id='#{part.id}' class='editable' style='border:solid 1px; margin:5px; padding:5px;'>" if part
ret << "<div class='edit_link' style='display:none'>" ret << "<div class='edit_link' style='display:none'>"
ret << " <a href='#{edit_admin_page_part_path(part.id)}' class='nav'>#{t(:edit)}</a>" ret << " <a href='#{edit_admin_page_part_path(part.id)}' class='nav'>#{t(:edit)}</a>" if part
ret << '</div>' ret << '</div>'
case part.kind case part.kind
when 'text' when 'text'
@ -65,7 +65,7 @@ module ParserBackEnd
public_r_tags << part.public_r_tag public_r_tags << part.public_r_tag
else else
'' ''
end end if part
end end
scope = "<#{content.name}" scope = "<#{content.name}"
content.attributes.each_pair do |key, value| content.attributes.each_pair do |key, value|

View File

@ -61,7 +61,7 @@ module ParserFrontEnd
public_r_tags << part.public_r_tag public_r_tags << part.public_r_tag
else else
'' ''
end end if part
end end
scope = "<#{content.name}" scope = "<#{content.name}"
content.attributes.each_pair do |key, value| content.attributes.each_pair do |key, value|