From 691d514fa197992403d3c186a5f56604661caf5c Mon Sep 17 00:00:00 2001 From: Wen-Tien Chang Date: Mon, 6 Jul 2009 16:36:41 +0800 Subject: [PATCH] fixes announcements i18n --- app/views/admin/announcements/_form.html.erb | 42 ++++++++++++++++++++ app/views/admin/announcements/edit.html.erb | 10 +---- app/views/admin/announcements/new.html.erb | 10 +---- app/views/admin/pages/index.html.erb | 4 +- config/environment.rb | 6 ++- 5 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 app/views/admin/announcements/_form.html.erb diff --git a/app/views/admin/announcements/_form.html.erb b/app/views/admin/announcements/_form.html.erb new file mode 100644 index 000000000..281fe8765 --- /dev/null +++ b/app/views/admin/announcements/_form.html.erb @@ -0,0 +1,42 @@ +

+<%= f.label "title_zh_tw", "Title (zh_tw)" %> +<%= f.text_field "title_zh_tw" %> +

+ +

Edit english

+ +

+<%= f.label "title_en", "Title (en)" %> +<%= f.text_field "title_en" %> +

+ +<% content_for :page_specific_javascript do %> + +<% end -%> + + +

+<%= f.label "content_zh_tw", "Content (zh_tw)" %> +<%= f.text_area "content_zh_tw", :size => '100x30' %> +

+ +

Edit english

+ +

+<%= f.label "content_en", "Content (en)" %> +<%= f.text_area "content_en", :size => '100x30' %> +

+ +<% content_for :page_specific_javascript do %> + +<% end -%> \ No newline at end of file diff --git a/app/views/admin/announcements/edit.html.erb b/app/views/admin/announcements/edit.html.erb index a5c251ffb..06dc1c2e5 100644 --- a/app/views/admin/announcements/edit.html.erb +++ b/app/views/admin/announcements/edit.html.erb @@ -3,15 +3,7 @@ <% form_for @announcement, :url => admin_announcement_path(@announcement) do |f| %> <%= f.error_messages %> -

- <%= f.label :title, "Title" %> - <%= f.text_field :title %> -

- -

- <%= f.label :content, "Content" %> - <%= f.text_area :content %> -

+ <%= render :partial => "form", :locals => { :f => f } %>

<%= f.submit 'Update' %> diff --git a/app/views/admin/announcements/new.html.erb b/app/views/admin/announcements/new.html.erb index ffeb56d9d..aec0eeded 100644 --- a/app/views/admin/announcements/new.html.erb +++ b/app/views/admin/announcements/new.html.erb @@ -3,15 +3,7 @@ <% form_for @announcement, :url => admin_announcements_path do |f| %> <%= f.error_messages %> -

- <%= f.label :title, "Title" %> - <%= f.text_field :title %> -

- -

- <%= f.label :content, "Content" %> - <%= f.text_area :content %> -

+ <%= render :partial => "form", :locals => { :f => f } %>

<%= f.submit 'Create' %> diff --git a/app/views/admin/pages/index.html.erb b/app/views/admin/pages/index.html.erb index ba38eaf05..7c635a69c 100644 --- a/app/views/admin/pages/index.html.erb +++ b/app/views/admin/pages/index.html.erb @@ -14,10 +14,12 @@ <% @pages.each do |page| %> <%= link_to page.name, admin_page_path(page) %> -