people tags #387

This commit is contained in:
Hamid Reza Mohammadi 2026-09-30 18:31:59 +03:30
parent f305394ad7
commit eb88056d0b
14 changed files with 295 additions and 356 deletions

View File

@ -958,7 +958,7 @@ else
@if (geoTag.PersonId != null)
{
<text>شخصیت: @(geoTag.Person != null ? geoTag.Person.Name : $"شخصیت #{geoTag.PersonId}")</text>
<a href="/SuggestPersonEdit/@geoTag.PersonId" target="_blank" class="up-icon-btn" title="پیشنهاد ویرایش این شخصیت" aria-label="پیشنهاد ویرایش این شخصیت">✎</a>
<a href="/User/SuggestPersonEdit?id=@geoTag.PersonId" target="_blank" class="up-icon-btn" title="پیشنهاد ویرایش این شخصیت" aria-label="پیشنهاد ویرایش این شخصیت">✎</a>
}
else if (personGraph?.Person != null)
{

View File

@ -0,0 +1,80 @@
@page
@model GanjooRazor.Areas.User.Pages.SuggestNewPersonRelationModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_UserPanelLayout";
ViewData["Title"] = "پیشنهاد خویشاوند جدید";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
}
@if (!string.IsNullOrEmpty(Model.LastError))
{
<div class="up-alert up-alert--danger">@Model.LastError</div>
}
else
{
<div class="up-page-header">
<h1>پیشنهاد خویشاوند جدید برای: @Model.Person.Name</h1>
</div>
<p class="up-hint">
این پیشنهاد مستقیماً اعمال نمی‌شود؛ پس از بررسی و تأیید توسط مدیران، به شجره‌نامهٔ
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Person.Id)">@Model.Person.Name</a> افزوده خواهد شد.
</p>
@if (!string.IsNullOrEmpty(Model.LastResult))
{
<p>@Html.Raw(Model.LastResult)</p>
}
<div class="up-card">
<form method="post" action="/User/SuggestNewPersonRelation?personId=@Model.Person.Id&amp;Handler=Suggest">
@Html.AntiForgeryToken()
<table>
<tr>
<td>خویشاوند:</td>
<td>
<select asp-for="OtherPersonId">
<option value="0">— انتخاب کنید —</option>
@foreach (var p in Model.OtherPeople)
{
<option value="@p.Id">@p.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>نسبت با @Model.Person.Name:</td>
<td>
<select asp-for="RelationKind">
<option value="Child">فرزند این شخصیت است</option>
<option value="Parent">پدر یا مادر این شخصیت است</option>
<option value="Sibling">خواهر یا برادر این شخصیت است</option>
<option value="Spouse">همسر این شخصیت است</option>
<option value="DistantAncestor">نیای دور این شخصیت است (بدون نسل مشخص)</option>
<option value="DistantDescendant">نوادهٔ دور این شخصیت است (بدون نسل مشخص)</option>
</select>
</td>
</tr>
<tr>
<td>
درجه (فقط برای نیا/نواده):
<p class="up-hint"><small>مثلاً برای پدربزرگ/مادربزرگ عدد ۲ را وارد کنید. اگر نمی‌دانید خالی بگذارید.</small></p>
</td>
<td><input asp-for="DegreeHint" /></td>
</tr>
<tr>
<td>یادداشت (مستندسازی):</td>
<td><textarea asp-for="Note" rows="3" cols="60"></textarea></td>
</tr>
<tr>
<td>یادداشت برای مدیر بررسی‌کننده:</td>
<td><textarea asp-for="SuggestionNote" rows="3" cols="60"></textarea></td>
</tr>
</table>
<input type="submit" value="ثبت پیشنهاد" class="up-btn up-btn--success" />
<a role="button" href="javascript:void(0)" onclick="history.back()" class="up-btn up-btn--ghost">انصراف</a>
</form>
</div>
}

View File

@ -4,13 +4,14 @@ using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using GanjooRazor.Pages;
using GanjooRazor.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using RMuseum.Models.Ganjoor;
namespace GanjooRazor.Pages
namespace GanjooRazor.Areas.User.Pages
{
/// <summary>
/// contributor-facing form for suggesting a brand new kinship edge between the subject person
@ -85,7 +86,7 @@ namespace GanjooRazor.Pages
if (!LoggedIn)
{
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path)}");
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path + Request.QueryString)}");
}
await PreparePersonAsync(personId);
@ -99,7 +100,7 @@ namespace GanjooRazor.Pages
if (!LoggedIn)
{
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path)}");
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path + Request.QueryString)}");
}
LastResult = "";

