LocalGovIMS_localgov-ims/src/Admin/Views/MetadataKey/Edit.cshtml
@model Admin.Models.MetadataKey.EditViewModel
@{
    ViewBag.Title = "Edit metadata key";
}

@section Messages {
    @if (TempData.ContainsKey("Message") && TempData["Message"] != null) { Html.RenderPartial("_Message", TempData["Message"]); }
}

@section Header { @Model.Name }

@section Subheader { Metadata key details }

@using (Html.BeginForm("Edit", "MetadataKey", FormMethod.Post))
{

    <div>

        @Html.HiddenFor(m => m.Id)
        @Html.HiddenFor(m => m.Name)
        @Html.HiddenFor(m => m.IsASystemType)
        @Html.HiddenFor(m => m.EntityType)

        <div class="row mb-3">
            <div class="col-12 col-sm-6 col-md-5 col-lg-4">
                @Html.LabelFor(m => m.Name, new { @class = "form-label" })
                <div class="form-label">
                    @Html.DisplayFor(m => m.Name, new { @class = "form-control" })
                </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.Description, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.Description, new { @class = "form-control" })
                <div class="form__element--error">
                    @Html.ValidationMessageFor(m => m.Description)
                </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.IsASystemType, new { @class = "form-label" })
                <div class="form-label">
                    @Model.IsASystemType.ToYesNoString()
                </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.EntityType, new { @class = "form-label" })
                <div class="form-label">
                    @Html.DisplayFor(m => m.EntityType, new { @class = "form-label" })
                </div>
            </div>
        </div>

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

    </div>

}

@section Scripts {
    <script type="text/javascript">
        $('.ui.dropdown').dropdown({
            match: 'both'
        });
    </script>
}
