feat: show vehicles in overview
This commit is contained in:
parent
90d6175d6c
commit
760e19522b
@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
filters,
|
||||
models::{Assignment, Function},
|
||||
utils::ApplicationError,
|
||||
models::{Assignment, Function, Vehicle},
|
||||
utils::{event_planning_template::generate_vehicles_assigned_and_available, ApplicationError},
|
||||
};
|
||||
use actix_web::{web, HttpResponse, Responder};
|
||||
use chrono::{NaiveDate, Utc};
|
||||
@ -24,7 +24,7 @@ struct CalendarTemplate {
|
||||
date: NaiveDate,
|
||||
selected_area: Option<i32>,
|
||||
areas: Vec<Area>,
|
||||
events_and_assignments: Vec<(Event, Vec<String>, Option<String>, Option<String>)>,
|
||||
events_and_assignments: Vec<(Event, Vec<String>, Option<String>, Option<String>, Vec<Vehicle>)>,
|
||||
availabillities: Vec<Availabillity>,
|
||||
}
|
||||
|
||||
@ -76,6 +76,8 @@ async fn get(
|
||||
.into_iter()
|
||||
.partition(|a| a.function == Function::Wachhabender);
|
||||
|
||||
let (assigned_vehicle, _) = generate_vehicles_assigned_and_available(&pool, &e).await?;
|
||||
|
||||
events_and_assignments.push((
|
||||
e,
|
||||
posten
|
||||
@ -118,6 +120,7 @@ async fn get(
|
||||
.clone(),
|
||||
)
|
||||
}),
|
||||
assigned_vehicle
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
||||
<h5 class="subtitle is-5">keine Events geplant</h5>
|
||||
</div>
|
||||
{% else %}
|
||||
{% for (event, posten, fuehrungsassistent, wachhabender) in events_and_assignments %}
|
||||
{% for (event, posten, fuehrungsassistent, wachhabender, vehicle) in events_and_assignments %}
|
||||
<div class="box">
|
||||
<div class="fixed-grid has-1-cols-mobile">
|
||||
<div class="grid content">
|
||||
@ -157,6 +157,14 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if vehicle.len() > 0 %}
|
||||
<div class="cell is-col-span-2">
|
||||
<b>Fahrzeuge:</b>
|
||||
{% for v in vehicle %}
|
||||
<span class="tag is-link"> {{ v.radio_call_name }} - {{ v.station }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user