View File

@ -0,0 +1,109 @@
@page
@model GanjooRazor.Areas.User.Pages.SuggestPersonEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_UserPanelLayout";
ViewData["Title"] = "پیشنهاد ویرایش شخصیت";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
}
@if (!string.IsNullOrEmpty(Model.LastError))
{
<div class="up-alert up-alert--danger">@Model.LastError</div>
}
else
{
<div class="up-page-header">
<h1>پیشنهاد ویرایش: @Model.Person.Name</h1>
</div>
<p class="up-hint">
این پیشنهاد مستقیماً اعمال نمی‌شود؛ پس از بررسی و تأیید توسط مدیران، در مشخصات
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Person.Id)">@Model.Person.Name</a> اعمال خواهد شد.
</p>
@if (!string.IsNullOrEmpty(Model.LastResult))
{
<p>@Html.Raw(Model.LastResult)</p>
}
<div class="up-card">
<form method="post" action="/User/SuggestPersonEdit?id=@Model.Person.Id&amp;Handler=SuggestEdit">
@Html.AntiForgeryToken()
<input type="hidden" asp-for="Suggestion.PersonId" />
<table>
<tr>
<td>پیشنهاد حذف این شخصیت:</td>
<td>
<input asp-for="Suggestion.SuggestedForDeletion" id="suggestedForDeletion" />
<p class="up-hint"><small>در صورت انتخاب این گزینه سایر فیلدها نادیده گرفته خواهد شد و در صورت تأیید مدیران، این شخصیت و همهٔ نسبت‌ها/وابستگی‌های آن حذف می‌شود.</small></p>
</td>
</tr>
<tr>
<td>نام:</td>
<td><input asp-for="Suggestion.SuggestedName" size="40" /></td>
</tr>
<tr>
<td>نشانی ویکی‌پدیا:</td>
<td><input style="text-align:left;direction:ltr;" asp-for="Suggestion.SuggestedWikiUrl" size="60" /></td>
</tr>
<tr>
<td>زاده:</td>
<td><input asp-for="Suggestion.SuggestedBirthYearInLHijri" /> (قمری)</td>
</tr>
<tr>
<td>تاریخ تولد مستند است:</td>
<td><input asp-for="Suggestion.SuggestedValidBirthDate" /></td>
</tr>
<tr>
<td>زادگاه:</td>
<td>
<select asp-for="Suggestion.SuggestedBirthLocationId">
@foreach (var location in Model.Locations)
{
<option value="@(location.Id == 0 ? "" : location.Id.ToString())">@location.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>درگذشته:</td>
<td><input asp-for="Suggestion.SuggestedDeathYearInLHijri" /> (قمری)</td>
</tr>
<tr>
<td>تاریخ وفات مستند است:</td>
<td><input asp-for="Suggestion.SuggestedValidDeathDate" /></td>
</tr>
<tr>
<td>آرامگاه:</td>
<td>
<select asp-for="Suggestion.SuggestedDeathLocationId">
@foreach (var location in Model.Locations)
{
<option value="@(location.Id == 0 ? "" : location.Id.ToString())">@location.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>
عنوان شجره‌نامه:
<p class="up-hint"><small>پُر کنید تا این شخصیت در <a href="javascript:void(0)" onclick="PeopleExplorer.open()">فهرست شجره‌نامه‌ها</a> با این عنوان دیده شود.</small></p>
</td>
<td><input asp-for="Suggestion.SuggestedFamilyTreeCaption" size="40" /></td>
</tr>
<tr>
<td>توضیحات:</td>
<td><textarea asp-for="Suggestion.SuggestedDescription" rows="10" cols="60"></textarea></td>
</tr>
<tr>
<td>یادداشت برای مدیر بررسی‌کننده:</td>
<td><textarea asp-for="Suggestion.SuggestionNote" rows="3" cols="60"></textarea></td>
</tr>
</table>
<input type="submit" value="ثبت پیشنهاد" class="up-btn up-btn--success" />
<a role="button" href="javascript:void(0)" onclick="history.back()" class="up-btn up-btn--ghost">انصراف</a>
</form>
</div>
}

View File

@ -3,13 +3,14 @@ using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using GanjooRazor.Pages;
using GanjooRazor.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using RMuseum.Models.Ganjoor;
namespace GanjooRazor.Pages
namespace GanjooRazor.Areas.User.Pages
{
/// <summary>
/// contributor-facing form for suggesting an edit to an already-approved GanjoorRelatedPerson.
@ -97,7 +98,7 @@ namespace GanjooRazor.Pages
if (!LoggedIn)
{
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path)}");
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path + Request.QueryString)}");
}
await ReadLocationsAsync();
@ -118,7 +119,7 @@ namespace GanjooRazor.Pages
if (!LoggedIn)
{
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path)}");
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path + Request.QueryString)}");
}
LastResult = "";

