From ccfdd8007e136d5d98652d415dda8eb595a2ada9 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 Nov 2020 15:33:43 +0100 Subject: testing a more organized history navigation --- templates/_history_years.html.ep | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'templates/_history_years.html.ep') diff --git a/templates/_history_years.html.ep b/templates/_history_years.html.ep index e0b1357..09ea5ce 100644 --- a/templates/_history_years.html.ep +++ b/templates/_history_years.html.ep @@ -1,12 +1,18 @@
-
    - % for my $year (journeys->get_years(uid => current_user->{id})) { - % my $link_to = $year->[0]; - % my $text = $year->[1]; - % my $class = $link_to eq $current ? 'active' : 'waves-effect'; -
  • <%= $text %>
  • - % } -
+ % my @years = journeys->get_years(uid => current_user->{id}); + % if (@years) { +
    + % for my $year (journeys->get_years(uid => current_user->{id})) { + % my $link_to = $year->[0]; + % my $text = $year->[1]; + % my $class = $link_to eq $current ? 'active' : 'waves-effect'; +
  • <%= $text %>
  • + % } +
+ % } + % else { + Keine Fahrten gefunden. + % }
-- cgit v1.2.3