diff --git a/src/model/stat.rs b/src/model/stat.rs index bece501..05d7ea2 100644 --- a/src/model/stat.rs +++ b/src/model/stat.rs @@ -52,6 +52,10 @@ impl BoatStat { let name: String = row.get("name"); let location: String = row.get("location"); let year: i32 = row.get("year"); + if year == 0 { + continue; // Boat still on water + } + if !years.contains(&year) { years.push(year); } diff --git a/templates/stat.boats.html.tera b/templates/stat.boats.html.tera index b75eb1b..0aed44d 100644 --- a/templates/stat.boats.html.tera +++ b/templates/stat.boats.html.tera @@ -1,24 +1,44 @@ {% import "includes/macros" as macros %} {% extends "base" %} {% block content %} +

Bootsauswertung

- - - - - - {% for year in stat.pot_years | sort | reverse %}{% endfor %} - - - - {% for boat in stat.boats %} +
+
NameOrt{{ year }}
+ - - - {% for year in stat.pot_years | sort | reverse %} - + + {% for year in stat.pot_years | sort | reverse %}{% endfor %} + + + + {% for boat in stat.boats %} + + + + {% for year in stat.pot_years | sort | reverse %} + {% endfor %} @@ -26,6 +46,14 @@
{{ boat.name }}{{ boat.location }} - {% if year~'' in boat.years %}{{ boat.years[year] }}{% endif %} + NameOrt{{ year }}
{{ boat.name }}{{ boat.location }} + {% if year~'' in boat.years %} + {{ boat.years[year] }} + {% else %} + 0 + {% endif %}
- - - {% endblock content %} + + + +{% endblock content %}