From 64b80092f6dcc41f70f9bc3462475d18576b40dd Mon Sep 17 00:00:00 2001 From: spen Date: Tue, 13 May 2014 16:29:23 +0800 Subject: [PATCH] ydu --- .../panel/announcement/front_end/bulletins/show.html.erb | 7 +++++-- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + lib/announcement.rb | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/panel/announcement/front_end/bulletins/show.html.erb b/app/views/panel/announcement/front_end/bulletins/show.html.erb index b6d6df2..ca11e10 100644 --- a/app/views/panel/announcement/front_end/bulletins/show.html.erb +++ b/app/views/panel/announcement/front_end/bulletins/show.html.erb @@ -4,8 +4,11 @@
<%= dislpay_view_count(@bulletin) %> <%= display_date_time(@bulletin.postdate) %> - <% unit = @bulletin.cache_dept[I18n.locale.to_s] rescue nil %> - <%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %> + <% + unit_field = User.get_member_list_attribute_field("staff","unit") + unit = User.get_member_list_attribute_value(@bulletin.create_user_id,unit_field.id).get_value_by_locale(I18n.locale) rescue nil + %> + <%= t('announcement.default_widget.bulletin_create_dept') + ": " + unit unless unit.blank? %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 5f0bb5e..060de27 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -18,6 +18,7 @@ en: postdate: Post Date subtitle: Subtitle title: Title + bulletin_create_dept: Unit editing_announcement: Edit Announcement editing_announcement_category: Edit Category file: Attachment diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 6e7509e..65d4044 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -18,6 +18,7 @@ zh_tw: postdate: 張貼日期 subtitle: 副標題 title: 標題 + bulletin_create_dept: 單位 editing_announcement: 編輯類別 editing_announcement_category: 編輯類別 error: diff --git a/lib/announcement.rb b/lib/announcement.rb index cabf028..f517bb4 100644 --- a/lib/announcement.rb +++ b/lib/announcement.rb @@ -41,6 +41,7 @@ module Announcement link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self} link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}} field :subtitle + field :bulletin_create_dept link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus' end