Make mod notes show the tag name instead of the requesting user

This commit is contained in:
byte[] 2023-04-24 14:38:05 -04:00
parent a239015484
commit a82664720f
2 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@ defmodule Philomena.Polymorphic do
"Comment" => [:user, image: [tags: :aliases]], "Comment" => [:user, image: [tags: :aliases]],
"Commission" => [:user], "Commission" => [:user],
"Conversation" => [:from, :to], "Conversation" => [:from, :to],
"DnpEntry" => [:requesting_user], "DnpEntry" => [:requesting_user, :tag],
"Gallery" => [:creator], "Gallery" => [:creator],
"Image" => [:user, tags: :aliases], "Image" => [:user, tags: :aliases],
"Post" => [:user, topic: :forum], "Post" => [:user, topic: :forum],

View file

@ -5,8 +5,8 @@ defmodule PhilomenaWeb.Admin.ModNoteView do
alias Philomena.Reports.Report alias Philomena.Reports.Report
alias Philomena.DnpEntries.DnpEntry alias Philomena.DnpEntries.DnpEntry
def link_to_noted_thing(conn, %DnpEntry{requesting_user: user} = dnp_entry), def link_to_noted_thing(conn, %DnpEntry{tag: tag} = dnp_entry),
do: link("#{user.name}'s DNP entry", to: Routes.dnp_entry_path(conn, :show, dnp_entry)) do: link("DNP entry for #{tag.name}", to: Routes.dnp_entry_path(conn, :show, dnp_entry))
def link_to_noted_thing(conn, %Report{user: nil} = report), def link_to_noted_thing(conn, %Report{user: nil} = report),
do: link("Report #{report.id}", to: Routes.admin_report_path(conn, :show, report)) do: link("Report #{report.id}", to: Routes.admin_report_path(conn, :show, report))