philomena/lib/philomena_web/templates/image/comment/index.html.heex
2024-06-01 23:50:36 -04:00

34 lines
1.1 KiB
Text

<%
route = fn p -> ~p"/images/#{@image}/comments?#{p}" end
pagination = render(PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route)
%>
<div class="block">
<div class="block__header page__header">
<div class="page__pagination">
<%= pagination %>
</div>
<div class="page__info">
<span class="block__header__title">
<%= @image.comments_count %>
<%= pluralize("comment", "comments", @image.comments_count) %>
posted
</span>
<button class="button" data-disable-with="..." id="js-refresh-comments" title="Refresh">
<i class="fa fa-sync"></i>
<span class="hide-mobile">
Refresh
</span>
</button>
</div>
</div>
</div>
<%= for {comment, body} <- @comments, can_view_communication?(@conn, comment) do %>
<%= render(PhilomenaWeb.CommentView, "_comment.html", comment: comment, body: body, conn: @conn) %>
<% end %>
<div class="block">
<div class="block__header block__header--light page__header">
<div class="page__pagination">
<%= pagination %>
</div>
</div>
</div>