Add reminder

This commit is contained in:
rulingcom 2026-09-10 15:32:07 +08:00
parent 82ef0448d4
commit cb926ac78f
4 changed files with 14 additions and 3 deletions

View File

@ -617,7 +617,12 @@ class Admin::AnnouncementsController < OrbitAdminController
bulletin.is_preview = true bulletin.is_preview = true
bulletin.save bulletin.save
#BulletinFeed.create_feed_cache(bulletin) #BulletinFeed.create_feed_cache(bulletin)
render :plain=>page_for_bulletin(bulletin) + "?preview=true" preview_url = page_for_bulletin(bulletin)
if preview_url == "#"
render :json => { "error" => true, "message" => t("announcement.no_announcement_page") }
else
render :plain=>preview_url + "?preview=true"
end
end end
def get_preview_action def get_preview_action
bulletin = Bulletin.find_by(:uid=>params['uid']) bulletin = Bulletin.find_by(:uid=>params['uid'])

View File

@ -894,6 +894,10 @@
processData: false, processData: false,
contentType: false contentType: false
}).done(function(data){ }).done(function(data){
if(typeof data === "object" && data.error){
alert(data.message);
return;
}
if(window.location.protocol === "https:"){ if(window.location.protocol === "https:"){
data = data.replace("http:","https:"); data = data.replace("http:","https:");
} }

View File

@ -3,6 +3,7 @@ en:
feed: Feed feed: Feed
import: Import import: Import
announcement: announcement:
no_announcement_page: "No announcement page has been set. Please set one first."
read_from_cache: "Read from cache!" read_from_cache: "Read from cache!"
delete_selected: "Delete Selected" delete_selected: "Delete Selected"
expired: This announcement has been expired. expired: This announcement has been expired.
@ -207,4 +208,4 @@ en:
'11': 'November' '11': 'November'
'12': 'December' '12': 'December'
calendar_title: "%{month} %{year}" calendar_title: "%{month} %{year}"

View File

@ -4,6 +4,7 @@ zh_tw:
import: 匯入 import: 匯入
get_all_anncs_without_subannc: "選擇相關公告" get_all_anncs_without_subannc: "選擇相關公告"
announcement: announcement:
no_announcement_page: "沒有任何公告頁面,請先設定一個"
read_from_cache: "從暫存中讀取!" read_from_cache: "從暫存中讀取!"
delete_selected: "刪除所選" delete_selected: "刪除所選"
expired: 此則公告已過期 expired: 此則公告已過期
@ -196,4 +197,4 @@ zh_tw:
top: 置頂 top: 置頂
hot: 熱門 hot: 熱門
hidden: 隱藏 hidden: 隱藏
calendar_title: "%{year}年%{month}月" calendar_title: "%{year}年%{month}月"