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