@using Domain
@model WebApp.ViewModels.FooCreateViewModel

@{
    ViewBag.Title = "Create";
}

@section headerscripts {
}

<h2>Create</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Foo</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.Foo.SingleLineText, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Foo.SingleLineText, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Foo.SingleLineText, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.MultilineLineText, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.Foo.MultilineLineText, new { cols = 60, rows = 10, @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Foo.MultilineLineText, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.Number, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Foo.Number, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Foo.Number, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.CheckBox, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <div class="checkbox">
                    @Html.EditorFor(model => model.Foo.CheckBox)
                    @Html.ValidationMessageFor(model => model.Foo.CheckBox, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.FooItemId, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.Foo.FooItemId, Model.FooItemSelectList, htmlAttributes: new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Foo.FooItemId, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.EnumFooItem, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EnumDropDownListFor(model => model.Foo.EnumFooItem, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Foo.EnumFooItem, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.EnumFooItem, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @foreach (var singleEnum in typeof(EnumFooItem).GetEnumValues().Cast<EnumFooItem>())
                {
                    @Html.RadioButtonFor(model => model.Foo.EnumFooItem, singleEnum, new { @class = "" }) @Html.Label(singleEnum.ToString())<br />
                }
                @Html.ValidationMessageFor(model => model.Foo.EnumFooItem, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.EnumFooItem2, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @foreach (var singleEnum in typeof(EnumFooItem).GetEnumValues().Cast<EnumFooItem>())
                {
                    @Html.RadioButtonFor(model => model.Foo.EnumFooItem2, singleEnum, new { @class = "" }) @Html.Label(singleEnum.ToString())<br />
                }
                @Html.ValidationMessageFor(model => model.Foo.EnumFooItem2, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.DT1, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Foo.DT1, new { htmlAttributes = new { @class = "form-control dt" } })
                @Html.ValidationMessageFor(model => model.Foo.DT1, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Foo.DT2, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Foo.DT2, new { htmlAttributes = new { @class = "form-control dt" } })
                @Html.ValidationMessageFor(model => model.Foo.DT2, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Create" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
<script type="text/javascript" src="~/Scripts/moment.js"></script>
<script type="text/javascript" src="~/Scripts/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript">
        $(function () {
            console.log($('#Foo.DT1'));
            $('.dt').datetimepicker();
        });

    </script>
}
