hide reservations if there are none; clean code
This commit is contained in:
		| @@ -1,19 +1,21 @@ | ||||
| {% macro boatreservation() %} | ||||
|     <div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3" | ||||
|          style="margin-top: 10px"> | ||||
|         <h2 class="h2">Bootsreservierungen</h2> | ||||
|         <div class="p2 text-center" style="margin-bottom: 10px;"> | ||||
|             <ul style=" justify-content: space-around; padding: 0; list-style: none"> | ||||
|                 {% for reservation in reservations %} | ||||
|                     <li> | ||||
|                         {{ reservation.boat.name }} • {{ reservation.start_date }} | ||||
|                         {% if reservation.end_date != reservation.start_date %}- {{ reservation.end_date }}{% endif %} | ||||
|                         • Uhrzeit: {{ reservation.time_desc }} • Zweck: {{ reservation.usage }} | ||||
|                     </li> | ||||
|                 {% endfor %} | ||||
|             </ul> | ||||
|     {% if reservations %} | ||||
|         <div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3" | ||||
|              style="margin-top: 10px"> | ||||
|             <h2 class="h2">Bootsreservierungen</h2> | ||||
|             <div class="p2 text-center" style="margin-bottom: 10px;"> | ||||
|                 <ul style=" justify-content: space-around; padding: 0; list-style: none"> | ||||
|                     {% for reservation in reservations %} | ||||
|                         <li> | ||||
|                             {{ reservation.boat.name }} • {{ reservation.start_date }} | ||||
|                             {% if reservation.end_date != reservation.start_date %}- {{ reservation.end_date }}{% endif %} | ||||
|                             • Uhrzeit: {{ reservation.time_desc }} • Zweck: {{ reservation.usage }} | ||||
|                         </li> | ||||
|                     {% endfor %} | ||||
|                 </ul> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|     {% endif %} | ||||
| {% endmacro boatreservation %} | ||||
| {% macro header(loggedin_user) %} | ||||
|     <header class="bg-primary-900 text-white flex justify-center p-3 fixed w-full z-10"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user