8 Commits

Author SHA1 Message Date
8e1b1c1aac Merge pull request 'formating-ergo' (#790) from formating-ergo into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 8m2s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #790
2024-11-11 13:34:36 +01:00
d5e6371b89 craete log if user creates a new event
Some checks failed
CI/CD Pipeline / test (push) Failing after 8m15s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-11-11 13:33:23 +01:00
eb49a829c6 formatting ergo
All checks were successful
CI/CD Pipeline / test (push) Successful in 20m29s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-11-11 10:27:50 +01:00
61ec8bddb8 Merge pull request 'rudi' (#786) from rudi into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m3s
CI/CD Pipeline / deploy-staging (push) Successful in 5m32s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #786
2024-10-28 15:50:56 +01:00
c8b60fa518 Merge pull request 'fix' (#784) from fix into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m27s
CI/CD Pipeline / deploy-staging (push) Successful in 5m48s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #784
2024-10-28 09:15:14 +01:00
d2cebc7c67 Merge pull request 'use-clusters' (#782) from use-clusters into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m11s
CI/CD Pipeline / deploy-staging (push) Successful in 6m0s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #782
2024-10-28 08:20:04 +01:00
13a372252d Merge pull request 'update-handgesteuert' (#780) from update-handgesteuert into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m51s
CI/CD Pipeline / deploy-staging (push) Successful in 5m29s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #780
2024-10-26 21:06:27 +02:00
4b0460aeee Merge pull request 'update-ergo' (#779) from update-ergo into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m12s
CI/CD Pipeline / deploy-staging (push) Successful in 5m46s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #779
2024-10-25 20:59:53 +02:00
3 changed files with 34 additions and 19 deletions

View File

@@ -9,8 +9,12 @@ use serde::Serialize;
use sqlx::{FromRow, Row, SqlitePool}; use sqlx::{FromRow, Row, SqlitePool};
use super::{ use super::{
notification::Notification, role::Role, tripdetails::TripDetails, triptype::TripType, log::Log,
user::User, notification::Notification,
role::Role,
tripdetails::TripDetails,
triptype::TripType,
user::{EventUser, User},
}; };
#[derive(Serialize, Clone, FromRow, Debug, PartialEq)] #[derive(Serialize, Clone, FromRow, Debug, PartialEq)]
@@ -242,6 +246,7 @@ WHERE trip_details.id=?
pub async fn create( pub async fn create(
db: &SqlitePool, db: &SqlitePool,
user: &EventUser,
name: &str, name: &str,
planned_amount_cox: i32, planned_amount_cox: i32,
always_show: bool, always_show: bool,
@@ -270,6 +275,15 @@ WHERE trip_details.id=?
.execute(db) .execute(db)
.await .await
.unwrap(); //Okay, as TripDetails can only be created with proper DB backing .unwrap(); //Okay, as TripDetails can only be created with proper DB backing
Log::create(
db,
format!(
"{} created event {} on {} at {}.",
user.user.name, name, trip_details.day, trip_details.planned_starting_time
),
)
.await;
} }
//TODO: create unit test //TODO: create unit test

View File

@@ -26,7 +26,7 @@ struct AddEventForm<'r> {
async fn create( async fn create(
db: &State<SqlitePool>, db: &State<SqlitePool>,
data: Form<AddEventForm<'_>>, data: Form<AddEventForm<'_>>,
_admin: EventUser, user: EventUser,
) -> Flash<Redirect> { ) -> Flash<Redirect> {
let data = data.into_inner(); let data = data.into_inner();
@@ -37,6 +37,7 @@ async fn create(
Event::create( Event::create(
db, db,
&user,
data.name, data.name,
data.planned_amount_cox, data.planned_amount_cox,
data.always_show, data.always_show,

View File

@@ -7,13 +7,15 @@
<summary>Dirty Thirty</summary> <summary>Dirty Thirty</summary>
<p> <p>
<div class="border-r border-l"> <div class="border-r border-l">
{% for stat in thirty %} <textarea style="width: 100%; height: 300px;">
{% set names = stat.name | split(pat=" ") %}{% set lastname_index = names | length - 1 %}{% set lastname = names[lastname_index] %}{{ lastname }}&#9; {%- for stat in thirty %}
{% for name in names %} {%- set names = stat.name | split(pat=" ") %}{% set lastname_index = names | length - 1 %}{% set lastname = names[lastname_index] %}{{ lastname }}&#9;
{%- for name in names -%}
{% if loop.index != lastname_index +1 %}{{ name }}{% endif %} {% if loop.index != lastname_index +1 %}{{ name }}{% endif %}
{% endfor %} {%- endfor -%}
&#9;{{ stat.dob }}&#9;{{ stat.weight }}&#9;{{ stat.sex }}&#9;&#9;DLI&#9;{{ stat.result }} &#9;{{ stat.dob }}&#9;{{ stat.weight }}&#9;{{ stat.sex }}&#9;&#9;DLI&#9;{{ stat.result }}&#13;&#10;
{% endfor %} {%- endfor -%}
</textarea>
</div> </div>
</p> </p>
</details> </details>
@@ -21,17 +23,15 @@
<summary>Dirty Dozen</summary> <summary>Dirty Dozen</summary>
<p> <p>
<div class="border-r border-l"> <div class="border-r border-l">
{% for stat in dozen %} <textarea style="width: 100%; height: 300px;">
{% set names = stat.name | split(pat=" ") %} {%- for stat in dozen -%}
{% set lastname_index = names | length - 1 %} {%- set names = stat.name | split(pat=" ") %}{% set lastname_index = names | length - 1 %}{% set lastname = names[lastname_index] %}{{ lastname }}&#9;
{% set lastname = names[lastname_index] %} {%- for name in names -%}
{{ lastname }};
{% for name in names %}
{% if loop.index != lastname_index +1 %}{{ name }}{% endif %} {% if loop.index != lastname_index +1 %}{{ name }}{% endif %}
{% endfor %} {%- endfor -%}
;{{ stat.dob }};{{ stat.weight }};{{ stat.sex }};DLI;{{ stat.result }} &#9;{{ stat.dob }}&#9;{{ stat.weight }}&#9;{{ stat.sex }}&#9;&#9;DLI&#9;{{ stat.result }}&#13;&#10;
<br /> {%- endfor -%}
{% endfor %} </textarea>
</div> </div>
</p> </p>
</details> </details>