Skip to content

Commit

Permalink
Merge pull request #2130 from tf/js-global-links
Browse files Browse the repository at this point in the history
Allow using javascript scheme for all credit box links
  • Loading branch information
tf authored Jul 19, 2024
2 parents 0640ffb + e7b1863 commit 810fb59
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions app/helpers/pageflow/entries_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,33 @@ def entry_global_links(entry)
links = []

if entry.site.imprint_link_label.present? && entry.site.imprint_link_url.present?
links << link_to(raw(entry.site.imprint_link_label),
entry.site.imprint_link_url,
target: '_blank',
tabindex: 2,
class: 'legal')
links << link_to(
raw(entry.site.imprint_link_label),
entry.site.imprint_link_url,
target: entry.site.imprint_link_url.start_with?('javascript:') ? nil : '_blank',
tabindex: 2,
class: 'legal'
)
end

if entry.site.copyright_link_label.present? && entry.site.copyright_link_url.present?
links << link_to(raw(entry.site.copyright_link_label),
entry.site.copyright_link_url,
target: '_blank',
tabindex: 2,
class: 'copy')
links << link_to(
raw(entry.site.copyright_link_label),
entry.site.copyright_link_url,
target: entry.site.copyright_link_url.start_with?('javascript:') ? nil : '_blank',
tabindex: 2,
class: 'copy'
)
end

if entry.site.privacy_link_url.present?
links << link_to(I18n.t('pageflow.public.privacy_notice'),
entry_privacy_link_url(entry),
target:
entry.site.privacy_link_url.start_with?('javascript:') ? nil : '_blank',
tabindex: 2,
class: 'privacy')
links << link_to(
I18n.t('pageflow.public.privacy_notice'),
entry_privacy_link_url(entry),
target: entry.site.privacy_link_url.start_with?('javascript:') ? nil : '_blank',
tabindex: 2,
class: 'privacy'
)
end

if links.any?
Expand Down

0 comments on commit 810fb59

Please sign in to comment.