mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-17 22:47:59 +01:00
move post top options into a partial
This commit is contained in:
parent
952993de10
commit
c8408376cc
2 changed files with 14 additions and 15 deletions
|
@ -1,18 +1,4 @@
|
|||
elixir:
|
||||
post_link = ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}?#{[post_id: @post.id]}" <> "#post_#{@post.id}"
|
||||
|
||||
- options = if true do
|
||||
.flex__spacer.hidden--desktop
|
||||
a.communication__interaction.hidden--desktop title="Link to post" href="#{post_link}"
|
||||
i.fa.fa-link
|
||||
= if not is_nil(@post.edited_at) and can?(@conn, :show, @post) do
|
||||
a href=~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/history"
|
||||
' Edited
|
||||
=> pretty_time(@post.edited_at)
|
||||
|
||||
= if @post.edit_reason not in [nil, ""] do
|
||||
' because:
|
||||
=> @post.edit_reason
|
||||
- options = render PhilomenaWeb.PostView, "_post_options_top.html", conn: @conn, post: @post
|
||||
|
||||
article.block.communication id="post_#{@post.id}"
|
||||
= if not @post.approved and not @post.hidden_from_users and (can?(@conn, :hide, @post) or @post.user_id == @conn.assigns.current_user.id) do
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
- post_link = ~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}?#{[post_id: @post.id]}" <> "#post_#{@post.id}"
|
||||
|
||||
.flex__spacer.hidden--desktop
|
||||
a.communication__interaction.hidden--desktop title="Link to post" href="#{post_link}"
|
||||
i.fa.fa-link
|
||||
= if not is_nil(@post.edited_at) and can?(@conn, :show, @post) do
|
||||
a href=~p"/forums/#{@post.topic.forum}/topics/#{@post.topic}/posts/#{@post}/history"
|
||||
' Edited
|
||||
=> pretty_time(@post.edited_at)
|
||||
|
||||
= if @post.edit_reason not in [nil, ""] do
|
||||
' because:
|
||||
=> @post.edit_reason
|
Loading…
Reference in a new issue