Merge pull request 'hide reservations if there are none; clean code' (#330) from reservations into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m12s
CI/CD Pipeline / deploy-staging (push) Successful in 6m16s
CI/CD Pipeline / deploy-main (push) Has been skipped

Reviewed-on: #330
This commit is contained in:
philipp 2024-03-30 09:17:59 +01:00
commit 4466c9f018
3 changed files with 17 additions and 17 deletions

View File

@ -2,7 +2,6 @@ use crate::model::{boat::Boat, user::User};
use chrono::NaiveDate;
use chrono::NaiveDateTime;
use rocket::serde::{Deserialize, Serialize};
use rocket::FromForm;
use sqlx::{FromRow, SqlitePool};
use super::log::Log;

View File

@ -13,9 +13,8 @@ use tera::Context;
use crate::{
model::{
boat::Boat,
boatdamage::{BoatDamage, BoatDamageFixed, BoatDamageToAdd, BoatDamageVerified},
boatreservation::{BoatReservation, BoatReservationToAdd},
user::{AdminUser, CoxUser, DonauLinzUser, TechUser, User, UserWithRoles},
user::{DonauLinzUser, User, UserWithRoles},
},
tera::log::KioskCookie,
};

View File

@ -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 }} &bullet; {{ reservation.start_date }}
{% if reservation.end_date != reservation.start_date %}- {{ reservation.end_date }}{% endif %}
&bullet; Uhrzeit: {{ reservation.time_desc }} &bullet; 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 }} &bullet; {{ reservation.start_date }}
{% if reservation.end_date != reservation.start_date %}- {{ reservation.end_date }}{% endif %}
&bullet; Uhrzeit: {{ reservation.time_desc }} &bullet; 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">