Add meta_noindex setting on organizer level

This commit is contained in:
Raphael Michel
2021-06-25 11:26:04 +02:00
parent a856a3ef6f
commit 618b67ca2f
6 changed files with 17 additions and 1 deletions

View File

@@ -7,6 +7,13 @@
{% block thetitle %}
{% block title %}{% endblock %}{% if url_name != "organizer.index" %} :: {% endif %}{{ organizer.name }}
{% endblock %}
{% block custom_header %}
{% if organizer.settings.meta_noindex %}
<meta name="robots" content="noindex, nofollow">
{% endif %}
<meta property="og:type" content="website" />
{{ block.super }}
{% endblock %}
{% block above %}
{% if organizer.settings.locales|length > 1 or request.organizer.settings.customer_accounts %}
{% if organizer.settings.theme_color_background|upper != "#FFFFFF" or organizer.settings.organizer_logo_image_large %}

View File

@@ -635,6 +635,8 @@ class EventIcalDownload(EventViewMixin, View):
resp['Content-Disposition'] = 'attachment; filename="{}-{}-{}.ics"'.format(
event.organizer.slug, event.slug, subevent.pk if subevent else '0',
)
if event.settings.meta_noindex:
resp['X-Robots-Tag'] = 'noindex'
return resp

View File

@@ -765,4 +765,6 @@ class OrganizerIcalDownload(OrganizerViewMixin, View):
resp['Content-Disposition'] = 'attachment; filename="{}.ics"'.format(
request.organizer.slug
)
if request.organizer.settings.meta_noindex:
resp['X-Robots-Tag'] = 'noindex'
return resp