legendary-doc-site/apps/content/lib/content_web/templates/posts/pagination.html.eex

15 lines
476 B
Elixir
Raw Normal View History

<%= if Legendary.Content.Post.paginated_post?(@post) do %>
<nav class="paginator">
Page:
<%= Enum.map(
1..Legendary.Content.Post.content_page_count(@post),
fn page ->
if assigns[:current_page] == nil || assigns[:current_page] != page do
2021-03-25 22:42:55 +00:00
link page, to: Routes.posts_path(@conn, :show, @post, page: page)
else
content_tag :span, page, class: "paginator-page"
end
end) %>
</nav>
<% end %>