From 433cffa5aee1d0d2fd6e9a3312496b7b0e1bd347 Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Fri, 2 Oct 2026 08:06:26 +0330 Subject: [PATCH] people tags #387 --- .../Pages/ReviewPersonRelationEdits.cshtml | 2 ++ GanjooRazor/Areas/User/Pages/Editor.cshtml | 2 ++ .../Pages/SuggestNewPersonRelation.cshtml | 4 +++ .../Pages/SuggestNewPersonRelation.cshtml.cs | 25 +++++++++++++++++-- .../Pages/SuggestPersonRelationEdit.cshtml | 2 ++ GanjooRazor/Pages/PersonWindow.cshtml.cs | 2 ++ GanjooRazor/wwwroot/js/peoplegraph.js | 4 ++- .../Models/Ganjoor/PersonAffiliationType.cs | 12 +++++++++ RMuseum/RMuseum.xml | 12 +++++++++ 9 files changed, 62 insertions(+), 3 deletions(-) diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewPersonRelationEdits.cshtml b/GanjooRazor/Areas/Admin/Pages/ReviewPersonRelationEdits.cshtml index 992eec90..14e8b861 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewPersonRelationEdits.cshtml +++ b/GanjooRazor/Areas/Admin/Pages/ReviewPersonRelationEdits.cshtml @@ -32,6 +32,8 @@ case PersonAffiliationType.Servant: return "خدمتگزار"; case PersonAffiliationType.Companion: return "همدم"; case PersonAffiliationType.Successor: return "جانشین"; + case PersonAffiliationType.Panegyrized: return "مدح‌گو"; + case PersonAffiliationType.Satirized: return "هجوگو"; case PersonAffiliationType.Other: return "نوع دیگر"; default: return t.ToString(); } diff --git a/GanjooRazor/Areas/User/Pages/Editor.cshtml b/GanjooRazor/Areas/User/Pages/Editor.cshtml index 03c3ada8..88e145c2 100644 --- a/GanjooRazor/Areas/User/Pages/Editor.cshtml +++ b/GanjooRazor/Areas/User/Pages/Editor.cshtml @@ -262,6 +262,8 @@ '' + '' + '' + + '' + + '' + '' + '' + '' + diff --git a/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml b/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml index 2c509e16..06df78c0 100644 --- a/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml +++ b/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml @@ -94,6 +94,10 @@ else + + + + diff --git a/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml.cs b/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml.cs index 23bfeab3..375e53dc 100644 --- a/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml.cs +++ b/GanjooRazor/Areas/User/Pages/SuggestNewPersonRelation.cshtml.cs @@ -148,8 +148,9 @@ namespace GanjooRazor.Areas.User.Pages // OtherIsPerson1/SubjectIsPerson1 pairs translate the direction-aware choice into the // symmetric Person1Id/Person2Id pair, following the direction each PersonAffiliationType // value's own doc comment defines (Minister/Advisor/Courtier/Servant: Person1 is the - // subordinate one; Patron/Successor: Person1 is the patron/later one; Ally/Rival/ - // Companion/Other: symmetric, direction doesn't matter) + // subordinate one; Patron/Successor: Person1 is the patron/later one; Panegyrized/ + // Satirized: Person1 is the poet; Ally/Rival/Companion/Other: symmetric, direction + // doesn't matter) switch (AffiliationKind) { case "Minister_Other": // the other person served as minister to this one @@ -212,6 +213,26 @@ namespace GanjooRazor.Areas.User.Pages suggestion.Person2Id = OtherPersonId; suggestion.SuggestedAffiliationType = PersonAffiliationType.Successor; break; + case "Panegyrized_Other": // the other person (a poet) wrote praise poetry about this one + suggestion.Person1Id = OtherPersonId; + suggestion.Person2Id = personId; + suggestion.SuggestedAffiliationType = PersonAffiliationType.Panegyrized; + break; + case "Panegyrized_Subject": // this person (a poet) wrote praise poetry about the other one + suggestion.Person1Id = personId; + suggestion.Person2Id = OtherPersonId; + suggestion.SuggestedAffiliationType = PersonAffiliationType.Panegyrized; + break; + case "Satirized_Other": // the other person (a poet) wrote satirical poetry about this one + suggestion.Person1Id = OtherPersonId; + suggestion.Person2Id = personId; + suggestion.SuggestedAffiliationType = PersonAffiliationType.Satirized; + break; + case "Satirized_Subject": // this person (a poet) wrote satirical poetry about the other one + suggestion.Person1Id = personId; + suggestion.Person2Id = OtherPersonId; + suggestion.SuggestedAffiliationType = PersonAffiliationType.Satirized; + break; case "Ally": suggestion.Person1Id = personId; suggestion.Person2Id = OtherPersonId; diff --git a/GanjooRazor/Areas/User/Pages/SuggestPersonRelationEdit.cshtml b/GanjooRazor/Areas/User/Pages/SuggestPersonRelationEdit.cshtml index 55d48b99..51ac629c 100644 --- a/GanjooRazor/Areas/User/Pages/SuggestPersonRelationEdit.cshtml +++ b/GanjooRazor/Areas/User/Pages/SuggestPersonRelationEdit.cshtml @@ -64,6 +64,8 @@ else + + diff --git a/GanjooRazor/Pages/PersonWindow.cshtml.cs b/GanjooRazor/Pages/PersonWindow.cshtml.cs index 425018b6..e4cbb8db 100644 --- a/GanjooRazor/Pages/PersonWindow.cshtml.cs +++ b/GanjooRazor/Pages/PersonWindow.cshtml.cs @@ -113,6 +113,8 @@ namespace GanjooRazor.Pages { PersonAffiliationType.Servant, "خدمتکارِ" }, { PersonAffiliationType.Companion, "همراهِ" }, { PersonAffiliationType.Successor, "جانشینِ" }, + { PersonAffiliationType.Panegyrized, "مدح‌گویِ" }, + { PersonAffiliationType.Satirized, "هجوگویِ" }, { PersonAffiliationType.Other, "دارای نسبتی (به یادداشت نگاه کنید) با" }, }; diff --git a/GanjooRazor/wwwroot/js/peoplegraph.js b/GanjooRazor/wwwroot/js/peoplegraph.js index 698a961d..43845200 100644 --- a/GanjooRazor/wwwroot/js/peoplegraph.js +++ b/GanjooRazor/wwwroot/js/peoplegraph.js @@ -8,7 +8,7 @@ // person2Id, person2Name, category, typeValue, degreeHint, note}] } where category is // "Relation" (typeValue is PersonRelationType: 0=Parent,1=Sibling,2=Spouse,3=Ancestor) or // "Affiliation" (typeValue is PersonAffiliationType: 0=Minister,1=Advisor,2=Courtier,3=Patron, -// 4=Ally,5=Rival,6=Servant,7=Companion,8=Successor,99=Other). directlyTagged is false only on +// 4=Ally,5=Rival,6=Servant,7=Companion,8=Successor,9=Panegyrized,10=Satirized,99=Other). directlyTagged is false only on // the category-scoped graph (GET api/ganjoor/cat/{id}/persongraph, the "characters in this work" // tab): such a node was pulled in as a one-hop relative/affiliate of someone actually named in the // work's verses, and is never false on the whole-site graph fed by PeopleExplorer.cshtml. @@ -46,6 +46,8 @@ 'Affiliation:6': { label: 'خدمتکار', color: '#c07a2b', directional: true }, 'Affiliation:7': { label: 'همراه', color: '#5aa08a', directional: false }, 'Affiliation:8': { label: 'جانشین', color: '#8a4ac0', directional: true }, + 'Affiliation:9': { label: 'مدح‌گو', color: '#b08a2a', directional: true }, + 'Affiliation:10': { label: 'هجوگو', color: '#7a3a9a', directional: true }, 'Affiliation:99': { label: 'سایر', color: '#888888', directional: false } }; diff --git a/RMuseum/Models/Ganjoor/PersonAffiliationType.cs b/RMuseum/Models/Ganjoor/PersonAffiliationType.cs index 4e3be546..5b57fc47 100644 --- a/RMuseum/Models/Ganjoor/PersonAffiliationType.cs +++ b/RMuseum/Models/Ganjoor/PersonAffiliationType.cs @@ -58,6 +58,18 @@ namespace RMuseum.Models.Ganjoor /// Successor = 8, + /// + /// Person1 (a poet) wrote panegyric/praise poetry (قصیدهٔ مدح) about Person2 (the ممدوح - + /// the praised patron/king/dignitary) - directional, same convention as Minister/Patron + /// + Panegyrized = 9, + + /// + /// Person1 (a poet) wrote satirical/mocking poetry (هجو) about Person2 (the هجو شده - + /// the satire's target) - directional, same convention as Minister/Patron + /// + Satirized = 10, + /// /// doesn't fit any of the above - rely on Note for what the tie actually is /// diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index 161a99d4..6d6ea177 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -11856,6 +11856,18 @@ came after) + + + Person1 (a poet) wrote panegyric/praise poetry (قصیدهٔ مدح) about Person2 (the ممدوح - + the praised patron/king/dignitary) - directional, same convention as Minister/Patron + + + + + Person1 (a poet) wrote satirical/mocking poetry (هجو) about Person2 (the هجو شده - + the satire's target) - directional, same convention as Minister/Patron + + doesn't fit any of the above - rely on Note for what the tie actually is