art #739
@ -171,6 +171,16 @@ AND date('now') BETWEEN start_date AND end_date;",
|
|||||||
.is_some()
|
.is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn cat(&self) -> String {
|
||||||
|
if self.external {
|
||||||
|
"Vereinsfremde Boote".to_string()
|
||||||
|
} else if self.default_shipmaster_only_steering {
|
||||||
|
format!("{}+", self.amount_seats - 1)
|
||||||
|
} else {
|
||||||
|
format!("{}x", self.amount_seats)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async fn boats_to_details(db: &SqlitePool, boats: Vec<Boat>) -> Vec<BoatWithDetails> {
|
async fn boats_to_details(db: &SqlitePool, boats: Vec<Boat>) -> Vec<BoatWithDetails> {
|
||||||
let mut res = Vec::new();
|
let mut res = Vec::new();
|
||||||
for boat in boats {
|
for boat in boats {
|
||||||
@ -181,13 +191,7 @@ AND date('now') BETWEEN start_date AND end_date;",
|
|||||||
if boat.is_locked(db).await {
|
if boat.is_locked(db).await {
|
||||||
damage = BoatDamage::Locked;
|
damage = BoatDamage::Locked;
|
||||||
}
|
}
|
||||||
let cat = if boat.external {
|
let cat = boat.cat();
|
||||||
"Vereinsfremde Boote".to_string()
|
|
||||||
} else if boat.default_shipmaster_only_steering {
|
|
||||||
format!("{}+", boat.amount_seats - 1)
|
|
||||||
} else {
|
|
||||||
format!("{}x", boat.amount_seats)
|
|
||||||
};
|
|
||||||
|
|
||||||
res.push(BoatWithDetails {
|
res.push(BoatWithDetails {
|
||||||
damage,
|
damage,
|
||||||
|
@ -16,6 +16,7 @@ pub struct BoatStat {
|
|||||||
#[derive(Serialize, Clone)]
|
#[derive(Serialize, Clone)]
|
||||||
pub struct SingleBoatStat {
|
pub struct SingleBoatStat {
|
||||||
name: String,
|
name: String,
|
||||||
|
cat: String,
|
||||||
location: String,
|
location: String,
|
||||||
owner: String,
|
owner: String,
|
||||||
years: HashMap<String, i32>,
|
years: HashMap<String, i32>,
|
||||||
@ -71,6 +72,7 @@ ORDER BY
|
|||||||
}
|
}
|
||||||
|
|
||||||
let year: String = format!("{year}");
|
let year: String = format!("{year}");
|
||||||
|
let cat = boat.cat();
|
||||||
|
|
||||||
let rowed_km: i32 = row.get("rowed_km");
|
let rowed_km: i32 = row.get("rowed_km");
|
||||||
|
|
||||||
@ -80,6 +82,7 @@ ORDER BY
|
|||||||
name,
|
name,
|
||||||
location,
|
location,
|
||||||
owner,
|
owner,
|
||||||
|
cat,
|
||||||
years: HashMap::new(),
|
years: HashMap::new(),
|
||||||
});
|
});
|
||||||
boat_stat.years.insert(year, rowed_km);
|
boat_stat.years.insert(year, rowed_km);
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
<th>Art</th>
|
||||||
<th>Eigentümer</th>
|
<th>Eigentümer</th>
|
||||||
<th>Ort</th>
|
<th>Ort</th>
|
||||||
{% for year in stat.pot_years | sort | reverse %}<th>{{ year }}</th>{% endfor %}
|
{% for year in stat.pot_years | sort | reverse %}<th>{{ year }}</th>{% endfor %}
|
||||||
@ -18,6 +19,7 @@
|
|||||||
{% for boat in stat.boats %}
|
{% for boat in stat.boats %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ boat.name }}</td>
|
<td>{{ boat.name }}</td>
|
||||||
|
<td>{{ boat.cat }}</td>
|
||||||
<td>{{ boat.owner }}</td>
|
<td>{{ boat.owner }}</td>
|
||||||
<td>{{ boat.location }}</td>
|
<td>{{ boat.location }}</td>
|
||||||
{% for year in stat.pot_years | sort | reverse %}
|
{% for year in stat.pot_years | sort | reverse %}
|
||||||
|
Loading…
Reference in New Issue
Block a user