diff --git a/app/controllers/orbit_backend_controller.rb b/app/controllers/orbit_backend_controller.rb index 339f7ede..28f99fa2 100644 --- a/app/controllers/orbit_backend_controller.rb +++ b/app/controllers/orbit_backend_controller.rb @@ -155,7 +155,7 @@ class OrbitBackendController< ApplicationController def get_viewable(object_class) - objects = get_objects(object_class) + objects = get_objects(object_class).order_by(:created_at, :desc) Kaminari.paginate_array(objects).page(params[:page]).per(10) end diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index e9de6f11..ea0264b7 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -36,7 +36,7 @@ zh_tw: submit: 送出 sure?: 您肯定嗎? update: 更新 - update: 更新失敗 + update_failed: 更新失敗 view: 檢視 view_count: 查看次數 yes_: "Yes" 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 b6566b7e..c7d46eb2 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 @@ -135,6 +135,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController else @bulletin = Bulletin.new(params[:bulletin]) + @bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate @bulletin.create_user_id = current_user.id @bulletin.update_user_id = current_user.id @@ -243,6 +244,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController else @bulletin = Bulletin.find(params[:id]) + @bulletin.deadline = nil if @bulletin.deadline < @bulletin.postdate @bulletin.update_user_id = current_user.id 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 05247251..c515dc65 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 @@ -15,7 +15,7 @@