127 lines
7.3 KiB
Plaintext

@model SceneEditViewModel
@{
ViewData["Title"] = "New Scene";
ViewData["ProjectSection"] = "Overview";
ViewData["ShellClass"] = "plotline-shell-wide";
}
<div data-project="@Model.Project?.ProjectID" data-book="@Model.Book?.BookID">
<nav data-pwa-identity class="breadcrumb-trail" aria-label="Breadcrumb">
<a asp-controller="Projects" asp-action="Index">Projects</a>
@if (Model.Project is not null)
{
<a asp-controller="Projects" asp-action="Details" asp-route-id="@Model.Project.ProjectID">@Model.Project.ProjectName</a>
}
@if (Model.Book is not null)
{
<a asp-controller="Books" asp-action="Details" asp-route-id="@Model.Book.BookID">@Model.Book.BookTitle</a>
}
@if (Model.Chapter is not null)
{
<a asp-controller="Chapters" asp-action="Details" asp-route-id="@Model.ChapterID">Chapter @Model.Chapter.ChapterNumber</a>
}
<span>@(Model.SceneID == 0 ? "New scene" : $"Scene {Model.SceneNumber}")</span>
</nav>
@if (Model.Project is not null)
{
<partial name="_ProjectSectionNav" model="Model.Project" />
}
<div class="page-heading compact">
<div>
<p class="eyebrow">@Model.Book?.BookTitle / Chapter @Model.Chapter?.ChapterNumber</p>
<h1>New Scene <help-icon key="scenes.edit" /></h1>
<p>Create the scene, then continue in its Scene Workspace.</p>
</div>
</div>
<section class="edit-panel">
<form asp-controller="Scenes" asp-action="Save" method="post" class="pd-record-form" id="scene-create-form">
<input asp-for="SceneID" type="hidden" />
<input asp-for="ChapterID" type="hidden" />
<div asp-validation-summary="All" class="text-danger" role="alert"></div>
<div class="button-row">
<button type="submit" class="btn btn-primary">Create scene</button>
<a class="btn btn-outline-secondary" asp-controller="Chapters" asp-action="Details" asp-route-id="@Model.ChapterID">Cancel</a>
</div>
<fieldset>
<legend>Scene details</legend>
<div class="form-group"><label asp-for="SceneTitle"></label>
<input asp-for="SceneTitle" class="form-control" />
<span asp-validation-for="SceneTitle" class="text-danger"></span></div>
<div class="form-group"><label asp-for="SceneNumber"></label>
<input asp-for="SceneNumber" class="form-control" step="0.01" />
<span asp-validation-for="SceneNumber" class="text-danger"></span></div>
<div class="form-group"><label asp-for="RevisionStatusID"></label>
<select asp-for="RevisionStatusID" asp-items="Model.RevisionStatuses" class="form-select"></select>
<span asp-validation-for="RevisionStatusID" class="text-danger"></span></div>
<div class="form-group"><label asp-for="Summary"></label>
<textarea asp-for="Summary" class="form-control" rows="4"></textarea>
<span asp-validation-for="Summary" class="text-danger"></span></div>
<div class="form-group"><label asp-for="POVCharacterID"></label>
<select asp-for="POVCharacterID" asp-items="Model.CharacterOptions" class="form-select"><option value="">None</option></select>
<span asp-validation-for="POVCharacterID" class="text-danger"></span></div>
<div class="form-group"><label asp-for="PrimaryLocationID"></label>
<select asp-for="PrimaryLocationID" asp-items="Model.LocationOptions" class="form-select"><option value="">None</option></select>
<span asp-validation-for="PrimaryLocationID" class="text-danger"></span></div>
</fieldset>
<fieldset><legend>Timing</legend>
<div class="form-group"><label asp-for="TimeModeID"></label>
<select asp-for="TimeModeID" asp-items="Model.TimeModes" class="form-select"></select>
<span asp-validation-for="TimeModeID" class="text-danger"></span></div>
<div class="form-group"><label asp-for="TimeConfidenceID"></label>
<select asp-for="TimeConfidenceID" asp-items="Model.TimeConfidences" class="form-select"></select>
<span asp-validation-for="TimeConfidenceID" class="text-danger"></span></div>
<div class="form-group"><label asp-for="StartDateTime"></label>
<input asp-for="StartDateTime" class="form-control" type="datetime-local" asp-format="{0:yyyy-MM-ddTHH:mm}" />
<span asp-validation-for="StartDateTime" class="text-danger"></span></div>
<div class="form-group"><label asp-for="EndDateTime"></label>
<input asp-for="EndDateTime" class="form-control" type="datetime-local" asp-format="{0:yyyy-MM-ddTHH:mm}" />
<span asp-validation-for="EndDateTime" class="text-danger"></span></div>
<div class="form-group"><label asp-for="DurationAmount"></label>
<input asp-for="DurationAmount" class="form-control" step="0.01" />
<span asp-validation-for="DurationAmount" class="text-danger"></span></div>
<div class="form-group"><label asp-for="DurationUnitID"></label>
<select asp-for="DurationUnitID" asp-items="Model.DurationUnits" class="form-select"><option value="">None</option></select>
<span asp-validation-for="DurationUnitID" class="text-danger"></span></div>
<div class="form-group"><label asp-for="RelativeTimeText"></label>
<input asp-for="RelativeTimeText" class="form-control" />
<span asp-validation-for="RelativeTimeText" class="text-danger"></span></div>
</fieldset>
<fieldset><legend>Purpose and outcome</legend>
@foreach (var purpose in Model.ScenePurposeTypes)
{
<label class="purpose-check">
<input type="checkbox" name="SelectedPurposeTypeIds" value="@purpose.ScenePurposeTypeID" checked="@(Model.SelectedPurposeTypeIds.Contains(purpose.ScenePurposeTypeID))" />
<span>@purpose.PurposeName</span>
</label>
}
<div class="form-group"><label asp-for="ScenePurposeNotes"></label><textarea asp-for="ScenePurposeNotes" class="form-control" rows="3"></textarea></div>
<div class="form-group"><label asp-for="SceneOutcomeNotes"></label><textarea asp-for="SceneOutcomeNotes" class="form-control" rows="3"></textarea></div>
</fieldset>
@if (Model.Metrics.Count > 0)
{
<fieldset><legend>Scene metrics</legend>
@for (var index = 0; index < Model.Metrics.Count; index++)
{
<div class="form-group">
<input asp-for="Metrics[index].MetricTypeID" type="hidden" />
<input asp-for="Metrics[index].MetricName" type="hidden" />
<input asp-for="Metrics[index].MinValue" type="hidden" />
<input asp-for="Metrics[index].MaxValue" type="hidden" />
<label asp-for="Metrics[index].Value">@Model.Metrics[index].MetricName</label>
<input asp-for="Metrics[index].Value" class="form-control" min="@Model.Metrics[index].MinValue" max="@Model.Metrics[index].MaxValue" />
<span asp-validation-for="Metrics[index].Value" class="text-danger"></span>
<label asp-for="Metrics[index].Notes">@Model.Metrics[index].MetricName notes</label>
<input asp-for="Metrics[index].Notes" class="form-control" />
</div>
}
</fieldset>
}
</form>
</section>
</div>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}