ip/fp info on posts

This commit is contained in:
Luna D 2019-12-05 15:06:18 -05:00
parent 2b0e65e85e
commit 76dce674ea
No known key found for this signature in database
GPG key ID: D0F46C94720BAA4B
3 changed files with 26 additions and 22 deletions

View file

@ -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

View file

@ -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

View file

@ -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