Commit 0addce7b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

month overview: distinguish between no stats and no journeys

parent ccfdd800
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -749,9 +749,9 @@ sub get_months_for_year {
					month   => $row->{month}
				}
			)->expand->hash;
			if ($stats) {
				$ret[ $row->{month} - 1 ][2] = $stats->{data};
			}

			# undef -> no journeys for this month; empty hash -> no cached stats
			$ret[ $row->{month} - 1 ][2] = $stats->{data} // {};
		}
	}
	return @ret;
+3 −1
Original line number Diff line number Diff line
@@ -4,7 +4,9 @@
			% for my $month (journeys->get_months_for_year(uid => current_user->{id}, year => $year)) {
				% if (defined $month->[2]) {
					<a class="collection-item" href="/history/<%= $month->[0] %>"><%= $month->[1] %>
						% if (defined $month->[2]{km_route}) {
							<span class="secondary-content"><%= sprintf('%.f', $month->[2]{km_route}) %> km</span>
						% }
					</a>
				% }
				% else {