Merge branch 'staging' into 'main'

Staging

See merge request PhilippHofer/rot!41
This commit is contained in:
PhilippHofer 2023-10-24 07:38:32 +00:00
commit c0fd047cd4
4 changed files with 616 additions and 607 deletions

View File

@ -27,6 +27,7 @@ INNER JOIN (
FROM logbook l FROM logbook l
WHERE l.distance_in_km IS NOT NULL WHERE l.distance_in_km IS NOT NULL
) sub ON u.id = sub.user_id ) sub ON u.id = sub.user_id
WHERE u.is_guest = false
GROUP BY u.name GROUP BY u.name
ORDER BY rowed_km DESC; ORDER BY rowed_km DESC;
", ",

View File

@ -71,6 +71,7 @@ async fn create<'r>(
data: Form<FormBoatDamageToAdd<'r>>, data: Form<FormBoatDamageToAdd<'r>>,
coxuser: CoxUser, coxuser: CoxUser,
) -> Flash<Redirect> { ) -> Flash<Redirect> {
return Flash::error(Redirect::to("/log"), "Du musst noch kurz geduldig sein. Sobald wir unser Logbuch umgestellt haben, kannst du es hier im Ruderassistenten verwenden ;)");
let boatdamage_to_add = BoatDamageToAdd { let boatdamage_to_add = BoatDamageToAdd {
boat_id: data.boat_id, boat_id: data.boat_id,
desc: data.desc, desc: data.desc,
@ -100,6 +101,7 @@ async fn create_from_kiosk<'r>(
data: Form<FormBoatDamageToAddKiosk<'r>>, data: Form<FormBoatDamageToAddKiosk<'r>>,
_kiosk: KioskCookie, _kiosk: KioskCookie,
) -> Flash<Redirect> { ) -> Flash<Redirect> {
return Flash::error(Redirect::to("/log"), "Du musst noch kurz geduldig sein. Sobald wir unser Logbuch umgestellt haben, kannst du es hier im Ruderassistenten verwenden ;)");
let boatdamage_to_add = BoatDamageToAdd { let boatdamage_to_add = BoatDamageToAdd {
boat_id: data.boat_id, boat_id: data.boat_id,
desc: data.desc, desc: data.desc,
@ -127,6 +129,7 @@ async fn fixed<'r>(
boatdamage_id: i32, boatdamage_id: i32,
coxuser: CoxUser, coxuser: CoxUser,
) -> Flash<Redirect> { ) -> Flash<Redirect> {
return Flash::error(Redirect::to("/log"), "Du musst noch kurz geduldig sein. Sobald wir unser Logbuch umgestellt haben, kannst du es hier im Ruderassistenten verwenden ;)");
let boatdamage = BoatDamage::find_by_id(db, boatdamage_id).await.unwrap(); //TODO: Fix let boatdamage = BoatDamage::find_by_id(db, boatdamage_id).await.unwrap(); //TODO: Fix
let boatdamage_fixed = BoatDamageFixed { let boatdamage_fixed = BoatDamageFixed {
desc: data.desc, desc: data.desc,
@ -150,16 +153,14 @@ async fn verified<'r>(
boatdamage_id: i32, boatdamage_id: i32,
techuser: TechUser, techuser: TechUser,
) -> Flash<Redirect> { ) -> Flash<Redirect> {
return Flash::error(Redirect::to("/log"), "Du musst noch kurz geduldig sein. Sobald wir unser Logbuch umgestellt haben, kannst du es hier im Ruderassistenten verwenden ;)");
let boatdamage = BoatDamage::find_by_id(db, boatdamage_id).await.unwrap(); //TODO: Fix let boatdamage = BoatDamage::find_by_id(db, boatdamage_id).await.unwrap(); //TODO: Fix
let boatdamage_verified = BoatDamageVerified { let boatdamage_verified = BoatDamageVerified {
desc: data.desc, desc: data.desc,
user_id_verified: techuser.id as i32, user_id_verified: techuser.id as i32,
}; };
match boatdamage.verified(db, boatdamage_verified).await { match boatdamage.verified(db, boatdamage_verified).await {
Ok(_) => Flash::success( Ok(_) => Flash::success(Redirect::to("/boatdamage"), "Bootsschaden verifiziert"),
Redirect::to("/boatdamage"),
"Bootsschaden verifiziert",
),
Err(e) => Flash::error(Redirect::to("/boatdamage"), format!("Error: {e}")), Err(e) => Flash::error(Redirect::to("/boatdamage"), format!("Error: {e}")),
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,6 @@
{% include "includes/question-icon" %} {% include "includes/question-icon" %}
<span class="sr-only">FAQs</span> <span class="sr-only">FAQs</span>
</a> </a>
{% if loggedin_user.is_admin %}
<a href="#" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" <a href="#" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
data-sidebar="true" data-trigger="sidebar" data-header="Logbuch" data-body="#mobile-menu"> data-sidebar="true" data-trigger="sidebar" data-header="Logbuch" data-body="#mobile-menu">
{% include "includes/book" %} {% include "includes/book" %}
@ -30,15 +29,18 @@
<a href="/stat" class="block w-100 py-2 hover:text-primary-600 border-t"> <a href="/stat" class="block w-100 py-2 hover:text-primary-600 border-t">
Statistik Statistik
</a> </a>
{% if loggedin_user.is_admin %}
<a href="/admin/boat" class="block w-100 py-2 hover:text-primary-600 border-t"> <a href="/admin/boat" class="block w-100 py-2 hover:text-primary-600 border-t">
Boote Boote
</a> </a>
{% endif %}
<a href="/boatdamage" class="block w-100 py-2 hover:text-primary-600 border-t"> <a href="/boatdamage" class="block w-100 py-2 hover:text-primary-600 border-t">
Bootsschaden Bootsschaden
</a> </a>
</div> </div>
</div> </div>
{% if loggedin_user.is_admin %}
<a href="/admin/user" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"> <a href="/admin/user" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">
<svg class="inline h-4" width="16" height="16" fill="currentColor" class="bi bi-person-lines-fill" viewbox="0 0 16 16"> <svg class="inline h-4" width="16" height="16" fill="currentColor" class="bi bi-person-lines-fill" viewbox="0 0 16 16">
<path d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z"/> <path d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z"/>