philomena/lib/philomena_web/templates/post/_post_options.html.heex

44 lines
1.7 KiB
Text
Raw Normal View History

2024-05-04 23:09:20 +02:00
<div>
2024-05-04 23:09:44 +02:00
Posted <%= pretty_time(@post.created_at) %>
2024-05-04 23:09:20 +02:00
<a class="communication__interaction" href={~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/reports/new"}>
2024-05-04 23:09:44 +02:00
<i class="fa fa-flag"></i> Report
2024-05-04 23:09:20 +02:00
</a>
<%= if not is_nil(@post.edited_at) and can?(@conn, :show, @post) do %>
<br />
<a href={~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/history"}>
2024-05-04 23:09:44 +02:00
Edited <%= pretty_time(@post.edited_at) %>
2024-05-04 23:09:20 +02:00
<%= if @post.edit_reason not in [nil, ""] do %>
2024-05-04 23:09:44 +02:00
because: <%= @post.edit_reason %>
2024-05-04 23:09:20 +02:00
<% end %>
</a>
<% end %>
</div>
<div>
<% link_path = ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}?#{[post_id: @post.id]}" <> "#post_#{@post.id}" %>
<% safe_author = markdown_safe_author(@post) %>
2024-05-04 23:09:44 +02:00
<% quote_body =
if @post.hidden_from_users do
""
else
@post.body
end %>
2024-05-04 23:09:20 +02:00
<a class="communication__interaction" href={link_path} title="Link to post">
2024-05-04 23:09:44 +02:00
<i class="fa fa-link"></i> Link
2024-05-04 23:09:20 +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-05-04 23:09:44 +02:00
<i class="fa fa-quote-right"></i> Quote
2024-05-04 23:09:20 +02:00
</a>
<a class="communication__interaction post-reply" data-author={safe_author} data-reply-url={link_path} href={link_path}>
2024-05-04 23:09:44 +02:00
<i class="fa fa-reply"></i> Reply
2024-05-04 23:09:20 +02:00
</a>
<%= if can?(@conn, :edit, @post) do %>
<span class="owner-options">
<strong>
<a class="communication__interaction" href={~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/edit"}>
2024-05-04 23:09:44 +02:00
<i class="fas fa-edit"></i> Edit
2024-05-04 23:09:20 +02:00
</a>
</strong>
</span>
<% end %>
</div>