diff --git a/app/models/honor.rb b/app/models/honor.rb index bfa77f9..6f39ad1 100644 --- a/app/models/honor.rb +++ b/app/models/honor.rb @@ -8,12 +8,13 @@ class Honor belongs_to :member_profile field :year - field :award_name - field :awarding_unit + field :award_name, localize: true + field :awarding_unit, localize: true field :language field :keywords field :url field :note + field :rss2_id field :create_user_id, :type => BSON::ObjectId field :update_user_id, :type => BSON::ObjectId diff --git a/app/views/admin/honors/_form.html.erb b/app/views/admin/honors/_form.html.erb index a1c1af6..1450ba0 100644 --- a/app/views/admin/honors/_form.html.erb +++ b/app/views/admin/honors/_form.html.erb @@ -53,22 +53,6 @@ - -
- -
- <%= f.text_field :award_name %> -
-
- - -
- -
- <%= f.text_field :awarding_unit %> -
-
-
@@ -121,6 +105,49 @@
+ + + + + +
+ + <% @site_in_use_locales.each_with_index do |locale, i| %> + +
"> + + +
+ +
+ <%= f.fields_for :award_name_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_honor.award_name"), value: (@honor.award_name_translations[locale] rescue nil) %> + <% end %> +
+
+ + +
+ +
+ <%= f.fields_for :awarding_unit_translations do |f| %> + <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_honor.awarding_unit"), value: (@honor.awarding_unit_translations[locale] rescue nil) %> + <% end %> +
+
+ +
+ + <% end %> + +
+