divan/DiwanRazor/Pages/Partials/DiwanPage/_CommentPartial.cshtml.cs
Anas Rashid e8f2306422 Rename Ganjoor -> Diwan throughout the code
Projects (GanjooRazor -> DiwanRazor, GanjoorService.sln -> DiwanService.sln), files,
folders, classes, namespaces, settings, API routes (/api/diwan) and DB tables (Diwan*).
External addresses (ganjoor.net, github.com/ganjoor) unchanged. Migrations renamed
consistently (no pending model changes); requires a fresh database.
Upstream RUNNING_LOCALLY/SEMANTIC_SEARCH docs archived unmodified under docs/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:49:01 +02:00

45 lines
1.5 KiB
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using RMuseum.Models.Diwan.ViewModels;
namespace DiwanRazor.Pages
{
public class _CommentPartialModel : PageModel
{
public DiwanCommentSummaryViewModel 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 DiwanCommentSummaryViewModel 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(DiwanCommentSummaryViewModel comment)
{
return new _CommentPartialModel()
{
Comment = comment,
Error = "",
InReplyTo = Comment,
LoggedIn = LoggedIn,
DivSuffix = DivSuffix,
PoemId = PoemId,
Bookmarked = Bookmarked,
};
}
}
}