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_months.html.ep | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'templates/_history_months.html.ep') diff --git a/templates/_history_months.html.ep b/templates/_history_months.html.ep index a707943..2dc0141 100644 --- a/templates/_history_months.html.ep +++ b/templates/_history_months.html.ep @@ -1,12 +1,23 @@
    - % for my $month (journeys->get_months(uid => current_user->{id})) { - % my $link_to = $month->[0]; - % my $text = $month->[1]; - % my $class = $link_to eq $current ? 'active' : 'waves-effect'; -
  • <%= $text %>
  • + % my ($prev, $current, $next) = journeys->get_nav_months(uid => current_user->{id}, year => $year, month => $month); + % if ($prev) { +
  • chevron_left
  • % } + % else { +
  • chevron_left
  • + % } + % if ($current) { +
  • <%= $current->[1] %>
  • + % } + % if ($next) { +
  • chevron_right
  • + % } + % else { +
  • chevron_right
  • + % } +
  • <%= $year %>
-- cgit v1.2.3