Support i18n and select options user attributes, but admin edit is broken

This commit is contained in:
Wen-Tien Chang committed 2010-03-18 17:57:26 +08:00
1 parent bebc51e8bb
commit 554aa0a95d
4 files changed
+31 -9

No files matched your search

+6 -3
View File
@@ -6,10 +6,13 @@ namespace :dev do
User.create!( :email => 'ihower@rulingcom.com', :password => 'password', :password_confirmation => 'password', :use_attributes => ["teacher"] )
UserAttribute.create!( :key => "teacher", :name => "Teacher", :attrs => [ { :name => "Name", :key => "name", :type => "text_field" }, { :name => "Title", :key => "title", :type => 'text_field' } ] )
UserAttribute.create!( :key => "teacher", :name => "Teacher", :attrs => [
{ :name => "Name", :key => "name", :type => "text_field", :locale => false },
{ :name => "Title", :key => "title", :type => 'select', :options => [ ["Professor","1"], ["Associate Professor","2"], ["Doctor","3"] ], :locale => false } ,
{ :name_en => "Discipline", :name_zh_tw => "授課領域", :key => "discipline", :type => "text_field", :locale => true },
{ :name_en => "Category", :name_zh_tw => "類別", :key => "category", :type => 'select', :options_en => [ ["Class1","1"], ["Class2","2"] ], :options_zh_tw => [ ["類別一","1"], ["類別二","2"] ], :locale => true}
])
UserAttribute.create!( :key => "staff", :name => "Staff", :attrs => [ { :name => "Name", :key => "name", :type => "text_field" }, { :name => "Duty", :key => "duty", :type => 'text_field' } ] )
[Announcement, Item, Snippet, Layout].each { |m| m.delete_all }
Layout.create!( :name => 'root', :description => 'root', :content_zh_tw => File.open("#{RAILS_ROOT}/lib/template/root.layout.zh_tw").read,
:content_en => File.open("#{RAILS_ROOT}/lib/template/root.layout.en").read)