View File

@ -0,0 +1,82 @@
@page
@model GanjooRazor.Areas.User.Pages.SuggestPersonRelationEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using RMuseum.Models.Ganjoor
@{
Layout = "_UserPanelLayout";
ViewData["Title"] = "پیشنهاد ویرایش نسبت خویشاوندی";
await GanjooRazor.Utils.GanjoorSessionChecker.ApplyPermissionsToViewData(Request, Response, ViewData);
}
@if (!string.IsNullOrEmpty(Model.LastError))
{
<div class="up-alert up-alert--danger">@Model.LastError</div>
}
else
{
<div class="up-page-header">
<h1>
پیشنهاد ویرایش نسبت:
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Relation.Person1Id)">@(Model.Relation.Person1 != null ? Model.Relation.Person1.Name : Model.Relation.Person1Id.ToString())</a>
و
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Relation.Person2Id)">@(Model.Relation.Person2 != null ? Model.Relation.Person2.Name : Model.Relation.Person2Id.ToString())</a>
</h1>
</div>
<p class="up-hint">
این پیشنهاد مستقیماً اعمال نمی‌شود؛ پس از بررسی و تأیید توسط مدیران اعمال خواهد شد.
</p>
@if (!string.IsNullOrEmpty(Model.LastResult))
{
<p>@Html.Raw(Model.LastResult)</p>
}
<div class="up-card">
<form method="post" action="/User/SuggestPersonRelationEdit?relationId=@Model.Relation.Id&amp;Handler=SuggestEdit">
@Html.AntiForgeryToken()
<input type="hidden" asp-for="Suggestion.ExistingRelationId" />
<input type="hidden" asp-for="Suggestion.Person1Id" />
<input type="hidden" asp-for="Suggestion.Person2Id" />
<table>
<tr>
<td>نوع درخواست:</td>
<td>
<label><input type="radio" name="Action" value="Modify" checked="checked" /> ویرایش این نسبت</label>
&nbsp;
<label><input type="radio" name="Action" value="Remove" /> حذف این نسبت (اشتباه ثبت شده است)</label>
</td>
</tr>
<tr>
<td>نوع نسبت:</td>
<td>
<select asp-for="Suggestion.SuggestedRelationType">
<option value="@((int)PersonRelationType.Parent)">پدر/مادر و فرزند (طرف اول، پدر/مادر است)</option>
<option value="@((int)PersonRelationType.Sibling)">خواهر/برادر</option>
<option value="@((int)PersonRelationType.Spouse)">همسر</option>
<option value="@((int)PersonRelationType.Ancestor)">نیا و نواده (طرف اول، نیاست)</option>
</select>
</td>
</tr>
<tr>
<td>
درجه (فقط برای نیا/نواده):
<p class="up-hint"><small>مثلاً برای پدربزرگ/مادربزرگ عدد ۲ را وارد کنید. اگر نمی‌دانید خالی بگذارید.</small></p>
</td>
<td><input asp-for="Suggestion.SuggestedDegreeHint" /></td>
</tr>
<tr>
<td>یادداشت (مستندسازی):</td>
<td><textarea asp-for="Suggestion.SuggestedNote" rows="3" cols="60"></textarea></td>
</tr>
<tr>
<td>یادداشت برای مدیر بررسی‌کننده:</td>
<td><textarea asp-for="Suggestion.SuggestionNote" rows="3" cols="60"></textarea></td>
</tr>
</table>
<input type="submit" value="ثبت پیشنهاد" class="up-btn up-btn--success" />
<a role="button" href="javascript:void(0)" onclick="history.back()" class="up-btn up-btn--ghost">انصراف</a>
</form>
</div>
}

View File

@ -2,13 +2,14 @@ using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using GanjooRazor.Pages;
using GanjooRazor.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using RMuseum.Models.Ganjoor;
namespace GanjooRazor.Pages
namespace GanjooRazor.Areas.User.Pages
{
/// <summary>
/// contributor-facing form for suggesting a change to, or removal of, an existing
@ -75,7 +76,7 @@ namespace GanjooRazor.Pages
if (!LoggedIn)
{
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path)}");
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path + Request.QueryString)}");
}
if (!await PrepareRelationAsync(relationId))
@ -94,7 +95,7 @@ namespace GanjooRazor.Pages
if (!LoggedIn)
{
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path)}");
return Redirect($"/login?redirect={Uri.EscapeDataString(Request.Path + Request.QueryString)}");
}
LastResult = "";

View File

@ -15,7 +15,7 @@ else
@Model.Person.Name
@if (Model.LoggedIn)
{
<a href="/SuggestPersonEdit/@Model.Person.Id" class="up-icon-btn" title="پیشنهاد ویرایش این شخصیت" aria-label="پیشنهاد ویرایش این شخصیت">✎</a>
<a href="/User/SuggestPersonEdit?id=@Model.Person.Id" class="up-icon-btn" title="پیشنهاد ویرایش این شخصیت" aria-label="پیشنهاد ویرایش این شخصیت">✎</a>
}
</h2>
@ -55,7 +55,7 @@ else
<a href="/FamilyTree/@Model.Person.Id" class="up-btn up-btn--ghost up-btn--sm">نمایش نمودار شجره‌نامه</a>
@if (Model.LoggedIn)
{
<a href="/SuggestNewPersonRelation/@Model.Person.Id" class="up-btn up-btn--ghost up-btn--sm">افزودن خویشاوند جدید</a>
<a href="/User/SuggestNewPersonRelation?personId=@Model.Person.Id" class="up-btn up-btn--ghost up-btn--sm">افزودن خویشاوند جدید</a>
}
</h3>
<ul>
@ -69,7 +69,7 @@ else
}
@if (Model.LoggedIn)
{
<a href="/SuggestPersonRelationEdit/@row.RelationId" class="up-icon-btn" title="پیشنهاد ویرایش/حذف این نسبت" aria-label="پیشنهاد ویرایش/حذف این نسبت">✎</a>
<a href="/User/SuggestPersonRelationEdit?relationId=@row.RelationId" class="up-icon-btn" title="پیشنهاد ویرایش/حذف این نسبت" aria-label="پیشنهاد ویرایش/حذف این نسبت">✎</a>
}
</li>
}
@ -79,7 +79,7 @@ else
{
<h3>
خویشاوندان
<a href="/SuggestNewPersonRelation/@Model.Person.Id" class="up-btn up-btn--ghost up-btn--sm">افزودن خویشاوند جدید</a>
<a href="/User/SuggestNewPersonRelation?personId=@Model.Person.Id" class="up-btn up-btn--ghost up-btn--sm">افزودن خویشاوند جدید</a>
</h3>
}

View File

