truncated_ip_link

This commit is contained in:
Liam 2024-04-28 21:13:51 -04:00
parent 42039491b6
commit 9ba670c864
4 changed files with 4 additions and 5 deletions

View file

@ -21,7 +21,7 @@
= link image.user.name, to: ~p"/profiles/#{image.user}" = link image.user.name, to: ~p"/profiles/#{image.user}"
- else - else
em> em>
= truncated_ip_link(@conn, image.ip) = truncated_ip_link(image.ip)
= link_to_fingerprint(@conn, image.fingerprint) = link_to_fingerprint(@conn, image.fingerprint)
span = pretty_time(image.created_at) span = pretty_time(image.created_at)
.approval-items--footer .approval-items--footer

View file

@ -21,7 +21,7 @@ table.table
= link report.user.name, to: ~p"/profiles/#{report.user}" = link report.user.name, to: ~p"/profiles/#{report.user}"
- else - else
em> em>
= truncated_ip_link(@conn, report.ip) = truncated_ip_link(report.ip)
= link_to_fingerprint(@conn, report.fingerprint) = link_to_fingerprint(@conn, report.fingerprint)
= if not is_nil(report.user) and Enum.any?(report.user.linked_tags) do = if not is_nil(report.user) and Enum.any?(report.user.linked_tags) do

View file

@ -3,8 +3,7 @@ defmodule PhilomenaWeb.Admin.ApprovalView do
alias PhilomenaWeb.Admin.ReportView alias PhilomenaWeb.Admin.ReportView
# Shamelessly copied from ReportView def truncated_ip_link(ip), do: ReportView.truncated_ip_link(ip)
def truncated_ip_link(conn, ip), do: ReportView.truncated_ip_link(conn, ip)
def image_thumb(conn, image) do def image_thumb(conn, image) do
render(PhilomenaWeb.ImageView, "_image_container.html", render(PhilomenaWeb.ImageView, "_image_container.html",

View file

@ -25,7 +25,7 @@ defmodule PhilomenaWeb.Admin.ReportView do
def truncate(<<string::binary-size(50), _rest::binary>>), do: string <> "..." def truncate(<<string::binary-size(50), _rest::binary>>), do: string <> "..."
def truncate(string), do: string def truncate(string), do: string
def truncated_ip_link(conn, ip) do def truncated_ip_link(ip) do
case to_string(ip) do case to_string(ip) do
<<string::binary-size(25), _rest::binary>> = ip -> <<string::binary-size(25), _rest::binary>> = ip ->
link(string <> "...", to: ~p"/ip_profiles/#{ip}") link(string <> "...", to: ~p"/ip_profiles/#{ip}")