mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27:59 +01:00
truncate FP and use helpers
This commit is contained in:
parent
01de0bdca7
commit
2b0e65e85e
2 changed files with 17 additions and 1 deletions
|
@ -27,7 +27,7 @@ article.block.communication id="comment_#{@comment.id}"
|
||||||
.communication__info
|
.communication__info
|
||||||
=<> @comment.ip
|
=<> @comment.ip
|
||||||
.communication__info
|
.communication__info
|
||||||
=<> @comment.fingerprint
|
=<> link_to_fingerprint(@comment.fingerprint)
|
||||||
/- if can?(:hide, Comment)
|
/- if can?(:hide, Comment)
|
||||||
/ .js-staff-action
|
/ .js-staff-action
|
||||||
/ - if !comment.hidden_from_users && !comment.destroyed_content
|
/ - if !comment.hidden_from_users && !comment.destroyed_content
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
defmodule PhilomenaWeb.CommentView do
|
defmodule PhilomenaWeb.CommentView do
|
||||||
use PhilomenaWeb, :view
|
use PhilomenaWeb, :view
|
||||||
|
|
||||||
|
def link_to_ip(ip) do
|
||||||
|
if ip do
|
||||||
|
ip
|
||||||
|
else
|
||||||
|
"N/A"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def link_to_fingerprint(fp) do
|
||||||
|
if fp do
|
||||||
|
fp |> String.slice(0..6)
|
||||||
|
else
|
||||||
|
"N/A"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue