@model SceneEditViewModel
@{
    var startValue = Model.StartDateTime?.ToString("yyyy-MM-ddTHH:mm");
    var endValue = Model.EndDateTime?.ToString("yyyy-MM-ddTHH:mm");
}

<form asp-controller="Scenes" asp-action="SaveSceneDetails" method="post" class="scene-inspector-editor-form" data-scene-editor-form>
    @Html.AntiForgeryToken()
    <input type="hidden" asp-for="SceneID" />

    <div class="scene-inspector-editor-error" data-scene-editor-error hidden></div>

    <div class="scene-inspector-editor-fields">
        <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="scene-inspector-editor-grid">
            <div class="form-group">
                <label asp-for="SceneNumber"></label>
                <input asp-for="SceneNumber" class="form-control" step="0.01" />
            </div>
            <div class="form-group">
                <label asp-for="RevisionStatusID"></label>
                <select asp-for="RevisionStatusID" asp-items="Model.RevisionStatuses" class="form-control"></select>
            </div>
        </div>

        <div class="scene-inspector-editor-grid">
            <div class="form-group">
                <label asp-for="POVCharacterID"></label>
                <select asp-for="POVCharacterID" asp-items="Model.CharacterOptions" class="form-control">
                    <option value="">No POV character</option>
                </select>
            </div>
            <div class="form-group">
                <label asp-for="PrimaryLocationID"></label>
                <select asp-for="PrimaryLocationID" asp-items="Model.LocationOptions" class="form-control">
                    <option value="">No primary location</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label asp-for="Summary">Synopsis</label>
            <textarea asp-for="Summary" class="form-control" rows="5"></textarea>
        </div>

        <div class="scene-inspector-editor-grid">
            <div class="form-group">
                <label asp-for="TimeModeID"></label>
                <select asp-for="TimeModeID" asp-items="Model.TimeModes" class="form-control"></select>
            </div>
            <div class="form-group">
                <label asp-for="TimeConfidenceID"></label>
                <select asp-for="TimeConfidenceID" asp-items="Model.TimeConfidences" class="form-control"></select>
            </div>
        </div>

        <div class="scene-inspector-editor-grid">
            <div class="form-group">
                <label asp-for="StartDateTime"></label>
                <input type="datetime-local" name="StartDateTime" value="@startValue" class="form-control" />
            </div>
            <div class="form-group">
                <label asp-for="EndDateTime"></label>
                <input type="datetime-local" name="EndDateTime" value="@endValue" class="form-control" />
            </div>
        </div>

        <div class="scene-inspector-editor-grid">
            <div class="form-group">
                <label asp-for="DurationAmount"></label>
                <input asp-for="DurationAmount" class="form-control" step="0.01" />
            </div>
            <div class="form-group">
                <label asp-for="DurationUnitID"></label>
                <select asp-for="DurationUnitID" asp-items="Model.DurationUnits" class="form-control">
                    <option value="">No duration unit</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label asp-for="RelativeTimeText"></label>
            <input asp-for="RelativeTimeText" class="form-control" />
        </div>
    </div>

    <div class="scene-inspector-editor-footer">
        <button type="button" class="btn btn-sm btn-outline-secondary" data-scene-editor-close>Cancel</button>
        <button type="submit" class="btn btn-sm btn-primary" data-scene-editor-save>Save details</button>
    </div>
</form>