@ -39,6 +39,11 @@
</script>
<script src="/lib/diff.js"></script>
<script src="~/js/bk.js" asp-append-version="true"></script>
<!-- PersonWindow.open()/PeopleExplorer.open() are used by pages under Areas/User/Pages (e.g. the
Suggest* person-editing forms), so they're loaded globally here, same as _Layout.cshtml and
_AdminLayout.cshtml do for the rest of the site. -->
<script src="~/js/peoplegraph.js" asp-append-version="true"></script>
<script src="~/js/personwindow.js" asp-append-version="true"></script>
<script>
function compareCorrectionBlocks(originalElemenyId, editedElementId, resultElementId) {
var a = document.getElementById(originalElemenyId);

View File

@ -1,103 +0,0 @@
@page "{personId:int}"
@model GanjooRazor.Pages.SuggestNewPersonRelationModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
ViewData["Title"] = "گنجور » پیشنهاد خویشاوند جدید";
}
@section Head {
<meta name="robots" content="noindex, nofollow" />
}
@if (!string.IsNullOrEmpty(Model.LastError))
{
@Model.LastError
}
else
{
<!-- #hdr2 -->
<div id="fa">
<div id="maincnt">
<partial name="_InlineLoginPartial" model="Model" />
<div class="spacer">&nbsp;</div>
<div class="poem">
<h1>پیشنهاد خویشاوند جدید برای: @Model.Person.Name</h1>
<p class="up-hint">
این پیشنهاد مستقیماً اعمال نمی‌شود؛ پس از بررسی و تأیید توسط مدیران، به شجره‌نامهٔ
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Person.Id)">@Model.Person.Name</a> افزوده خواهد شد.
</p>
@if (!string.IsNullOrEmpty(Model.LastResult))
{
<p>@Html.Raw(Model.LastResult)</p>
}
<form method="post" action="/SuggestNewPersonRelation/@Model.Person.Id?Handler=Suggest">
@Html.AntiForgeryToken()
<table>
<tr>
<td>خویشاوند:</td>
<td>
<select asp-for="OtherPersonId">
<option value="0">— انتخاب کنید —</option>
@foreach (var p in Model.OtherPeople)
{
<option value="@p.Id">@p.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>نسبت با @Model.Person.Name:</td>
<td>
<select asp-for="RelationKind">
<option value="Child">فرزند این شخصیت است</option>
<option value="Parent">پدر یا مادر این شخصیت است</option>
<option value="Sibling">خواهر یا برادر این شخصیت است</option>
<option value="Spouse">همسر این شخصیت است</option>
<option value="DistantAncestor">نیای دور این شخصیت است (بدون نسل مشخص)</option>
<option value="DistantDescendant">نوادهٔ دور این شخصیت است (بدون نسل مشخص)</option>
</select>
</td>
</tr>
<tr>
<td>
درجه (فقط برای نیا/نواده):
<p class="up-hint"><small>مثلاً برای پدربزرگ/مادربزرگ عدد ۲ را وارد کنید. اگر نمی‌دانید خالی بگذارید.</small></p>
</td>
<td><input asp-for="DegreeHint" /></td>
</tr>
<tr>
<td>یادداشت (مستندسازی):</td>
<td><textarea asp-for="Note" rows="3" cols="60"></textarea></td>
</tr>
<tr>
<td>یادداشت برای مدیر بررسی‌کننده:</td>
<td><textarea asp-for="SuggestionNote" rows="3" cols="60"></textarea></td>
</tr>
</table>
<input type="submit" value="ثبت پیشنهاد" class="up-btn up-btn--success" />
<a role="button" href="javascript:void(0)" onclick="history.back()" class="up-btn up-btn--ghost">انصراف</a>
</form>
</div>
<div class="spacer">&nbsp;</div>
</div>
<partial name="_FooterPartial" model=@(new _FooterPartialModel(){StickyEnabled = true}) />
</div>
@if (ViewData["TrackingScript"] != null && !string.IsNullOrEmpty(ViewData["TrackingScript"].ToString()))
{
@Html.Raw(ViewData["TrackingScript"])
}
}

View File

