@model SceneEditViewModel @{ var completed = Model.ChecklistItems.Count(x => x.IsCompleted); var total = Model.ChecklistItems.Count; var checklistLabel = total == 0 ? "No checklist yet" : $"{completed} of {total} complete"; var incompleteChecklist = Model.ChecklistItems.Where(x => !x.IsCompleted).Take(3).ToList(); static string? FileHref(string? filePath) { if (string.IsNullOrWhiteSpace(filePath)) { return null; } return filePath.StartsWith("http", StringComparison.OrdinalIgnoreCase) ? filePath : filePath.StartsWith("/") ? filePath : !System.IO.Path.IsPathRooted(filePath) ? "/" + filePath.TrimStart('/', '\\') : null; } }

Writer

Drafting support

@if (Model.Workflow.IsBlocked) {
Blocked

@(string.IsNullOrWhiteSpace(Model.Workflow.BlockedReason) ? "No blocked reason has been recorded." : Model.Workflow.BlockedReason)

}
Notes @if (!Model.Notes.Any()) {

No drafting notes yet.

} else {
    @foreach (var note in Model.Notes.OrderByDescending(x => x.IsPinned).ThenByDescending(x => x.UpdatedDate).Take(3)) {
  • @(string.IsNullOrWhiteSpace(note.NoteTitle) ? note.NoteText : note.NoteTitle)
  • }
}
Checklist @if (!Model.ChecklistItems.Any()) {

No checklist items yet.

} else if (!incompleteChecklist.Any()) {

All @total checklist item@(total == 1 ? "" : "s") complete.

} else {

@checklistLabel

    @foreach (var item in incompleteChecklist) {
  • @item.ItemText
  • }
}
Attachments @if (!Model.Attachments.Any()) {

No scene references attached yet.

} else {
    @foreach (var attachment in Model.Attachments.Take(3)) { var href = FileHref(attachment.FilePath);
  • @if (!string.IsNullOrWhiteSpace(href)) { @attachment.Title } else if (!string.IsNullOrWhiteSpace(attachment.ExternalUrl)) { @attachment.Title } else { @attachment.Title }
  • }
}