diff --git a/app/views/root/related.raw.html.erb b/app/views/root/related.raw.html.erb index 41e76551c..6f1984160 100644 --- a/app/views/root/related.raw.html.erb +++ b/app/views/root/related.raw.html.erb @@ -1,10 +1,34 @@ <%# Whilst they are both in use, this and the test copy in slimmer should be kept in sync %> -<% if artefact and (artefact.related_artefacts.any? or (artefact.related_external_links and artefact.related_external_links.any?)) %> + +<% + promo_target_formats = ['completed_transaction', 'transaction'] + promo_excluded_regex = /register-to-vote/ + + has_promo_callout = (artefact and promo_target_formats.include?(artefact.format) and not promo_excluded_regex.match(URI.decode(artefact.slug))) +%> +<%# Whilst they are both in use, this and the test copy in slimmer should be kept in sync %> +<% if artefact and (artefact.related_artefacts.any? or (artefact.related_external_links and artefact.related_external_links.any?) or has_promo_callout) %>