map: show year in headline if set

This commit is contained in:
Birte Kristina Friesel 2024-01-01 12:58:59 +01:00
parent b71203738c
commit 2c229c0317
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA
2 changed files with 17 additions and 1 deletions

View file

@ -1342,6 +1342,18 @@ sub map_history {
$filter_until = undef; $filter_until = undef;
} }
my $year;
if ( $filter_from
and $filter_from->day == 1
and $filter_from->month == 1
and $filter_until
and $filter_until->day == 31
and $filter_until->month == 12
and $filter_from->year == $filter_until->year )
{
$year = $filter_from->year;
}
my @journeys = $self->journeys->get( my @journeys = $self->journeys->get(
uid => $self->current_user->{id}, uid => $self->current_user->{id},
with_polyline => $with_polyline, with_polyline => $with_polyline,
@ -1376,6 +1388,7 @@ sub map_history {
$self->render( $self->render(
template => 'history_map', template => 'history_map',
year => $year,
with_map => 1, with_map => 1,
%{$res} %{$res}
); );

View file

@ -1,6 +1,9 @@
<div class="row"> <div class="row">
<div class="col s12"> <div class="col s12">
% if (@{$station_coordinates}) { % if (stash('year')) {
Alle Fahrten in <strong><%= stash('year') %></strong>
% }
% elsif (@{$station_coordinates}) {
Alle bisherigen Fahrten Alle bisherigen Fahrten
% } % }
% else { % else {