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 super::{
notification::Notification, role::Role, tripdetails::TripDetails, triptype::TripType,
user::User,
log::Log,
notification::Notification,
role::Role,
tripdetails::TripDetails,
triptype::TripType,
user::{EventUser, User},
};
#[derive(Serialize, Clone, FromRow, Debug, PartialEq)]
@@ -242,6 +246,7 @@ WHERE trip_details.id=?
pub async fn create(
db: &SqlitePool,
user: &EventUser,
name: &str,
planned_amount_cox: i32,
always_show: bool,
@@ -270,6 +275,15 @@ WHERE trip_details.id=?
.execute(db)
.await
.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

View File

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

View File

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