added rss2_id and also translations for some field

This commit is contained in:
Harry Bomrah 2014-07-14 21:27:02 +08:00
parent 71ab680473
commit 3e2e4911f7
2 changed files with 46 additions and 18 deletions

View File

@ -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

View File

@ -53,22 +53,6 @@
</div>
</div>
<!-- award_name -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_honor.award_name") %></label>
<div class="controls">
<%= f.text_field :award_name %>
</div>
</div>
<!-- awarding_unit -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_honor.awarding_unit") %></label>
<div class="controls">
<%= f.text_field :awarding_unit %>
</div>
</div>
<!-- url -->
<div class="control-group">
<label class="control-label muted"><%= t("personal_honor.url") %></label>
@ -121,6 +105,49 @@
</div>
<!-- Language Tabs -->
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
</ul>
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- awarding_name -->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_honor.award_name") %></label>
<div class="controls">
<%= 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 %>
</div>
</div>
<!-- awarding_unit-->
<div class="control-group input-title">
<label class="control-label muted"><%= t("personal_honor.awarding_unit") %></label>
<div class="controls">
<%= 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 %>
</div>
</div>
</div>
<% end %>
</div>
</div>
<!-- Form Actions -->