From d247f05d2e238650872865ffc6165710236d52c9 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 24 Apr 2012 15:27:46 +0800 Subject: [PATCH] Add missing translations in announcement and change announcement behavior for passed and rejected --- .../back_end/bulletins_controller.rb | 2 +- .../back_end/bulletins/_bulletin.html.erb | 36 +++++++++---------- .../back_end/bulletins/_form.html.erb | 6 ++-- .../bulletins/_form_bulletin_file.html.erb | 1 + .../announcement/config/locales/en.yml | 14 ++++++++ .../announcement/config/locales/zh_tw.yml | 12 +++---- 6 files changed, 43 insertions(+), 28 deletions(-) diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index 030c11bf..f77e70b7 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -89,7 +89,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # GET /bulletins/1/edit def edit @bulletin = Bulletin.find(params[:id]) - if @bulletin.is_rejected? + if !current_user.admin? && (@bulletin.is_rejected? || @bulletin.is_checked?) redirect_to :action => :index else # @summary_variable = @bulletin.summary_variable diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb index 7db70593..c4e134cc 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb @@ -14,7 +14,7 @@ <%= t(:pending) %> <% end %> <% if bulletin.is_checked? %> - <%= t(:checked) %> + <%= t(:passed) %> <% end %> <% if bulletin.is_rejected? %> <%= t(:rejected) %> @@ -25,23 +25,23 @@ <%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index d9c62078..a8fb3587 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -98,7 +98,7 @@ <% end %> <% end %>
- + <% if params[:action] != 'new' %>
@@ -208,7 +208,7 @@ @@ -253,7 +253,7 @@
<%= hidden_field_tag 'bulletin_file_field_count', @bulletin.bulletin_files.count %> - ADD/新增 + <%= t(:add) %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb index ea977467..d391c80c 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb @@ -4,6 +4,7 @@
<%= f.file_field :file %> + <%= form_bulletin_file.file.file ? ( link_to t(:view), form_bulletin_file.file.url, {:target => '_blank', :title => t(:view)} ) : '' %>
diff --git a/vendor/built_in_modules/announcement/config/locales/en.yml b/vendor/built_in_modules/announcement/config/locales/en.yml index 2af39968..0d861af2 100644 --- a/vendor/built_in_modules/announcement/config/locales/en.yml +++ b/vendor/built_in_modules/announcement/config/locales/en.yml @@ -5,6 +5,12 @@ en: _locale: English + basic: Basic + picture: Piture + tags: Tag + link: Link + file: File + add: Add back: Back create: Create @@ -22,6 +28,14 @@ en: sure?: Are you sure? update: Update yes_: "Yes" + + hot: Hot + top: Top + hidden: Hidden + passed: Passed + pending: Pending + rejected: Rejected + clear: Clear announcement: sure?: Sure? diff --git a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml index 23ae38b8..1d354f82 100644 --- a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml @@ -24,12 +24,12 @@ zh_tw: update: 更新 yes_: "Yes" - is_hot: 熱門 - is_top: 置頂 - is_hidden: 隱藏 - is_checked: 通過 - is_pending: 待審核 - is_rejected: 不通過 + hot: 熱門 + top: 置頂 + hidden: 隱藏 + passed: 通過 + pending: 待審核 + rejected: 不通過 clear: 清除 quick_edit: 快速編輯