diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-11-21 15:33:43 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-11-21 15:34:06 +0100 |
commit | ccfdd8007e136d5d98652d415dda8eb595a2ada9 (patch) | |
tree | 6b685625b796dfe3c251ab012a80239c6d3d1795 /templates/_history_months.html.ep | |
parent | e3fba3dcd493f609e107435867c4a67cb7ee420f (diff) |
testing a more organized history navigation1.18.9
Diffstat (limited to 'templates/_history_months.html.ep')
-rw-r--r-- | templates/_history_months.html.ep | 21 |
1 files changed, 16 insertions, 5 deletions
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 @@ <div class="row"> <div class="col s12"> <ul class="pagination"> - % 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'; - <li class="<%= $class %>"><a href="/history/<%= $link_to %>"><%= $text %></a></li> + % my ($prev, $current, $next) = journeys->get_nav_months(uid => current_user->{id}, year => $year, month => $month); + % if ($prev) { + <li class="waves-effect waves-light"><a href="/history/<%= $prev->[0] %>"><i class="material-icons">chevron_left</i></a></li> % } + % else { + <li class="disabled"><a href="#!"><i class="material-icons">chevron_left</i></a></li> + % } + % if ($current) { + <li class="" style="min-width: 8em;"><a href="/history/<%= $current->[0] %>"><%= $current->[1] %></a></li> + % } + % if ($next) { + <li class="waves-effect waves-light"><a href="/history/<%= $next->[0] %>"><i class="material-icons">chevron_right</i></a></li> + % } + % else { + <li class="disabled"><a href="#!"><i class="material-icons">chevron_right</i></a></li> + % } + <li class=""><a href="/history/<%= $year %>"><%= $year %></a></li> </ul> </div> </div> |