8 Commits

Author SHA1 Message Date
philipp de357c3db3 Merge pull request 'fix-user' (#1193) from fix-user into staging
CI/CD Pipeline / test (push) Failing after 29m32s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Update Cargo Dependencies / update-dependencies (push) Successful in 2m14s
Reviewed-on: #1193
2026-03-16 10:00:56 +01:00
philipp b2157a31c5 Merge pull request 'user merging should only be done by admins' (#1182) from user-upd into staging
CI/CD Pipeline / test (push) Successful in 17m44s
CI/CD Pipeline / deploy-staging (push) Successful in 7m57s
CI/CD Pipeline / deploy-main (push) Has been skipped
Update Cargo Dependencies / update-dependencies (push) Successful in 1m43s
Reviewed-on: #1182
2026-01-08 20:23:08 +01:00
philipp bfb3ae4b6e Merge pull request 'user-upd' (#1180) from user-upd into staging
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
Reviewed-on: #1180
2026-01-08 20:15:41 +01:00
philipp 88a3e5f2d0 Merge pull request 'Merge pull request 'force an action on important notifications' (#1177) from force-action-on-important-notifications into main' (#1178) from new-sort-option into staging
CI/CD Pipeline / test (push) Successful in 17m44s
CI/CD Pipeline / deploy-staging (push) Successful in 7m49s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #1178
2026-01-05 13:09:12 +01:00
philipp 32c250536d Merge pull request 'force-action-on-important-notifications' (#1176) from force-action-on-important-notifications into staging
CI/CD Pipeline / test (push) Successful in 17m51s
CI/CD Pipeline / deploy-staging (push) Successful in 7m56s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #1176
2026-01-03 22:11:55 +01:00
philipp b9d0e2a2dc Merge pull request 'show-full-stats' (#1172) from show-full-stats into staging
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
Reviewed-on: #1172
2026-01-03 21:49:14 +01:00
philipp b597898bdf Merge pull request 'manual-deploy' (#1174) from manual-deploy into staging
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
Reviewed-on: #1174
2026-01-03 21:43:02 +01:00
philipp e90555214a Merge pull request 'No need to pay for deleted boats' (#1169) from handle-deleted-boats into staging
CI/CD Pipeline / test (push) Successful in 19m20s
CI/CD Pipeline / deploy-staging (push) Successful in 26m29s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #1169
2026-01-03 14:04:39 +01:00
6 changed files with 11 additions and 21 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ use rot::rest;
use rot::tera; use rot::tera;
use rot::{scheduled, tera::Config}; use rot::{scheduled, tera::Config};
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions}; use sqlx::{ConnectOptions, pool::PoolOptions, sqlite::SqliteConnectOptions};
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
+4 -4
View File
@@ -95,13 +95,13 @@ WHERE end_date >= ? AND start_date <= ?
res res
} }
pub async fn next_future(db: &SqlitePool) -> Vec<BoatReservationWithDetails> { pub async fn all_future(db: &SqlitePool) -> Vec<BoatReservationWithDetails> {
let boatreservations = sqlx::query_as!( let boatreservations = sqlx::query_as!(
Self, Self,
" "
SELECT id, boat_id, start_date, end_date, time_desc, usage, user_id_applicant, user_id_confirmation, created_at SELECT id, boat_id, start_date, end_date, time_desc, usage, user_id_applicant, user_id_confirmation, created_at
FROM boat_reservation FROM boat_reservation
WHERE end_date >= CURRENT_DATE AND end_date <= date(CURRENT_DATE, '+3 days') ORDER BY end_date WHERE end_date >= CURRENT_DATE ORDER BY end_date
" "
) )
.fetch_all(db) .fetch_all(db)
@@ -158,10 +158,10 @@ WHERE end_date >= CURRENT_DATE AND end_date <= date(CURRENT_DATE, '+3 days') ORD
grouped_reservations grouped_reservations
} }
pub async fn next_future_with_groups( pub async fn all_future_with_groups(
db: &SqlitePool, db: &SqlitePool,
) -> HashMap<String, Vec<BoatReservationWithDetails>> { ) -> HashMap<String, Vec<BoatReservationWithDetails>> {
let reservations = Self::next_future(db).await; let reservations = Self::all_future(db).await;
Self::with_groups(reservations) Self::with_groups(reservations)
} }
+4 -3
View File
@@ -1,10 +1,11 @@
use chrono::NaiveDate; use chrono::NaiveDate;
use rocket::{ use rocket::{
FromForm, Route, State,
form::Form, form::Form,
get, post, get, post,
request::FlashMessage, request::FlashMessage,
response::{Flash, Redirect}, response::{Flash, Redirect},
routes, FromForm, Route, State, routes,
}; };
use rocket_dyn_templates::Template; use rocket_dyn_templates::Template;
use sqlx::SqlitePool; use sqlx::SqlitePool;
@@ -26,7 +27,7 @@ async fn index_kiosk(
flash: Option<FlashMessage<'_>>, flash: Option<FlashMessage<'_>>,
_kiosk: KioskCookie, _kiosk: KioskCookie,
) -> Template { ) -> Template {
let boatreservations = BoatReservation::next_future(db).await; let boatreservations = BoatReservation::all_future(db).await;
let mut context = Context::new(); let mut context = Context::new();
if let Some(msg) = flash { if let Some(msg) = flash {
@@ -55,7 +56,7 @@ async fn index(
flash: Option<FlashMessage<'_>>, flash: Option<FlashMessage<'_>>,
user: DonauLinzUser, user: DonauLinzUser,
) -> Template { ) -> Template {
let boatreservations = BoatReservation::next_future(db).await; let boatreservations = BoatReservation::all_future(db).await;
let mut context = Context::new(); let mut context = Context::new();
if let Some(msg) = flash { if let Some(msg) = flash {
+1 -1
View File
@@ -114,7 +114,7 @@ async fn index(db: &SqlitePool, flash: Option<FlashMessage<'_>>, mut context: Co
context.insert("planned_trips", &Trip::get_for_today(db).await); context.insert("planned_trips", &Trip::get_for_today(db).await);
context.insert( context.insert(
"reservations", "reservations",
&BoatReservation::next_future_with_groups(db).await, &BoatReservation::all_future_with_groups(db).await,
); );
context.insert("coxes", &coxes); context.insert("coxes", &coxes);
context.insert("users", &users); context.insert("users", &users);
-11
View File
@@ -230,17 +230,6 @@
</a> </a>
</div> </div>
{% endif %} {% endif %}
{% elif "NoMembership" in member %}
{% if allowed_to_edit %}
<div class="grid pt-3">
<a href="/admin/user/{{ user.id }}/delete"
class="btn btn-alert"
onclick="return confirm('Willst du die Daten von {{ user.name }} wirklich löschen?');">
{% include "includes/delete-icon" %}
Daten löschen
</a>
</div>
{% endif %}
{% endif %} {% endif %}
{% if "Scheckbuch" in member or "Schnupperant" in member or "NoMembership" in member %} {% if "Scheckbuch" in member or "Schnupperant" in member or "NoMembership" in member %}
{% if allowed_to_edit %} {% if allowed_to_edit %}
+1 -1
View File
@@ -40,7 +40,7 @@ function setChoiceByLabel(choicesInstance, label) {
{% endmacro plannedtrips %} {% endmacro plannedtrips %}
{% macro boatreservation() %} {% macro boatreservation() %}
<div class="bg-white dark:bg-primary-900 rounded-md shadow pb-2 mt-3"> <div class="bg-white dark:bg-primary-900 rounded-md shadow pb-2 mt-3">
<h2 class="h2">Reservierungen<br /><small>in den nächsten 3 Tagen</small></h2> <h2 class="h2">Reservierungen ({{ reservations | length }})</h2>
<div class="grid grid-cols-1 gap-3 mb-3 w-full"> <div class="grid grid-cols-1 gap-3 mb-3 w-full">
{% for _, reservations_for_event in reservations %} {% for _, reservations_for_event in reservations %}
{% set reservation = reservations_for_event[0] %} {% set reservation = reservations_for_event[0] %}