From 4d634ce3138f3abbeb8b4828b20402869a2acc65 Mon Sep 17 00:00:00 2001 From: philipp Date: Sat, 16 Mar 2024 10:56:37 +0100 Subject: [PATCH 1/2] spacing again --- templates/planned.html.tera | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/planned.html.tera b/templates/planned.html.tera index 521ec8c..d39f4d2 100644 --- a/templates/planned.html.tera +++ b/templates/planned.html.tera @@ -109,9 +109,9 @@ Uhr ({{ planned_event.name }} - {% if planned_event.trip_type %} + {%- if planned_event.trip_type %} - {{ planned_event.trip_type.icon | safe }} {{ planned_event.trip_type.name }} - {% endif %} + {%- endif -%} )
Result<(), LogbookDeleteError> { Log::create(db, format!("{user:?} deleted trip: {self:?}")).await; - if user.has_role(db, "admin").await || user.id == self.shipmaster { + if user.has_role(db, "admin").await + || user.has_role(db, "Vorstand").await + || user.id == self.shipmaster + { sqlx::query!("DELETE FROM logbook WHERE id=?", self.id) .execute(db) .await diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index dda33c0..f8f0145 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -137,9 +137,11 @@ {{ rower.name }} {% if rower.id == log.shipmaster or rower.id == log.steering_person %} ( - {%- if rower.id == log.shipmaster %}Schiffsführer{% endif -%} - {% if rower.id == log.shipmaster and rower.id == log.steering_person %} / {% endif %} - {%- if rower.id == log.steering_person %}Steuerperson{% endif -%} + {%- if rower.id == log.shipmaster %}Schiffsführer + {% endif -%} + {% if rower.id == log.shipmaster and rower.id == log.steering_person %}/{% endif %} + {%- if rower.id == log.steering_person %}Steuerperson + {% endif -%} ) {% endif %}

diff --git a/templates/log.html.tera b/templates/log.html.tera index b37f3e5..d6e2144 100644 --- a/templates/log.html.tera +++ b/templates/log.html.tera @@ -19,6 +19,8 @@ {% for log in on_water %} {% if log.shipmaster == loggedin_user.id %} {{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones="cox" not in loggedin_user.roles) }} + {% elif "Vorstand" in loggedin_user.roles %} + {{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones="cox" not in loggedin_user.roles) }} {% else %} {{ log::show(log=log, state="on_water", only_ones=true) }} {% endif %} -- 2.45.2