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; } /// /// 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. /// 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, }; } } }