mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-18 06:57:59 +01:00
ip/fp info on images
This commit is contained in:
parent
76dce674ea
commit
621c6587d8
3 changed files with 16 additions and 13 deletions
|
@ -25,7 +25,7 @@ article.block.communication id="comment_#{@comment.id}"
|
||||||
= if can?(@conn, :manage, @comment) do
|
= if can?(@conn, :manage, @comment) do
|
||||||
/ todo: link_to_ip
|
/ todo: link_to_ip
|
||||||
.communication__info
|
.communication__info
|
||||||
=<> @comment.ip
|
=<> link_to_ip(@comment.ip)
|
||||||
.communication__info
|
.communication__info
|
||||||
=<> link_to_fingerprint(@comment.fingerprint)
|
=<> link_to_fingerprint(@comment.fingerprint)
|
||||||
/- if can?(:hide, Comment)
|
/- if can?(:hide, Comment)
|
||||||
|
|
|
@ -50,8 +50,14 @@
|
||||||
div
|
div
|
||||||
' Uploaded
|
' Uploaded
|
||||||
=> pretty_time(@image.created_at)
|
=> pretty_time(@image.created_at)
|
||||||
|
span.image_uploader
|
||||||
' by
|
' by
|
||||||
=> render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, awards: true, conn: @conn
|
=> render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, awards: true, conn: @conn
|
||||||
|
= if can?(@conn, :manage, @image) do
|
||||||
|
=<> link_to_ip(@image.ip)
|
||||||
|
=<> link_to_fingerprint(@image.fingerprint)
|
||||||
|
a href="#"
|
||||||
|
i.fa.fa-edit
|
||||||
span.image-size
|
span.image-size
|
||||||
|
|
|
|
||||||
= @image.image_width
|
= @image.image_width
|
||||||
|
|
|
@ -104,19 +104,16 @@ defmodule PhilomenaWeb.AppView do
|
||||||
|> to_string()
|
|> to_string()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp text_or_na(text), do: text
|
||||||
|
defp text_or_na(nil), do: "N/A"
|
||||||
|
|
||||||
|
# todo: make ip a real link
|
||||||
def link_to_ip(ip) do
|
def link_to_ip(ip) do
|
||||||
if ip do
|
link(text_or_na(ip), to: "#")
|
||||||
ip
|
|
||||||
else
|
|
||||||
"N/A"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# todo: make fp a real link
|
||||||
def link_to_fingerprint(fp) do
|
def link_to_fingerprint(fp) do
|
||||||
if fp do
|
link(String.slice(text_or_na(fp), 0..6), to: "#")
|
||||||
fp |> String.slice(0..6)
|
|
||||||
else
|
|
||||||
"N/A"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue