diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-03-27 21:46:52 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-03-27 21:46:52 +0100 |
commit | eb929811b227790553265cdd4125cc17b4c7f1a6 (patch) | |
tree | aa3017b4c6d57153ab771da76d20ba128f4ba088 /templates | |
parent | 343e9ef20cf743005fe3224af9652c3fa6874b90 (diff) |
add per-month links to history0.09
Diffstat (limited to 'templates')
-rw-r--r-- | templates/history.html.ep | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/templates/history.html.ep b/templates/history.html.ep index 6b0f894..2808660 100644 --- a/templates/history.html.ep +++ b/templates/history.html.ep @@ -1,5 +1,22 @@ +% my $since = get_user_data()->{registered_at}; +% my $now = DateTime->now(time_zone => 'Europe/Berlin'); +<div class="row"> + <div class="col s12"> + <ul class="pagination"> + <!--<li class="disabled"><a href="#!"><i class="material-icons">chevron_left</i></a></li>--> + % my $ref = stash('year') ? stash('year') . '/' . stash('month') : ''; + % while ($since < $now) { + % my $link_to = $since->strftime('%Y/%m'); + % my $class = $link_to eq $ref ? 'active' : 'waves-effect'; + <li class="<%= $class %>"><a href="/history/<%= $link_to %>"><%= $since->strftime('%m.%Y') %></a></li> + % $since->add(months => 1); + % } + <!--<li class="disabled"><a href="#!"><i class="material-icons">chevron_right</i></a></li>--> + </ul> + </div> +</div> % if (my $stats = stash('statistics')) { -<h1><%= stash('month') %> <%= stash('year') %></h1> +<h1><%= stash('month_name') %> <%= stash('year') %></h1> <div class="row"> <div class="col s12"> <table class="striped"> |