@ -1,132 +0,0 @@
@page "{id:int}"
@model GanjooRazor.Pages.SuggestPersonEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
ViewData["Title"] = "گنجور » پیشنهاد ویرایش شخصیت";
}
@section Head {
<meta name="robots" content="noindex, nofollow" />
}
@if (!string.IsNullOrEmpty(Model.LastError))
{
@Model.LastError
}
else
{
<!-- #hdr2 -->
<div id="fa">
<div id="maincnt">
<partial name="_InlineLoginPartial" model="Model" />
<div class="spacer">&nbsp;</div>
<div class="poem">
<h1>پیشنهاد ویرایش: @Model.Person.Name</h1>
<p class="up-hint">
این پیشنهاد مستقیماً اعمال نمی‌شود؛ پس از بررسی و تأیید توسط مدیران، در مشخصات
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Person.Id)">@Model.Person.Name</a> اعمال خواهد شد.
</p>
@if (!string.IsNullOrEmpty(Model.LastResult))
{
<p>@Html.Raw(Model.LastResult)</p>
}
<form method="post" action="/SuggestPersonEdit/@Model.Person.Id?Handler=SuggestEdit">
@Html.AntiForgeryToken()
<input type="hidden" asp-for="Suggestion.PersonId" />
<table>
<tr>
<td>پیشنهاد حذف این شخصیت:</td>
<td>
<input asp-for="Suggestion.SuggestedForDeletion" id="suggestedForDeletion" />
<p class="up-hint"><small>در صورت انتخاب این گزینه سایر فیلدها نادیده گرفته خواهد شد و در صورت تأیید مدیران، این شخصیت و همهٔ نسبت‌ها/وابستگی‌های آن حذف می‌شود.</small></p>
</td>
</tr>
<tr>
<td>نام:</td>
<td><input asp-for="Suggestion.SuggestedName" size="40" /></td>
</tr>
<tr>
<td>نشانی ویکی‌پدیا:</td>
<td><input style="text-align:left;direction:ltr;" asp-for="Suggestion.SuggestedWikiUrl" size="60" /></td>
</tr>
<tr>
<td>زاده:</td>
<td><input asp-for="Suggestion.SuggestedBirthYearInLHijri" /> (قمری)</td>
</tr>
<tr>
<td>تاریخ تولد مستند است:</td>
<td><input asp-for="Suggestion.SuggestedValidBirthDate" /></td>
</tr>
<tr>
<td>زادگاه:</td>
<td>
<select asp-for="Suggestion.SuggestedBirthLocationId">
@foreach (var location in Model.Locations)
{
<option value="@(location.Id == 0 ? "" : location.Id.ToString())">@location.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>درگذشته:</td>
<td><input asp-for="Suggestion.SuggestedDeathYearInLHijri" /> (قمری)</td>
</tr>
<tr>
<td>تاریخ وفات مستند است:</td>
<td><input asp-for="Suggestion.SuggestedValidDeathDate" /></td>
</tr>
<tr>
<td>آرامگاه:</td>
<td>
<select asp-for="Suggestion.SuggestedDeathLocationId">
@foreach (var location in Model.Locations)
{
<option value="@(location.Id == 0 ? "" : location.Id.ToString())">@location.Name</option>
}
</select>
</td>
</tr>
<tr>
<td>
عنوان شجره‌نامه:
<p class="up-hint"><small>پُر کنید تا این شخصیت در <a href="javascript:void(0)" onclick="PeopleExplorer.open()">فهرست شجره‌نامه‌ها</a> با این عنوان دیده شود.</small></p>
</td>
<td><input asp-for="Suggestion.SuggestedFamilyTreeCaption" size="40" /></td>
</tr>
<tr>
<td>توضیحات:</td>
<td><textarea asp-for="Suggestion.SuggestedDescription" rows="10" cols="60"></textarea></td>
</tr>
<tr>
<td>یادداشت برای مدیر بررسی‌کننده:</td>
<td><textarea asp-for="Suggestion.SuggestionNote" rows="3" cols="60"></textarea></td>
</tr>
</table>
<input type="submit" value="ثبت پیشنهاد" class="up-btn up-btn--success" />
<a role="button" href="javascript:void(0)" onclick="history.back()" class="up-btn up-btn--ghost">انصراف</a>
</form>
</div>
<div class="spacer">&nbsp;</div>
</div>
<partial name="_FooterPartial" model=@(new _FooterPartialModel(){StickyEnabled = true}) />
</div>
@if (ViewData["TrackingScript"] != null && !string.IsNullOrEmpty(ViewData["TrackingScript"].ToString()))
{
@Html.Raw(ViewData["TrackingScript"])
}
}

View File

