@using MrCMS.Entities.Documents.Web.FormProperties
@using MrCMS.Helpers
@model MrCMS.Entities.Documents.Web.FormProperties.FormProperty
@{ Layout = "~/Areas/Admin/Views/Shared/_LayoutPopup.cshtml";}

@using (Html.BeginForm("EditProperty", "Form", new { id = Model.Id }, FormMethod.Post, new { @class = "form-update-form" }))
{
    <fieldset>
    <legend>@Resource("Admin Form Edit Field Title", "Edit field")
        <span class="btn-group  display-inline  pull-right">
            <input type="submit" class="btn btn-primary submit-form-btn" value="@Resource("Admin Form Edit Field Button", "Edit field")" />
        </span>
    </legend>
    <div class="row">
        <div class="col-xs-12">
            <div class="form-group">
                @Html.LabelFor(property => property.Name)
                @Html.TextBoxFor(property => property.Name, new { @class = "form-control" })
                @Html.ValidationMessageFor(property => property.Name)
            </div>
            <div class="form-group">
                @Html.LabelFor(property => property.LabelText)
                @Html.TextBoxFor(property => property.LabelText, new { @class = "form-control" })
                @Html.ValidationMessageFor(property => property.LabelText)
            </div>
            <div class="form-group">
                @Html.LabelFor(property => property.CssClass)
                @Html.TextBoxFor(property => property.CssClass, new { @class = "form-control" })
                @Html.ValidationMessageFor(property => property.CssClass)
            </div>
            <div class="form-group">
                @Html.LabelFor(property => property.HtmlId)
                @Html.TextBoxFor(property => property.HtmlId, new { @class = "form-control" })
                @Html.ValidationMessageFor(property => property.HtmlId)
            </div>
            <div class="form-group">
              @if (Model is TextBox)
              {
                  @Html.LabelFor(property =>(property as TextBox).PlaceHolder)
                  @Html.TextBoxFor(property => (property as TextBox).PlaceHolder, new { @class = "form-control" })
                  @Html.ValidationMessageFor(property => (property as TextBox).PlaceHolder)
              }
            </div>
            <div class="form-group">
                @Html.InlineCheckboxFor(x => x.Required)
            </div>
        </div>
    </div>
    </fieldset>
}
@{ Html.IncludeScript("~/Areas/Admin/Content/Scripts/mrcms/form-builder.js"); }