philomena/lib/philomena_web/templates/comment/_comment_options.html.heex

44 lines
1.6 KiB
Text
Raw Normal View History

2024-06-02 05:50:36 +02:00
<div>
2024-06-02 05:50:49 +02:00
Posted <%= pretty_time(@comment.created_at) %>
2024-06-02 05:50:36 +02:00
<a class="communication__interaction" href={~p"/images/#{@comment.image}/comments/#{@comment}/reports/new"}>
2024-06-02 05:50:49 +02:00
<i class="fa fa-flag"></i> Report
2024-06-02 05:50:36 +02:00
</a>
<%= if not is_nil(@comment.edited_at) and can?(@conn, :show, @comment) do %>
<br />
<a href={~p"/images/#{@comment.image}/comments/#{@comment}/history"}>
2024-06-02 05:50:49 +02:00
Edited <%= pretty_time(@comment.edited_at) %>
2024-06-02 05:50:36 +02:00
<%= if @comment.edit_reason not in [nil, ""] do %>
2024-06-02 05:50:49 +02:00
because: <%= @comment.edit_reason %>
2024-06-02 05:50:36 +02:00
<% end %>
</a>
<% end %>
</div>
<div>
<% link_path = ~p"/images/#{@comment.image}" <> "#comment_#{@comment.id}" %>
<% safe_author = PhilomenaWeb.PostView.markdown_safe_author(@comment) %>
2024-06-02 05:50:49 +02:00
<% quote_body =
if @comment.hidden_from_users do
""
else
@comment.body
end %>
2024-06-02 05:50:36 +02:00
<a class="communication__interaction" href={link_path} title="Link to comment">
2024-06-02 05:50:49 +02:00
<i class="fa fa-link"></i> Link
2024-06-02 05:50:36 +02:00
</a>
<a class="communication__interaction post-reply post-reply-quote" data-author={safe_author} data-post={quote_body} data-reply-url={link_path} href={link_path}>
2024-06-02 05:50:49 +02:00
<i class="fa fa-quote-right"></i> Quote
2024-06-02 05:50:36 +02:00
</a>
<a class="communication__interaction post-reply" data-author={safe_author} data-reply-url={link_path} href={link_path}>
2024-06-02 05:50:49 +02:00
<i class="fa fa-reply"></i> Reply
2024-06-02 05:50:36 +02:00
</a>
<%= if can?(@conn, :edit, @comment) do %>
<span class="owner-options">
<strong>
<a class="communication__interaction" href={~p"/images/#{@comment.image}/comments/#{@comment}/edit"}>
2024-06-02 05:50:49 +02:00
<i class="fas fa-edit"></i> Edit
2024-06-02 05:50:36 +02:00
</a>
</strong>
</span>
<% end %>
</div>