From a82664720fce65ee7b7223b3ed5847ba03d13919 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Mon, 24 Apr 2023 14:38:05 -0400 Subject: [PATCH] Make mod notes show the tag name instead of the requesting user --- lib/philomena/polymorphic.ex | 2 +- lib/philomena_web/views/admin/mod_note_view.ex | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/philomena/polymorphic.ex b/lib/philomena/polymorphic.ex index 0293355d..dce694d5 100644 --- a/lib/philomena/polymorphic.ex +++ b/lib/philomena/polymorphic.ex @@ -23,7 +23,7 @@ defmodule Philomena.Polymorphic do "Comment" => [:user, image: [tags: :aliases]], "Commission" => [:user], "Conversation" => [:from, :to], - "DnpEntry" => [:requesting_user], + "DnpEntry" => [:requesting_user, :tag], "Gallery" => [:creator], "Image" => [:user, tags: :aliases], "Post" => [:user, topic: :forum], diff --git a/lib/philomena_web/views/admin/mod_note_view.ex b/lib/philomena_web/views/admin/mod_note_view.ex index 7627598d..a873208a 100644 --- a/lib/philomena_web/views/admin/mod_note_view.ex +++ b/lib/philomena_web/views/admin/mod_note_view.ex @@ -5,8 +5,8 @@ defmodule PhilomenaWeb.Admin.ModNoteView do alias Philomena.Reports.Report alias Philomena.DnpEntries.DnpEntry - def link_to_noted_thing(conn, %DnpEntry{requesting_user: user} = dnp_entry), - do: link("#{user.name}'s DNP entry", to: Routes.dnp_entry_path(conn, :show, dnp_entry)) + def link_to_noted_thing(conn, %DnpEntry{tag: tag} = 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), do: link("Report #{report.id}", to: Routes.admin_report_path(conn, :show, report))