divan/DivanRazor/Pages/Partials/DivanPage/_CommentPartial.cshtml.cs
Anas Rashid e3e3819c78 Urdu public pages, batch 2 (#2): auth, errors, map, FAQ, similar poems, people pages, page titles
- translate remaining public views and page-model strings (titles, messages, relation names)
- Urdu stopword list for word-frequency stats (replaces Persian list)
- error pages: drop list of alternative Ganjoor services

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 00:22:09 +02:00

45 lines
1.5 KiB
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using RMuseum.Models.Divan.ViewModels;
namespace DivanRazor.Pages
{
public class _CommentPartialModel : PageModel
{
public DivanCommentSummaryViewModel Comment { get; set; }
public string Error { get; set; }
/// <summary>
/// set (alongside Error) when Error is the "sanitizing had to drop real text" case -
/// the plain text that would remain, so client JS can diff it against what the user
/// actually typed and show them exactly what got dropped. Null/empty for any other error.
/// </summary>
public string SanitizerRemainingText { get; set; }
public DivanCommentSummaryViewModel InReplyTo { get; set; }
public bool LoggedIn { get; set; }
public string DivSuffix { get; set; }
public int PoemId { get; set; }
public string Wrote
{
get
{
return InReplyTo == null ? "لکھا" : "جواب دیا";
}
}
public bool Bookmarked { get; set; }
public _CommentPartialModel GetCommentModel(DivanCommentSummaryViewModel comment)
{
return new _CommentPartialModel()
{
Comment = comment,
Error = "",
InReplyTo = Comment,
LoggedIn = LoggedIn,
DivSuffix = DivSuffix,
PoemId = PoemId,
Bookmarked = Bookmarked,
};
}
}
}