mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
truncated_ip_link
This commit is contained in:
parent
42039491b6
commit
9ba670c864
4 changed files with 4 additions and 5 deletions
|
@ -21,7 +21,7 @@
|
|||
= link image.user.name, to: ~p"/profiles/#{image.user}"
|
||||
- else
|
||||
em>
|
||||
= truncated_ip_link(@conn, image.ip)
|
||||
= truncated_ip_link(image.ip)
|
||||
= link_to_fingerprint(@conn, image.fingerprint)
|
||||
span = pretty_time(image.created_at)
|
||||
.approval-items--footer
|
||||
|
|
|
@ -21,7 +21,7 @@ table.table
|
|||
= link report.user.name, to: ~p"/profiles/#{report.user}"
|
||||
- else
|
||||
em>
|
||||
= truncated_ip_link(@conn, report.ip)
|
||||
= truncated_ip_link(report.ip)
|
||||
= link_to_fingerprint(@conn, report.fingerprint)
|
||||
|
||||
= if not is_nil(report.user) and Enum.any?(report.user.linked_tags) do
|
||||
|
|
|
@ -3,8 +3,7 @@ defmodule PhilomenaWeb.Admin.ApprovalView do
|
|||
|
||||
alias PhilomenaWeb.Admin.ReportView
|
||||
|
||||
# Shamelessly copied from ReportView
|
||||
def truncated_ip_link(conn, ip), do: ReportView.truncated_ip_link(conn, ip)
|
||||
def truncated_ip_link(ip), do: ReportView.truncated_ip_link(ip)
|
||||
|
||||
def image_thumb(conn, image) do
|
||||
render(PhilomenaWeb.ImageView, "_image_container.html",
|
||||
|
|
|
@ -25,7 +25,7 @@ defmodule PhilomenaWeb.Admin.ReportView do
|
|||
def truncate(<<string::binary-size(50), _rest::binary>>), 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
|
||||
<<string::binary-size(25), _rest::binary>> = ip ->
|
||||
link(string <> "...", to: ~p"/ip_profiles/#{ip}")
|
||||
|
|
Loading…
Reference in a new issue