Merge pull request #180 from philomena-dev/mod-note-display

Make mod notes show the tag name instead of the requesting user
This commit is contained in:
Meow 2023-05-18 11:27:51 +02:00 committed by GitHub
commit c401695513
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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))