Fix several bus when there is no design
This commit is contained in:
parent
32b7d95669
commit
32519f308f
|
@ -34,7 +34,7 @@ class Page < Item
|
|||
end
|
||||
|
||||
def set_key
|
||||
if title.new_record?
|
||||
if title && title.new_record?
|
||||
title.key = 'title'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -47,9 +47,9 @@ module ParserBackEnd
|
|||
ret << "'></div>"
|
||||
else
|
||||
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 << " <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>'
|
||||
case part.kind
|
||||
when 'text'
|
||||
|
@ -65,7 +65,7 @@ module ParserBackEnd
|
|||
public_r_tags << part.public_r_tag
|
||||
else
|
||||
''
|
||||
end
|
||||
end if part
|
||||
end
|
||||
scope = "<#{content.name}"
|
||||
content.attributes.each_pair do |key, value|
|
||||
|
|
|
@ -61,7 +61,7 @@ module ParserFrontEnd
|
|||
public_r_tags << part.public_r_tag
|
||||
else
|
||||
''
|
||||
end
|
||||
end if part
|
||||
end
|
||||
scope = "<#{content.name}"
|
||||
content.attributes.each_pair do |key, value|
|
||||
|
|
Reference in New Issue