mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-01 03:46:44 +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
|
.block__content.flex.flex--no-wrap
|
||||||
.flex__fixed.spacing-right
|
.flex__fixed.spacing-right
|
||||||
= render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_avatar.html", object: @post, conn: @conn
|
||||||
|
|
||||||
.flex__grow.communication__body
|
.flex__grow.communication__body
|
||||||
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn
|
span.communication__body__sender-name = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @post, awards: true, conn: @conn
|
||||||
br
|
br
|
||||||
|
|
||||||
= render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn
|
= render PhilomenaWeb.UserAttributionView, "_anon_user_title.html", object: @post, conn: @conn
|
||||||
|
|
||||||
.communication__body__text
|
.communication__body__text
|
||||||
= if @post.hidden_from_users do
|
= if @post.hidden_from_users do
|
||||||
strong.comment_deleted
|
strong.comment_deleted
|
||||||
|
@ -16,12 +13,19 @@ article.block.communication id="post_#{@post.id}"
|
||||||
=> @post.deletion_reason
|
=> @post.deletion_reason
|
||||||
- else
|
- else
|
||||||
==<> @body
|
==<> @body
|
||||||
|
|
||||||
|
|
||||||
.block__content.communication__options
|
.block__content.communication__options
|
||||||
.flex.flex--wrap.flex--spaced-out
|
.flex.flex--wrap.flex--spaced-out
|
||||||
= render PhilomenaWeb.PostView, "_post_options.html", conn: @conn, post: @post
|
= 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)
|
/- if can?(:hide, Post)
|
||||||
/ .js-staff-action
|
/ .js-staff-action
|
||||||
/ - if !post.hidden_from_users && !post.destroyed_content
|
/ - if !post.hidden_from_users && !post.destroyed_content
|
||||||
|
|
|
@ -103,4 +103,20 @@ defmodule PhilomenaWeb.AppView do
|
||||||
])
|
])
|
||||||
|> to_string()
|
|> to_string()
|
||||||
end
|
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
|
end
|
||||||
|
|
|
@ -1,19 +1,3 @@
|
||||||
defmodule PhilomenaWeb.CommentView do
|
defmodule PhilomenaWeb.CommentView do
|
||||||
use PhilomenaWeb, :view
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue