Loading lib/Travelynx/Model/Journeys.pm +17 −2 Original line number Diff line number Diff line Loading @@ -703,7 +703,7 @@ sub get_latest_checkout_station_id { return $res_h->{checkout_station_id}; } sub get_years { sub get_nav_years { my ( $self, %opt ) = @_; my $uid = $opt{uid}; Loading @@ -723,6 +723,22 @@ sub get_years { return @ret; } sub get_years { my ( $self, %opt ) = @_; my @years = $self->get_nav_years(%opt); for my $year (@years) { my $stats = $self->stats_cache->get( uid => $opt{uid}, year => $year, month => 0, ); $year->[2] = $stats // {}; } return @years; } sub get_months_for_year { my ( $self, %opt ) = @_; Loading @@ -748,7 +764,6 @@ sub get_months_for_year { for my $row ( $res->hashes->each ) { if ( $row->{year} == $year ) { # TODO delegate query to the (not yet present) JourneyStats model my $stats = $self->stats_cache->get( db => $db, uid => $uid, Loading templates/_history_years.html.ep +1 −1 Original line number Diff line number Diff line <div class="row"> <div class="col s12"> % my @years = journeys->get_years(uid => current_user->{id}); % my @years = journeys->get_nav_years(uid => current_user->{id}); % if (@years) { <ul class="pagination"> % for my $year (@years) { Loading templates/history.html.ep +3 −1 Original line number Diff line number Diff line <h2>Fahrten</h2> %= include '_history_years', current => ''; Für Details ein Jahr auswählen. %= include '_history_years_list'; <h2>Auswertungen</h2> <div class="row"> Loading Loading
lib/Travelynx/Model/Journeys.pm +17 −2 Original line number Diff line number Diff line Loading @@ -703,7 +703,7 @@ sub get_latest_checkout_station_id { return $res_h->{checkout_station_id}; } sub get_years { sub get_nav_years { my ( $self, %opt ) = @_; my $uid = $opt{uid}; Loading @@ -723,6 +723,22 @@ sub get_years { return @ret; } sub get_years { my ( $self, %opt ) = @_; my @years = $self->get_nav_years(%opt); for my $year (@years) { my $stats = $self->stats_cache->get( uid => $opt{uid}, year => $year, month => 0, ); $year->[2] = $stats // {}; } return @years; } sub get_months_for_year { my ( $self, %opt ) = @_; Loading @@ -748,7 +764,6 @@ sub get_months_for_year { for my $row ( $res->hashes->each ) { if ( $row->{year} == $year ) { # TODO delegate query to the (not yet present) JourneyStats model my $stats = $self->stats_cache->get( db => $db, uid => $uid, Loading
templates/_history_years.html.ep +1 −1 Original line number Diff line number Diff line <div class="row"> <div class="col s12"> % my @years = journeys->get_years(uid => current_user->{id}); % my @years = journeys->get_nav_years(uid => current_user->{id}); % if (@years) { <ul class="pagination"> % for my $year (@years) { Loading
templates/history.html.ep +3 −1 Original line number Diff line number Diff line <h2>Fahrten</h2> %= include '_history_years', current => ''; Für Details ein Jahr auswählen. %= include '_history_years_list'; <h2>Auswertungen</h2> <div class="row"> Loading