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" %> +
+ + + ++<%= 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' %> +
+ + + ++<%= 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| %>