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:
Martin Gross
2020-03-12 10:28:47 +01:00
committed by GitHub
parent 39d05a6c40
commit 34c9c40ddc
6 changed files with 66 additions and 46 deletions

View File

@@ -130,7 +130,7 @@
{% if event_logo and request.event.settings.logo_show_title and not subevent %}
<h2 class="content-header">
{{ 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>
{% endif %}
</h2>
@@ -174,44 +174,46 @@
</p>
</div>
{% endif %}
<div class="info-row">
<span class="fa fa-clock-o fa-fw"></span>
<p>
{{ ev.get_date_range_display }}
{% if event.settings.show_times %}
<br>
{% blocktrans trimmed with time=ev.date_from|date:"TIME_FORMAT" %}
Begin: {{ time }}
{% endblocktrans %}
{% if event.settings.show_date_to and ev.date_to %}
{% if ev.settings.show_dates_on_frontpage %}
<div class="info-row">
<span class="fa fa-clock-o fa-fw"></span>
<p>
{{ ev.get_date_range_display }}
{% if event.settings.show_times %}
<br>
{% blocktrans trimmed with time=ev.date_to|date:"TIME_FORMAT" %}
End: {{ time }}
{% blocktrans trimmed with time=ev.date_from|date:"TIME_FORMAT" %}
Begin: {{ time }}
{% 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 %}
{% 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 %}
{% if subevent %}
<a href="{% eventurl event "presale:event.ical.download" subevent=subevent.pk %}">
{% else %}
{% blocktrans trimmed with datetime=ev.date_admission|date:"SHORT_DATETIME_FORMAT" %}
Admission: {{ datetime }}
{% endblocktrans %}
<a href="{% eventurl event "presale:event.ical.download" %}">
{% endif %}
{% endif %}
<br>
{% if subevent %}
<a href="{% eventurl event "presale:event.ical.download" subevent=subevent.pk %}">
{% else %}
<a href="{% eventurl event "presale:event.ical.download" %}">
{% endif %}
{% trans "Add to Calendar" %}
</a>
</p>
</div>
{% trans "Add to Calendar" %}
</a>
</p>
</div>
{% endif %}
</div>

View File

@@ -66,19 +66,23 @@
<td>
<a href="{{ url }}">{{ e.name }}</a>
</td>
<td>
{{ e.daterange|default:e.get_date_range_display }}
{% if e.settings.show_times and not e.has_subevents %}
{% timezone e.tzname %}
<br><small class="text-muted">
{{ e.date_from|date:"TIME_FORMAT" }}
{% if e.settings.show_date_to and e.date_to and e.date_to.date == e.date_from.date %}
{{ e.date_to|date:"TIME_FORMAT" }}
{% endif %}
</small>
{% endtimezone %}
{% endif %}
</td>
{% if e.settings.show_dates_on_frontpage %}
<td>
{{ e.daterange|default:e.get_date_range_display }}
{% if e.settings.show_times and not e.has_subevents %}
{% timezone e.tzname %}
<br><small class="text-muted">
{{ e.date_from|date:"TIME_FORMAT" }}
{% if e.settings.show_date_to and e.date_to and e.date_to.date == e.date_from.date %}
{{ e.date_to|date:"TIME_FORMAT" }}
{% endif %}
</small>
{% endtimezone %}
{% endif %}
</td>
{% else %}
<td>&nbsp;</td>
{% endif %}
<td>
{% if e.has_subevents %}
<span class="label label-default">{% trans "Event series" %}</span>