diff --git a/app/controllers/admin/news_controller.rb b/app/controllers/admin/news_controller.rb index 533b33a..c5ca3fc 100644 --- a/app/controllers/admin/news_controller.rb +++ b/app/controllers/admin/news_controller.rb @@ -74,8 +74,10 @@ class Admin::NewsController < OrbitAdminController if params["approved"] == "true" news_bulletin.approved = true news_bulletin.rejected = false + news_bulletin.reapproval = false else news_bulletin.rejected = true + news_bulletin.reapproval = false news_bulletin.rejection_reason = params["reason"] end news_bulletin.save @@ -110,6 +112,7 @@ class Admin::NewsController < OrbitAdminController end news_bulletin.update_attributes(news_bulletin_params) + news_bulletin.reapproval = true if news_bulletin.rejected news_bulletin.save build_email(news_bulletin) redirect_to params['referer_url'] diff --git a/app/models/news_bulletin.rb b/app/models/news_bulletin.rb index 2c55a2a..f98f27d 100644 --- a/app/models/news_bulletin.rb +++ b/app/models/news_bulletin.rb @@ -22,6 +22,7 @@ class NewsBulletin field :rss2_sn field :approved, :type => Boolean, :default => false field :rejected, :type => Boolean, :default => false + field :reapproval, :type => Boolean, :default => false field :rejection_reason field :is_preview, :type => Boolean, :default => false field :image_description, localize: true diff --git a/app/views/admin/news/_index.html.erb b/app/views/admin/news/_index.html.erb index 174f2ba..ade17be 100644 --- a/app/views/admin/news/_index.html.erb +++ b/app/views/admin/news/_index.html.erb @@ -34,6 +34,14 @@ <%= b.title_translations["en"] %> <%= t(:expired) %> <% end %> <% end %> + <% elsif b.rejected && b.reapproval %> + <% url = page_for_bulletin(b) %> + <% if !b.title_translations["zh_tw"].blank? %> + <%= b.title_translations["zh_tw"] %> <%= t("news.reapproval") %> : <%= t(:pending) %>
+ <% end %> + <% if !b.title_translations["en"].blank? %> + <%= b.title_translations["en"] %> <%= t("news.reapproval") %> : <%= t(:pending) %> + <% end %> <% elsif b.rejected %> <% url = page_for_bulletin(b) %> <% if !b.title_translations["zh_tw"].blank? %> @@ -67,7 +75,7 @@
  • <%= t(:edit) %>
  • <%= t(:delete_) %>
  • <% elsif is_user_sub_manager? %> - <% if !b.rejected && !b.approved %> + <% if b.rejected && !b.approved %>
  • <%= t(:edit) %>
  • <% end %>
  • <%= t(:delete_) %>
  • @@ -79,7 +87,7 @@ <% end %> - <% if !b.rejected && !b.approved && user_can_approve? && !b.expired? %> + <% if b.rejected && !b.approved && user_can_approve? && !b.expired? %>
  • " data-id="<%= b.id.to_s %>"><%= t("news.approve") %>
  • <% end %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 8b3ac97..38b174a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -15,6 +15,7 @@ en: category: Category add_new: Add New approve: Approve + reapproval: Re-approval all_articles: All Articles news: News approval_setting: Approval Setting diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 9f99e26..c63d715 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -32,6 +32,7 @@ zh_tw: all: 全部類別 news: 新聞 approve: 審核 + reapproval: 重新審核 admins: 單位設定 append_note: 以下之附加連結與檔案,為使前台顯示名稱,建議您輸入註解。 approval_setting: 審核設定