fix external link bug
This commit is contained in:
parent
de2eb5f0af
commit
51028d1372
|
@ -4,6 +4,7 @@ require 'json'
|
||||||
|
|
||||||
module Admin::AnnouncementsHelper
|
module Admin::AnnouncementsHelper
|
||||||
def page_for_bulletin(bulletin)
|
def page_for_bulletin(bulletin)
|
||||||
|
if !bulletin.is_external_link || bulletin.external_link.blank?
|
||||||
ann_page = nil
|
ann_page = nil
|
||||||
pages = Page.where(:module=>'announcement').select{|page| page.enabled_for.include?(I18n.locale.to_s)}
|
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?
|
ann_page = pages.first if ann_page.nil?
|
||||||
request.protocol+(request.host_with_port+ann_page.url+'/'+bulletin.to_param).gsub('//','/') rescue "#"
|
request.protocol+(request.host_with_port+ann_page.url+'/'+bulletin.to_param).gsub('//','/') rescue "#"
|
||||||
|
else
|
||||||
|
bulletin.external_link
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def import_this_announcement(row,categories,tags)
|
def import_this_announcement(row,categories,tags)
|
||||||
|
|
Loading…
Reference in New Issue