Compare commits

..

No commits in common. "a1b78db7508719427b4d6924d5a93e37ebe6ef65" and "297e0629a4f74a0cb228c33ba08bab6e603ae6b6" have entirely different histories.

3 changed files with 38 additions and 23 deletions

View File

@ -17,7 +17,6 @@ pub struct BoatStat {
pub struct SingleBoatStat {
name: String,
location: String,
owner: String,
years: HashMap<String, i32>,
}
@ -40,7 +39,7 @@ LEFT JOIN
LEFT JOIN
location ON boat.location_id = location.id
WHERE
boat.name != 'Externes Boot' AND not boat.external
boat.name != 'Externes Boot'
GROUP BY
boat.id, year
ORDER BY
@ -59,7 +58,7 @@ ORDER BY
} else {
String::from("Verein")
};
let name = boat.name.clone();
let name = format!("{} ({})", boat.name, owner);
let location: String = row.get("location");
let year: i32 = row.get("year");
if year == 0 {
@ -79,7 +78,6 @@ ORDER BY
.or_insert(SingleBoatStat {
name,
location,
owner,
years: HashMap::new(),
});
boat_stat.years.insert(year, rowed_km);

View File

@ -34,6 +34,23 @@
</a>
</div>
<div>
{% if "scheckbuch" in loggedin_user.roles and loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
<a href="#"
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
data-sidebar="true"
data-trigger="sidebar"
data-header="Ergo Challenge"
data-body="#mobile-menu-guest">
{% include "includes/book" %}
<span class="sr-only">Ergo</span>
</a>
<div class="hidden">
<div id="mobile-menu-guest">
<a href="/ergo" class="block w-100 py-2 hover:text-primary-600 border-t">Ergo</a>
</div>
</div>
{% endif %}
{% if "scheckbuch" not in loggedin_user.roles %}
<a href="#"
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
data-sidebar="true"
@ -45,32 +62,34 @@
</a>
<div class="hidden">
<div id="mobile-menu">
{% if "Donau Linz" in loggedin_user.roles %}
<a href="/planned" class="block w-100 py-2 hover:text-primary-600">Geplante Ausfahrten</a>
<a href="/log" class="block w-100 py-2 hover:text-primary-600 border-t">Ausfahrt eintragen</a>
<a href="/log/show"
class="block w-100 py-2 hover:text-primary-600 border-t">Logbuch</a>
<a href="/stat" class="block w-100 py-2 hover:text-primary-600 border-t">Statistik</a>
<a href="/stat/boats"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsauswertung</a>
<a href="/boatdamage"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsschaden</a>
<a href="/boatreservation"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsreservierung</a>
{% endif %}
{% if loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
<a href="/ergo" class="block w-100 py-2 hover:text-primary-600 border-t">Ergo</a>
{% endif %}
{% if "admin" in loggedin_user.roles or "Vorstand" in loggedin_user.roles %}
<a href="/admin/user"
class="block w-100 py-2 hover:text-primary-600 border-t">Userverwaltung</a>
{% endif %}
{% if loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
<a href="/ergo" class="block w-100 py-2 hover:text-primary-600 border-t">Ergo</a>
{% endif %}
<a href="/stat" class="block w-100 py-2 hover:text-primary-600 border-t">Statistik</a>
<a href="/stat/boats"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsauswertung</a>
{% if "admin" in loggedin_user.roles %}
<a href="/admin/boat"
class="block w-100 py-2 hover:text-primary-600 border-t">Boote</a>
{% endif %}
<a href="/auth/logout"
class="block w-100 py-2 hover:text-primary-600 border-t">Ausloggen<svg class="inline h-4"
<a href="/boatdamage"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsschaden</a>
<a href="/boatreservation"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsreservierung</a>
</div>
</div>
{% endif %}
<a href="/auth/logout"
class="inline-flex justify-center rounded-md bg-gray-200 ml-1 px-3 py-2 text-sm font-semibold text-primary-950 hover:bg-gray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">
<svg class="inline h-4"
width="24"
height="24"
viewbox="0 0 24 24"
@ -83,9 +102,9 @@
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="16 17 21 12 16 7"></polyline>
<line x1="21" y1="12" x2="9" y2="12"></line>
</svg></a>
</div>
</div>
</svg>
<span class="sr-only">Ausloggen</span>
</a>
</div>
</div>
</header>

View File

@ -9,7 +9,6 @@
<thead>
<tr>
<th>Name</th>
<th>Eigentümer</th>
<th>Ort</th>
{% for year in stat.pot_years | sort | reverse %}<th>{{ year }}</th>{% endfor %}
</tr>
@ -18,7 +17,6 @@
{% for boat in stat.boats %}
<tr>
<td>{{ boat.name }}</td>
<td>{{ boat.owner }}</td>
<td>{{ boat.location }}</td>
{% for year in stat.pot_years | sort | reverse %}
<td>