backend: move pager HTML into a partial template
This commit is contained in:
parent
72412a7889
commit
daefabd1af
11
templates/_pager.html.ep
Normal file
11
templates/_pager.html.ep
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<% if (my $pager = stash("pager")) { %>
|
||||||
|
<footer>
|
||||||
|
<nav class="text-center">
|
||||||
|
<%= link_to "<<" => $pager->{first_page} if exists $pager->{first_page} %>
|
||||||
|
<%= link_to "<" => $pager->{previous_page} if exists $pager->{previous_page} %>
|
||||||
|
<span><%= $pager->{current_page} %></span>
|
||||||
|
<%= link_to ">" => $pager->{next_page} if exists $pager->{next_page} %>
|
||||||
|
<%= link_to ">>" => $pager->{last_page} if exists $pager->{last_page} %>
|
||||||
|
</nav>
|
||||||
|
</footer>
|
||||||
|
<% } %>
|
@ -20,17 +20,7 @@
|
|||||||
<div class="viewport flex-i-fullsize flex-c-vertical">
|
<div class="viewport flex-i-fullsize flex-c-vertical">
|
||||||
<h1><%= title %></h1>
|
<h1><%= title %></h1>
|
||||||
<div class="flex-i-fullsize"><%= content %></div>
|
<div class="flex-i-fullsize"><%= content %></div>
|
||||||
<% if (defined $pager) { %>
|
<%= include '_pager' %>
|
||||||
<footer>
|
|
||||||
<nav class="text-center">
|
|
||||||
<%= link_to "<<" => $pager->{first_page} if exists $pager->{first_page} %>
|
|
||||||
<%= link_to "<" => $pager->{previous_page} if exists $pager->{previous_page} %>
|
|
||||||
<span><%= $pager->{current_page} %></span>
|
|
||||||
<%= link_to ">" => $pager->{next_page} if exists $pager->{next_page} %>
|
|
||||||
<%= link_to ">>" => $pager->{last_page} if exists $pager->{last_page} %>
|
|
||||||
</nav>
|
|
||||||
</footer>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer class="border-top">
|
<footer class="border-top">
|
||||||
|
Loading…
Reference in New Issue
Block a user