mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
ip/fp info on posts
This commit is contained in:
parent
2b0e65e85e
commit
76dce674ea
3 changed files with 26 additions and 22 deletions
|
@ -2,13 +2,10 @@ article.block.communication id="post_#{@post.id}"
|
|||
.block__content.flex.flex--no-wrap
|
||||
.flex__fixed.spacing-right
|
||||
= render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn
|
||||
|
||||
.flex__grow.communication__body
|
||||
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn
|
||||
br
|
||||
|
||||
= render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn
|
||||
|
||||
.communication__body__text
|
||||
= if @post.hidden_from_users do
|
||||
strong.comment_deleted
|
||||
|
@ -16,12 +13,19 @@ article.block.communication id="post_#{@post.id}"
|
|||
=> @post.deletion_reason
|
||||
- else
|
||||
==<> @body
|
||||
|
||||
|
||||
.block__content.communication__options
|
||||
.flex.flex--wrap.flex--spaced-out
|
||||
= render PhilomenaWeb.PostView, "_post_options.html", conn: @conn, post: @post
|
||||
|
||||
= if can?(@conn, :hide, @post) do
|
||||
/ todo: make post deletion work
|
||||
a.communication__interaction.togglable-delete-form-link href="#"
|
||||
i.fa.fa-times
|
||||
=<> "Delete"
|
||||
= if can?(@conn, :manage, @post) do
|
||||
.communication__info
|
||||
=<> link_to_ip(@post.ip)
|
||||
.communication__info
|
||||
=<> link_to_fingerprint(@post.fingerprint)
|
||||
/- if can?(:hide, Post)
|
||||
/ .js-staff-action
|
||||
/ - if !post.hidden_from_users && !post.destroyed_content
|
||||
|
|
|
@ -103,4 +103,20 @@ defmodule PhilomenaWeb.AppView do
|
|||
])
|
||||
|> to_string()
|
||||
end
|
||||
|
||||
def link_to_ip(ip) do
|
||||
if ip do
|
||||
ip
|
||||
else
|
||||
"N/A"
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_fingerprint(fp) do
|
||||
if fp do
|
||||
fp |> String.slice(0..6)
|
||||
else
|
||||
"N/A"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,19 +1,3 @@
|
|||
defmodule PhilomenaWeb.CommentView do
|
||||
use PhilomenaWeb, :view
|
||||
|
||||
def link_to_ip(ip) do
|
||||
if ip do
|
||||
ip
|
||||
else
|
||||
"N/A"
|
||||
end
|
||||
end
|
||||
|
||||
def link_to_fingerprint(fp) do
|
||||
if fp do
|
||||
fp |> String.slice(0..6)
|
||||
else
|
||||
"N/A"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue