@model SceneEditViewModel

<form asp-controller="Scenes" asp-action="SaveScenePurpose" 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">
        <fieldset class="scene-inspector-editor-fieldset">
            <legend>Selected purposes</legend>
            <div class="scene-inspector-editor-checks">
                @foreach (var purpose in Model.ScenePurposeTypes)
                {
                    var checkedAttribute = Model.SelectedPurposeTypeIds.Contains(purpose.ScenePurposeTypeID) ? "checked" : null;
                    <label>
                        <input type="checkbox" name="SelectedPurposeTypeIds" value="@purpose.ScenePurposeTypeID" checked="@checkedAttribute" />
                        <span>@purpose.PurposeName</span>
                    </label>
                }
            </div>
        </fieldset>

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

        <div class="form-group">
            <label asp-for="SceneOutcomeNotes"></label>
            <textarea asp-for="SceneOutcomeNotes" class="form-control" rows="5"></textarea>
        </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 purpose</button>
    </div>
</form>
