remove event container remnant if there are no events

This commit is contained in:
Yannik Schmidt
2020-07-27 11:57:59 +02:00
parent 1015370853
commit c5238c3200
2 changed files with 46 additions and 45 deletions

View File

@@ -1,46 +1,50 @@
{% if events %} {% if events %}
<div class="col grid-margin-md stretch-card d-flex_" style="font-size: x-large;"> <div class="bg-secondary">
<div class="card bg-transparent border-0"> <div class="container container-responsive pb-2 pt-2">
<div class="card-body"> <div class="col grid-margin-md stretch-card d-flex_" style="font-size: x-large;">
<div class="d-flex justify-content-between"></div> <div class="card bg-transparent border-0">
{% for event in events %} <div class="card-body">
<div class="moreDates" {% if loop.index > 3 %} style="display: none;" {% endif %}> <div class="d-flex justify-content-between"></div>
<div class="row"> {% for event in events %}
<div class="event-responsive pt-1 border-bottom <div class="moreDates" {% if loop.index > 3 %} style="display: none;" {% endif %}>
{% if loop.index == 1 %} border-top {% endif %} col"> <div class="row">
<div class="d-flex justify-content-center align-items-center"> <div class="event-responsive pt-1 border-bottom
<h1 class="mr-5 font-weight-bold text-color-special date-responsive "> {% if loop.index == 1 %} border-top {% endif %} col">
{{ event["day"] }} <div class="d-flex justify-content-center align-items-center">
</h1> <h1 class="mr-5 font-weight-bold text-color-special date-responsive ">
<div> {{ event["day"] }}
<p class="font-weight-bold mb-0 text-dark">{{ event["month"] }}</p> </h1>
<p class="mb-2">{{ event["year"] }}</p> <div>
<p class="font-weight-bold mb-0 text-dark">{{ event["month"] }}</p>
<p class="mb-2">{{ event["year"] }}</p>
</div>
</div>
</div>
<div class="pt-1 border-bottom {% if loop.index == 1 %} border-top {% endif %} col pl-3">
<p class="event-responsive text-dark font-weight-bold mb-0">
{{ event["description"] }}
{% if event.get("location") %} @{{ event["location"] }} {% endif %}
</p>
<p class="mb-0">{{ event["time"] }}</p>
</div> </div>
</div> </div>
</div> </div>
<div class="pt-1 border-bottom {% if loop.index == 1 %} border-top {% endif %} col pl-3"> {% endfor %}
<p class="event-responsive text-dark font-weight-bold mb-0"> {% if moreEvents %}
{{ event["description"] }} <button id="moreDatesButton" class="float-right mt-3 btn btn-light" onClick=showAdditionalDates()>Mehr..</button>
{% if event.get("location") %} @{{ event["location"] }} {% endif %} {% endif %}
</p> </div>
<p class="mb-0">{{ event["time"] }}</p> </div>
</div>
</div>
</div> </div>
{% endfor %} <!-- mehr Termine Button -->
{% if moreEvents %} <script>
<button id="moreDatesButton" class="float-right mt-3 btn btn-light" onClick=showAdditionalDates()>Mehr..</button> function showAdditionalDates(){
{% endif %} Array.from(document.getElementsByClassName("moreDates")).forEach(element => {
</div> element.style.display = "";
</div> });
document.getElementById("moreDatesButton").style.display = "none"
}
</script>
</div>
</div> </div>
<!-- mehr Termine Button -->
<script>
function showAdditionalDates(){
Array.from(document.getElementsByClassName("moreDates")).forEach(element => {
element.style.display = "";
});
document.getElementById("moreDatesButton").style.display = "none"
}
</script>
{% endif %} {% endif %}

View File

@@ -30,11 +30,8 @@
</div> </div>
</header> </header>
<div class="bg-secondary"> <!-- events -->
<div class="container container-responsive pb-2 pt-2"> {% include 'events.html' %}
{% include 'events.html' %}
</div>
</div>
<!-- picture links --> <!-- picture links -->
{% if mainLinks %} {% if mainLinks %}