LocalGovIMS_localgov-ims/src/Admin/Views/SystemMessage/Create.cshtml
@model Admin.Models.SystemMessage.EditViewModel
@{
    ViewBag.Title = "Create system message";
}


@section Header { Create system message }

@section Subheader { System message details }

@using (Html.BeginForm("Create", "SystemMessage", FormMethod.Post))
{
    <div>

        <div class="row mb-3">
            <div class="col-12 col-sm-9 col-md-7 col-lg-6">
                @Html.LabelFor(m => m.Message, new { @class = "form-label" })
                @Html.TextAreaFor(m => m.Message, new { @class = "form-control" })
                <div class="form__element--error">
                    @Html.ValidationMessageFor(m => m.Message)
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-12 col-sm-6 col-md-5 col-lg-4">
                @Html.LabelFor(m => m.Severity, new { @class = "form-label" })
                <select id="Severity" name="Severity">
                    @foreach (var item in Model.SeverityList.Items)
                    {
                        <option class="item" value="@item.Value" @(Model.Severity.Equals(item.Value) ? "selected" : String.Empty)>@item.Text</option>
                    }
                </select>
                <div class="form__element--error">
                    @Html.ValidationMessageFor(m => m.Severity)
                </div>
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-12 col-sm-6 col-md-5 col-lg-4">
                @Html.LabelFor(m => m.StartDate, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.StartDate, new { @class = "form-control", type = "datetime-local" })
                <div class="form__element--error">
                    @Html.ValidationMessageFor(m => m.StartDate)
                </div>
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-12 col-sm-6 col-md-5 col-lg-4">
                @Html.LabelFor(m => m.EndDate, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.EndDate, new { @class = "form-control", type = "datetime-local" })
                <div class="form__element--error">
                    @Html.ValidationMessageFor(m => m.EndDate)
                </div>
            </div>
        </div>

        <input type="submit" value="Save" class="btn btn-primary" />
        @Html.ActionLink("Back", "Back", "SystemMessage", null, new { @class = "btn btn-secondary" })

    </div>
}

@section Scripts {
    <script type="text/javascript">
        $(document).ready(function () {
            accessibleAutocomplete.enhanceSelectElement({
                displayMenu: 'overlay',
                autoSelect: false,
                confirmOnBlur: false,
                showAllValues: true,
                defaultValue: '',
                preserveNullOptions: true,
                placeholder: 'Select Severity',
                dropdownArrow: () => paymentsAdmin.controls.autocomplete.downarrow,
                selectElement: document.querySelector('#Severity')
            });

        });
    </script>
}