@ -1,105 +0,0 @@
@page "{relationId:int}"
@model GanjooRazor.Pages.SuggestPersonRelationEditModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using RMuseum.Models.Ganjoor
@{
Layout = "_Layout";
ViewData["Title"] = "گنجور » پیشنهاد ویرایش نسبت خویشاوندی";
}
@section Head {
<meta name="robots" content="noindex, nofollow" />
}
@if (!string.IsNullOrEmpty(Model.LastError))
{
@Model.LastError
}
else
{
<!-- #hdr2 -->
<div id="fa">
<div id="maincnt">
<partial name="_InlineLoginPartial" model="Model" />
<div class="spacer">&nbsp;</div>
<div class="poem">
<h1>
پیشنهاد ویرایش نسبت:
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Relation.Person1Id)">@(Model.Relation.Person1 != null ? Model.Relation.Person1.Name : Model.Relation.Person1Id.ToString())</a>
و
<a href="javascript:void(0)" onclick="PersonWindow.open(@Model.Relation.Person2Id)">@(Model.Relation.Person2 != null ? Model.Relation.Person2.Name : Model.Relation.Person2Id.ToString())</a>
</h1>
<p class="up-hint">
این پیشنهاد مستقیماً اعمال نمی‌شود؛ پس از بررسی و تأیید توسط مدیران اعمال خواهد شد.
</p>
@if (!string.IsNullOrEmpty(Model.LastResult))
{
<p>@Html.Raw(Model.LastResult)</p>
}
<form method="post" action="/SuggestPersonRelationEdit/@Model.Relation.Id?Handler=SuggestEdit">
@Html.AntiForgeryToken()
<input type="hidden" asp-for="Suggestion.ExistingRelationId" />
<input type="hidden" asp-for="Suggestion.Person1Id" />
<input type="hidden" asp-for="Suggestion.Person2Id" />
<table>
<tr>
<td>نوع درخواست:</td>
<td>
<label><input type="radio" name="Action" value="Modify" checked="checked" /> ویرایش این نسبت</label>
&nbsp;
<label><input type="radio" name="Action" value="Remove" /> حذف این نسبت (اشتباه ثبت شده است)</label>
</td>
</tr>
<tr>
<td>نوع نسبت:</td>
<td>
<select asp-for="Suggestion.SuggestedRelationType">
<option value="@((int)PersonRelationType.Parent)">پدر/مادر و فرزند (طرف اول، پدر/مادر است)</option>
<option value="@((int)PersonRelationType.Sibling)">خواهر/برادر</option>
<option value="@((int)PersonRelationType.Spouse)">همسر</option>
<option value="@((int)PersonRelationType.Ancestor)">نیا و نواده (طرف اول، نیاست)</option>
</select>
</td>
</tr>
<tr>
<td>
درجه (فقط برای نیا/نواده):
<p class="up-hint"><small>مثلاً برای پدربزرگ/مادربزرگ عدد ۲ را وارد کنید. اگر نمی‌دانید خالی بگذارید.</small></p>
</td>
<td><input asp-for="Suggestion.SuggestedDegreeHint" /></td>
</tr>
<tr>
<td>یادداشت (مستندسازی):</td>
<td><textarea asp-for="Suggestion.SuggestedNote" rows="3" cols="60"></textarea></td>
</tr>
<tr>
<td>یادداشت برای مدیر بررسی‌کننده:</td>
<td><textarea asp-for="Suggestion.SuggestionNote" rows="3" cols="60"></textarea></td>
</tr>
</table>
<input type="submit" value="ثبت پیشنهاد" class="up-btn up-btn--success" />
<a role="button" href="javascript:void(0)" onclick="history.back()" class="up-btn up-btn--ghost">انصراف</a>
</form>
</div>
<div class="spacer">&nbsp;</div>
</div>
<partial name="_FooterPartial" model=@(new _FooterPartialModel(){StickyEnabled = true}) />
</div>
@if (ViewData["TrackingScript"] != null && !string.IsNullOrEmpty(ViewData["TrackingScript"].ToString()))
{
@Html.Raw(ViewData["TrackingScript"])
}
}

View File

@ -32,7 +32,7 @@ namespace RMuseum.Models.Ganjoor.ViewModels
{
/// <summary>
/// the underlying GanjoorPersonRelation row's own id - needed by the client to link to
/// /SuggestPersonRelationEdit/{id} for suggesting a change/removal of this specific edge
/// /User/SuggestPersonRelationEdit?relationId={id} for suggesting a change/removal of this specific edge
/// </summary>
public int Id { get; set; }

View File

@ -99,7 +99,7 @@ namespace RMuseum.Services
/// <summary>
/// get a single kinship edge by its own id, with both sides' names resolved - used by
/// /SuggestPersonRelationEdit/{relationId} to show what it's about
/// /User/SuggestPersonRelationEdit?relationId={relationId} to show what it's about
/// </summary>
/// <param name="relationId"></param>
/// <returns></returns>