feat/live-preview #8
@ -64,8 +64,12 @@ public class AdminController : Controller
|
||||
TotalViews = p.Analytics?.TotalViews ?? 0,
|
||||
PreviewToken = p.PreviewToken,
|
||||
CreatedAt = p.CreatedAt,
|
||||
LastModerationStatus = p.ModerationHistory == null || p.ModerationHistory.Last().Status != "rejected" ? null : Enum.Parse<PageStatus>(p.ModerationHistory.Last().Status, true),
|
||||
Motive = p.ModerationHistory == null && p.ModerationHistory.Last().Status == "rejected" ? "" : p.ModerationHistory.Last().Reason
|
||||
LastModerationStatus = p.ModerationHistory == null || p.ModerationHistory.Count == 0 || p.ModerationHistory.Last().Status == "rejected"
|
||||
? null
|
||||
: Enum.Parse<PageStatus>(p.ModerationHistory.Last().Status, true),
|
||||
Motive = p.ModerationHistory == null || p.ModerationHistory.Count == 0 || p.ModerationHistory.Last().Status != "rejected"
|
||||
? ""
|
||||
: p.ModerationHistory.Last().Reason
|
||||
}).ToList(),
|
||||
CurrentPlan = new PlanInfo
|
||||
{
|
||||
|
||||
@ -103,7 +103,7 @@ public class UserPageSummary
|
||||
public string? PreviewToken { get; set; } = string.Empty;
|
||||
public string PublicUrl => $"/page/{Category.ToLower()}/{Slug.ToLower()}?preview={PreviewToken}";
|
||||
public PageStatus? LastModerationStatus { get; set; } = PageStatus.PendingModeration;
|
||||
public string Motive { get; set; } = string.Empty;
|
||||
public string? Motive { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class PlanInfo
|
||||
|
||||
Loading…
Reference in New Issue
Block a user