Edition of page part for multiple languages.

This commit is contained in:
chris2tof committed 2011-05-27 11:27:54 +08:00
1 parent 0969f6b6cc
commit 2522cde2f5
13 files changed
+70 -18

No files matched your search

+1 -1
View File
@@ -182,7 +182,7 @@ module Parser
ret << "<div class='edit_link' style='display:none'>" if part
ret << " <a href='#{edit_admin_page_part_path(part.id)}' class='nav'>#{t(:edit)}</a>" if part
ret << '</div>' if part
ret << part.content rescue ''
ret << part.i18n_variable[I18n.locale.to_s] rescue ''
ret << tag.expand
ret << '</div>'
end
+4 -2
View File
@@ -31,6 +31,8 @@ namespace :dev do
var_10 = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')
var_11 = I18nVariable.create!( :document_class => 'Page', :key => 'about', :en => 'About', :zh_tw => '關於我們' )
var_12 = I18nVariable.create!( :document_class => 'Link', :key => 'google', :en => 'Google', :zh_tw => 'Google' )
var_13 = I18nVariable.create!( :document_class => 'PagePart', :key => 'main_content', :en => 'This is the homepage', :zh_tw => '這是首頁', :parent_id => var_10.id )
var_14 = I18nVariable.create!( :document_class => 'PagePart', :key => 'main_content', :en => 'This is about', :zh_tw => '這是關於', :parent_id => var_11.id )
# TODO: modify for the new model
@@ -54,10 +56,10 @@ namespace :dev do
layout.layout_parts.create!( :name => 'footer', :content => "<r:snippet name='footer' />" )
home = Page.create!( :i18n_variable_id => var_10.id, :layout_id => layout.id, :name => 'home', :is_published => true )
home.page_parts.create!( :name => 'main_content', :content => "<r:locale en='This is the homepage' zh_tw='這是首頁' />" )
home.page_parts.create!( :name => 'main_content', :content => "<r:locale en='This is the homepage' zh_tw='這是首頁' />", :kind => 'text', :i18n_variable_id => var_13.id )
about = Page.create!( :i18n_variable_id => var_11.id, :layout_id => layout.id, :name => 'about', :is_published => true, :parent_id => home.id )
about.page_parts.create!( :name => 'main_content', :content => "This is about" )
about.page_parts.create!( :name => 'main_content', :content => "<r:locale en='This is about' zh_tw='這是關於' />", :kind => 'text', :i18n_variable_id => var_14.id )
Link.create!( :i18n_variable_id => var_12.id, :name => 'google', :is_published => true, :parent_id => home.id, :url => 'www.google.com' )