mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Add meta_noindex setting on organizer level
This commit is contained in:
@@ -298,6 +298,7 @@ class OrganizerSettingsForm(SettingsForm):
|
||||
'giftcard_expiry_years',
|
||||
'locales',
|
||||
'region',
|
||||
'meta_noindex',
|
||||
'event_team_provisioning',
|
||||
'primary_color',
|
||||
'theme_color_success',
|
||||
|
||||
@@ -231,7 +231,10 @@
|
||||
{% bootstrap_field sform.display_net_prices layout="control" %}
|
||||
{% bootstrap_field sform.show_variations_expanded layout="control" %}
|
||||
{% bootstrap_field sform.hide_sold_out layout="control" %}
|
||||
{% bootstrap_field sform.meta_noindex layout="control" %}
|
||||
{% url "control:organizer.edit" organizer=request.organizer.slug as org_url %}
|
||||
{% propagated request.event org_url "meta_noindex" %}
|
||||
{% bootstrap_field sform.meta_noindex layout="control" %}
|
||||
{% endpropagated %}
|
||||
{% if sform.frontpage_subevent_ordering %}
|
||||
{% bootstrap_field sform.frontpage_subevent_ordering layout="control" %}
|
||||
{% endif %}
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
{% bootstrap_field sform.event_list_type layout="control" %}
|
||||
{% bootstrap_field sform.event_list_availability layout="control" %}
|
||||
{% bootstrap_field sform.organizer_link_back layout="control" %}
|
||||
{% bootstrap_field sform.meta_noindex layout="control" %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{% trans "Localization" %}</legend>
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user