mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-17 22:47: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
|
||||
/ todo: link_to_ip
|
||||
.communication__info
|
||||
=<> @comment.ip
|
||||
=<> link_to_ip(@comment.ip)
|
||||
.communication__info
|
||||
=<> link_to_fingerprint(@comment.fingerprint)
|
||||
/- if can?(:hide, Comment)
|
||||
|
|
|
@ -50,8 +50,14 @@
|
|||
div
|
||||
' Uploaded
|
||||
=> pretty_time(@image.created_at)
|
||||
' by
|
||||
=> render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, awards: true, conn: @conn
|
||||
span.image_uploader
|
||||
' by
|
||||
=> 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
|
||||
|
|
||||
= @image.image_width
|
||||
|
|
|
@ -104,19 +104,16 @@ defmodule PhilomenaWeb.AppView do
|
|||
|> to_string()
|
||||
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
|
||||
if ip do
|
||||
ip
|
||||
else
|
||||
"N/A"
|
||||
end
|
||||
link(text_or_na(ip), to: "#")
|
||||
end
|
||||
|
||||
# todo: make fp a real link
|
||||
def link_to_fingerprint(fp) do
|
||||
if fp do
|
||||
fp |> String.slice(0..6)
|
||||
else
|
||||
"N/A"
|
||||
end
|
||||
link(String.slice(text_or_na(fp), 0..6), to: "#")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue