icons on ip/fp info

This commit is contained in:
Luna D 2019-12-10 11:29:54 -05:00
parent 37e620aee9
commit 64d789c357
No known key found for this signature in database
GPG key ID: D0F46C94720BAA4B

View file

@ -127,14 +127,26 @@ defmodule PhilomenaWeb.AppView do
end end
defp text_or_na(nil), do: "N/A" defp text_or_na(nil), do: "N/A"
defp text_or_na(text), do: text defp text_or_na(text), do: to_string(text)
def link_to_ip(conn, ip) do def link_to_ip(conn, ip) do
link(text_or_na(ip), to: Routes.ip_profile_path(conn, :show, to_string(ip))) link(to: Routes.ip_profile_path(conn, :show, to_string(ip))) do
[
content_tag(:i, "", class: "fas fa-network-wired"),
" ",
text_or_na(ip)
]
end
end end
def link_to_fingerprint(conn, fp) do def link_to_fingerprint(conn, fp) do
link(String.slice(text_or_na(fp), 0..6), to: Routes.fingerprint_profile_path(conn, :show, fp)) link(to: Routes.fingerprint_profile_path(conn, :show, fp)) do
[
content_tag(:i, "", class: "fas fa-desktop"),
" ",
String.slice(text_or_na(fp), 0..6)
]
end
end end
def blank?(nil), do: true def blank?(nil), do: true