@ -21,9 +21,9 @@ pub struct Boat {
|
||||
pub boatbuilder: Option<String>,
|
||||
pub default_destination: Option<String>,
|
||||
#[serde(default = "bool::default")]
|
||||
convert_handoperated_possible: bool,
|
||||
pub convert_handoperated_possible: bool,
|
||||
#[serde(default = "bool::default")]
|
||||
default_shipmaster_only_steering: bool,
|
||||
pub default_shipmaster_only_steering: bool,
|
||||
#[serde(default = "bool::default")]
|
||||
skull: bool,
|
||||
#[serde(default = "bool::default")]
|
||||
@ -46,6 +46,7 @@ pub struct BoatWithDetails {
|
||||
damage: BoatDamage,
|
||||
on_water: bool,
|
||||
reserved_today: bool,
|
||||
cat: String,
|
||||
}
|
||||
|
||||
#[derive(FromForm)]
|
||||
@ -179,11 +180,18 @@ AND date('now') BETWEEN start_date AND end_date;",
|
||||
if boat.is_locked(db).await {
|
||||
damage = BoatDamage::Locked;
|
||||
}
|
||||
let cat = if boat.default_shipmaster_only_steering {
|
||||
format!("{}+", boat.amount_seats - 1)
|
||||
} else {
|
||||
format!("{}x", boat.amount_seats)
|
||||
};
|
||||
|
||||
res.push(BoatWithDetails {
|
||||
damage,
|
||||
on_water: boat.on_water(db).await,
|
||||
reserved_today: boat.reserved_today(db).await,
|
||||
boat,
|
||||
cat,
|
||||
});
|
||||
}
|
||||
res
|
||||
|
Reference in New Issue
Block a user