@model PlotLine.Services.Context.IntentMaterial @foreach (var scope in new[] { false, true }) { var notes = Model.Notes.Where(n => n.SceneID.HasValue == scope && (!string.IsNullOrWhiteSpace(n.WritingNotes) || n.Items.Count > 0)); var references = Model.References.Where(r => r.SceneID.HasValue == scope); if (!notes.Any() && !references.Any()) { continue; }

@(scope ? "Scene planning material" : "Chapter planning material")

@foreach (var note in notes) {
@if (!string.IsNullOrWhiteSpace(note.WritingNotes)) {
@note.WritingNotes
} @if (note.Items.Count > 0) { } @note.ThreadTitle
}
}