forked from CGM_Public/pretix_original
Option to hide date-block on frontpage (#1603)
* Option to hide date-block on frontpage * Also hide date in headline
This commit is contained in:
@@ -532,6 +532,7 @@ class EventSettingsSerializer(serializers.Serializer):
|
|||||||
'checkout_email_helptext',
|
'checkout_email_helptext',
|
||||||
'presale_has_ended_text',
|
'presale_has_ended_text',
|
||||||
'voucher_explanation_text',
|
'voucher_explanation_text',
|
||||||
|
'show_dates_on_frontpage',
|
||||||
'show_date_to',
|
'show_date_to',
|
||||||
'show_times',
|
'show_times',
|
||||||
'show_items_outside_presale_period',
|
'show_items_outside_presale_period',
|
||||||
|
|||||||
@@ -668,6 +668,17 @@ DEFAULTS = {
|
|||||||
label=_("Default language"),
|
label=_("Default language"),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
'show_dates_on_frontpage': {
|
||||||
|
'default': 'True',
|
||||||
|
'type': bool,
|
||||||
|
'serializer_class': serializers.BooleanField,
|
||||||
|
'form_class': forms.BooleanField,
|
||||||
|
'form_kwargs': dict(
|
||||||
|
label=_("Show event times and dates on the ticket shop"),
|
||||||
|
help_text=_("If disabled, no date or time will be shown on the ticket shop's front page. This settings "
|
||||||
|
"does however not affect the display in other locations."),
|
||||||
|
)
|
||||||
|
},
|
||||||
'show_date_to': {
|
'show_date_to': {
|
||||||
'default': 'True',
|
'default': 'True',
|
||||||
'type': bool,
|
'type': bool,
|
||||||
|
|||||||
@@ -439,6 +439,7 @@ class EventSettingsForm(SettingsForm):
|
|||||||
'checkout_email_helptext',
|
'checkout_email_helptext',
|
||||||
'presale_has_ended_text',
|
'presale_has_ended_text',
|
||||||
'voucher_explanation_text',
|
'voucher_explanation_text',
|
||||||
|
'show_dates_on_frontpage',
|
||||||
'show_date_to',
|
'show_date_to',
|
||||||
'show_times',
|
'show_times',
|
||||||
'show_items_outside_presale_period',
|
'show_items_outside_presale_period',
|
||||||
|
|||||||
@@ -121,6 +121,7 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{% trans "Display" %}</legend>
|
<legend>{% trans "Display" %}</legend>
|
||||||
|
{% bootstrap_field sform.show_dates_on_frontpage layout="control" %}
|
||||||
{% bootstrap_field sform.show_date_to layout="control" %}
|
{% bootstrap_field sform.show_date_to layout="control" %}
|
||||||
{% bootstrap_field sform.show_times layout="control" %}
|
{% bootstrap_field sform.show_times layout="control" %}
|
||||||
{% bootstrap_field sform.show_quota_left layout="control" %}
|
{% bootstrap_field sform.show_quota_left layout="control" %}
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
{% if event_logo and request.event.settings.logo_show_title and not subevent %}
|
{% if event_logo and request.event.settings.logo_show_title and not subevent %}
|
||||||
<h2 class="content-header">
|
<h2 class="content-header">
|
||||||
{{ event.name }}
|
{{ event.name }}
|
||||||
{% if not event.has_subevents %}
|
{% if event.settings.show_dates_on_frontpage and not event.has_subevents %}
|
||||||
<small>{{ event.get_date_range_display }}</small>
|
<small>{{ event.get_date_range_display }}</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h2>
|
</h2>
|
||||||
@@ -174,44 +174,46 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="info-row">
|
{% if ev.settings.show_dates_on_frontpage %}
|
||||||
<span class="fa fa-clock-o fa-fw"></span>
|
<div class="info-row">
|
||||||
<p>
|
<span class="fa fa-clock-o fa-fw"></span>
|
||||||
{{ ev.get_date_range_display }}
|
<p>
|
||||||
{% if event.settings.show_times %}
|
{{ ev.get_date_range_display }}
|
||||||
<br>
|
{% if event.settings.show_times %}
|
||||||
{% blocktrans trimmed with time=ev.date_from|date:"TIME_FORMAT" %}
|
|
||||||
Begin: {{ time }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% if event.settings.show_date_to and ev.date_to %}
|
|
||||||
<br>
|
<br>
|
||||||
{% blocktrans trimmed with time=ev.date_to|date:"TIME_FORMAT" %}
|
{% blocktrans trimmed with time=ev.date_from|date:"TIME_FORMAT" %}
|
||||||
End: {{ time }}
|
Begin: {{ time }}
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
{% if event.settings.show_date_to and ev.date_to %}
|
||||||
|
<br>
|
||||||
|
{% blocktrans trimmed with time=ev.date_to|date:"TIME_FORMAT" %}
|
||||||
|
End: {{ time }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if ev.date_admission %}
|
||||||
|
<br>
|
||||||
|
{% if ev.date_admission|date:"SHORT_DATE_FORMAT" == ev.date_from|date:"SHORT_DATE_FORMAT" %}
|
||||||
|
{% blocktrans trimmed with time=ev.date_admission|date:"TIME_FORMAT" %}
|
||||||
|
Admission: {{ time }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% else %}
|
||||||
|
{% blocktrans trimmed with datetime=ev.date_admission|date:"SHORT_DATETIME_FORMAT" %}
|
||||||
|
Admission: {{ datetime }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% if ev.date_admission %}
|
|
||||||
<br>
|
<br>
|
||||||
{% if ev.date_admission|date:"SHORT_DATE_FORMAT" == ev.date_from|date:"SHORT_DATE_FORMAT" %}
|
{% if subevent %}
|
||||||
{% blocktrans trimmed with time=ev.date_admission|date:"TIME_FORMAT" %}
|
<a href="{% eventurl event "presale:event.ical.download" subevent=subevent.pk %}">
|
||||||
Admission: {{ time }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% blocktrans trimmed with datetime=ev.date_admission|date:"SHORT_DATETIME_FORMAT" %}
|
<a href="{% eventurl event "presale:event.ical.download" %}">
|
||||||
Admission: {{ datetime }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% trans "Add to Calendar" %}
|
||||||
<br>
|
</a>
|
||||||
{% if subevent %}
|
</p>
|
||||||
<a href="{% eventurl event "presale:event.ical.download" subevent=subevent.pk %}">
|
</div>
|
||||||
{% else %}
|
{% endif %}
|
||||||
<a href="{% eventurl event "presale:event.ical.download" %}">
|
|
||||||
{% endif %}
|
|
||||||
{% trans "Add to Calendar" %}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -66,19 +66,23 @@
|
|||||||
<td>
|
<td>
|
||||||
<a href="{{ url }}">{{ e.name }}</a>
|
<a href="{{ url }}">{{ e.name }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
{% if e.settings.show_dates_on_frontpage %}
|
||||||
{{ e.daterange|default:e.get_date_range_display }}
|
<td>
|
||||||
{% if e.settings.show_times and not e.has_subevents %}
|
{{ e.daterange|default:e.get_date_range_display }}
|
||||||
{% timezone e.tzname %}
|
{% if e.settings.show_times and not e.has_subevents %}
|
||||||
<br><small class="text-muted">
|
{% timezone e.tzname %}
|
||||||
{{ e.date_from|date:"TIME_FORMAT" }}
|
<br><small class="text-muted">
|
||||||
{% if e.settings.show_date_to and e.date_to and e.date_to.date == e.date_from.date %}
|
{{ e.date_from|date:"TIME_FORMAT" }}
|
||||||
– {{ e.date_to|date:"TIME_FORMAT" }}
|
{% if e.settings.show_date_to and e.date_to and e.date_to.date == e.date_from.date %}
|
||||||
{% endif %}
|
– {{ e.date_to|date:"TIME_FORMAT" }}
|
||||||
</small>
|
{% endif %}
|
||||||
{% endtimezone %}
|
</small>
|
||||||
{% endif %}
|
{% endtimezone %}
|
||||||
</td>
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% else %}
|
||||||
|
<td> </td>
|
||||||
|
{% endif %}
|
||||||
<td>
|
<td>
|
||||||
{% if e.has_subevents %}
|
{% if e.has_subevents %}
|
||||||
<span class="label label-default">{% trans "Event series" %}</span>
|
<span class="label label-default">{% trans "Event series" %}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user