fix external link bug

This commit is contained in:
chiu 2021-09-16 00:12:26 +08:00
parent de2eb5f0af
commit 51028d1372
1 changed files with 22 additions and 18 deletions

View File

@ -4,6 +4,7 @@ require 'json'
module Admin::AnnouncementsHelper
def page_for_bulletin(bulletin)
if !bulletin.is_external_link || bulletin.external_link.blank?
ann_page = nil
pages = Page.where(:module=>'announcement').select{|page| page.enabled_for.include?(I18n.locale.to_s)}
@ -27,6 +28,9 @@ module Admin::AnnouncementsHelper
ann_page = pages.first if ann_page.nil?
request.protocol+(request.host_with_port+ann_page.url+'/'+bulletin.to_param).gsub('//','/') rescue "#"
else
bulletin.external_link
end
end
def import_this_announcement(row,categories,tags)