added description for images in announcement

This commit is contained in:
Harry Bomrah 2014-10-14 14:28:51 +08:00
parent a5b21637a3
commit fce7ca7a13
3 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@ class AnnouncementsController < ApplicationController
"postdate" => a.postdate, "postdate" => a.postdate,
"link_to_show" => OrbitHelper.url_to_show(a.to_param), "link_to_show" => OrbitHelper.url_to_show(a.to_param),
"img_src" => a.image.thumb.url || "http://placehold.it/100x100", "img_src" => a.image.thumb.url || "http://placehold.it/100x100",
"img_description" => a.image_description,
"more" => t(:more_plus) "more" => t(:more_plus)
} }
end end
@ -54,6 +55,7 @@ class AnnouncementsController < ApplicationController
"postdate" => a.postdate, "postdate" => a.postdate,
"link_to_show" => OrbitHelper.widget_item_url(a.to_param), "link_to_show" => OrbitHelper.widget_item_url(a.to_param),
"img_src" => a.image.thumb.url || "http://placehold.it/100x100", "img_src" => a.image.thumb.url || "http://placehold.it/100x100",
"img_description" => a.image_description
} }
end end
{ {

View File

@ -26,6 +26,7 @@ class Bulletin
field :email_sentdate , :type => DateTime field :email_sentdate , :type => DateTime
field :email_member_ids field :email_member_ids
field :other_mailaddress field :other_mailaddress
field :image_description, localize: true
mount_uploader :image, ImageUploader mount_uploader :image, ImageUploader

View File

@ -115,9 +115,20 @@
</div> </div>
</div> </div>
</div> </div>
<% @site_in_use_locales.each do |locale| %>
<%= f.fields_for :image_description_translations do |f| %>
<div class="control-group">
<label class="control-label muted" for="image_description_<%= locale.to_s %>"><%= t(:description) + " (#{t(locale.to_s)})" %></label>
<div class="controls">
<%= f.text_field locale, value: (@bulletin.image_description_translations[locale.to_s] rescue nil) %>
</div>
</div>
<% end %>
<% end %>
</div> </div>
<!-- Mail Group Module --> <!-- Mail Group Module -->
<div class="tab-pane fade" id="mail-group"> <div class="tab-pane fade" id="mail-group">