mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-23 01:18:00 +01:00
24 lines
771 B
Elixir
24 lines
771 B
Elixir
defmodule PhilomenaWeb.Admin.ModNoteView do
|
|
use PhilomenaWeb, :view
|
|
|
|
alias Philomena.Users.User
|
|
alias Philomena.Reports.Report
|
|
alias Philomena.DnpEntries.DnpEntry
|
|
|
|
def link_to_noted_thing(%DnpEntry{tag: tag} = dnp_entry),
|
|
do: link("DNP entry for #{tag.name}", to: ~p"/dnp/#{dnp_entry}")
|
|
|
|
def link_to_noted_thing(%Report{user: nil} = report),
|
|
do: link("Report #{report.id}", to: ~p"/admin/reports/#{report}")
|
|
|
|
def link_to_noted_thing(%Report{user: user} = report),
|
|
do:
|
|
link("Report #{report.id} by #{user.name}",
|
|
to: ~p"/admin/reports/#{report}"
|
|
)
|
|
|
|
def link_to_noted_thing(%User{} = user),
|
|
do: link("User #{user.name}", to: ~p"/profiles/#{user}")
|
|
|
|
def link_to_noted_thing(_notable), do: "Item permanently deleted"
|
|
end
|