4 Commits

Author SHA1 Message Date
Philipp Hofer 79687807f2 clean /log by only showing boat reservation for the next 3 days
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
2026-04-30 11:39:54 +02:00
philipp 09defdc1f4 Merge pull request 'be able to delete nomembership user' (#1198) from delete-no-membership-user into main
CI/CD Pipeline / test (push) Failing after 34m43s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #1198
2026-03-20 08:40:13 +01:00
Philipp Hofer 1beb6ebfe9 be able to delete nomembership user
CI/CD Pipeline / test (push) Failing after 32m30s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2026-03-20 08:37:24 +01:00
philipp 55666a6eff Merge pull request 'be able to change membership status on non-membership users' (#1195) from fix-user into main
CI/CD Pipeline / test (push) Failing after 27m55s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #1195
2026-03-16 10:04:05 +01:00
6 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ use rot::rest;
use rot::tera;
use rot::{scheduled, tera::Config};
use sqlx::{ConnectOptions, pool::PoolOptions, sqlite::SqliteConnectOptions};
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, ConnectOptions};
#[macro_use]
extern crate rocket;
+4 -4
View File
@@ -95,13 +95,13 @@ WHERE end_date >= ? AND start_date <= ?
res
}
pub async fn all_future(db: &SqlitePool) -> Vec<BoatReservationWithDetails> {
pub async fn next_future(db: &SqlitePool) -> Vec<BoatReservationWithDetails> {
let boatreservations = sqlx::query_as!(
Self,
"
SELECT id, boat_id, start_date, end_date, time_desc, usage, user_id_applicant, user_id_confirmation, created_at
FROM boat_reservation
WHERE end_date >= CURRENT_DATE ORDER BY end_date
WHERE end_date >= CURRENT_DATE AND end_date <= date(CURRENT_DATE, '+3 days') ORDER BY end_date
"
)
.fetch_all(db)
@@ -158,10 +158,10 @@ WHERE end_date >= CURRENT_DATE ORDER BY end_date
grouped_reservations
}
pub async fn all_future_with_groups(
pub async fn next_future_with_groups(
db: &SqlitePool,
) -> HashMap<String, Vec<BoatReservationWithDetails>> {
let reservations = Self::all_future(db).await;
let reservations = Self::next_future(db).await;
Self::with_groups(reservations)
}
+3 -4
View File
@@ -1,11 +1,10 @@
use chrono::NaiveDate;
use rocket::{
FromForm, Route, State,
form::Form,
get, post,
request::FlashMessage,
response::{Flash, Redirect},
routes,
routes, FromForm, Route, State,
};
use rocket_dyn_templates::Template;
use sqlx::SqlitePool;
@@ -27,7 +26,7 @@ async fn index_kiosk(
flash: Option<FlashMessage<'_>>,
_kiosk: KioskCookie,
) -> Template {
let boatreservations = BoatReservation::all_future(db).await;
let boatreservations = BoatReservation::next_future(db).await;
let mut context = Context::new();
if let Some(msg) = flash {
@@ -56,7 +55,7 @@ async fn index(
flash: Option<FlashMessage<'_>>,
user: DonauLinzUser,
) -> Template {
let boatreservations = BoatReservation::all_future(db).await;
let boatreservations = BoatReservation::next_future(db).await;
let mut context = Context::new();
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(
"reservations",
&BoatReservation::all_future_with_groups(db).await,
&BoatReservation::next_future_with_groups(db).await,
);
context.insert("coxes", &coxes);
context.insert("users", &users);
+11
View File
@@ -230,6 +230,17 @@
</a>
</div>
{% 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 %}
{% if "Scheckbuch" in member or "Schnupperant" in member or "NoMembership" in member %}
{% if allowed_to_edit %}
+1 -1
View File
@@ -40,7 +40,7 @@ function setChoiceByLabel(choicesInstance, label) {
{% endmacro plannedtrips %}
{% macro boatreservation() %}
<div class="bg-white dark:bg-primary-900 rounded-md shadow pb-2 mt-3">
<h2 class="h2">Reservierungen ({{ reservations | length }})</h2>
<h2 class="h2">Reservierungen<br /><small>in den nächsten 3 Tagen</small></h2>
<div class="grid grid-cols-1 gap-3 mb-3 w-full">
{% for _, reservations_for_event in reservations %}
{% set reservation = reservations_for_event[0] %}