@model PantheonApi.SyncApi.Models.SegmentScheduleVM

<h2>Edit schedule</h2>

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        
        <div class="form-horizontal">
            <h4>@Model.anQId</h4>
            <hr />

            @if (TempData["Edit-Schedule"] != null)
                {
                <div class="alert alert-danger no-border">
                    <button type="button" class="close" data-dismiss="alert"><span>×</span><span class="sr-only">Close</span></button>
                    <span class="text-semibold">@TempData["Edit-Schedule"]</span>
                </div>
            }

            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
            @Html.HiddenFor(model => model.anQId)
    
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        @Html.LabelFor(model => model.acName, "Name", htmlAttributes: new { @class = "control-label col-md-3" })
                        <div class="col-md-9">
                            @Html.EditorFor(model => model.acName, new { htmlAttributes = new { @class = "form-control" } })
                            @Html.ValidationMessageFor(model => model.acName, "", new { @class = "text-danger" })
                        </div>
                    </div>

                    <div class="form-group">
                        @Html.LabelFor(model => model.anSequence, "Sequence", htmlAttributes: new { @class = "control-label col-md-3" })
                        <div class="col-md-9">
                            @Html.EditorFor(model => model.anSequence, new { htmlAttributes = new { @class = "form-control" } })
                            @Html.ValidationMessageFor(model => model.anSequence, "", new { @class = "text-danger" })
                        </div>
                    </div>

                    <div class="form-group">
                        @Html.LabelFor(model => model.abActive, "Active", htmlAttributes: new { @class = "control-label col-md-3" })
                        <div class="col-md-9">
                            <div class="checkbox">
                                @Html.CheckBoxFor(model => model.abActive)
                                @Html.ValidationMessageFor(model => model.abActive, "", new { @class = "text-danger" })
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">

                    <div class="form-group">
                        @Html.LabelFor(model => model.abIsDefault, "Default schedule", htmlAttributes: new { @class = "control-label col-md-3" })
                        <div class="col-md-9">
                            <div class="checkbox">
                                @Html.CheckBoxFor(model => model.abIsDefault, new { @id = "abIsDefault" })
                                @Html.ValidationMessageFor(model => model.abIsDefault, "", new { @class = "text-danger" })
                            </div>
                        </div>
                    </div>

                    <div class="form-group default-schedule">
                        @Html.LabelFor(model => model.adSyncStartTime, "Start time", htmlAttributes: new { @class = "control-label col-md-3" })
                        <div class="col-md-9">
                            @Html.EditorFor(model => model.adSyncStartTime, new { htmlAttributes = new { @class = "form-control datetimepicker" } })
                            @Html.ValidationMessageFor(model => model.adSyncStartTime, "", new { @class = "text-danger" })
                        </div>
                    </div>

                    <div class="form-group default-schedule">
                        @Html.LabelFor(model => model.anTimePeriod, "Time period (min)", htmlAttributes: new { @class = "control-label col-md-3" })
                        <div class="col-md-9">
                            @Html.EditorFor(model => model.anTimePeriod, new { htmlAttributes = new { @class = "form-control" } })
                            @Html.ValidationMessageFor(model => model.anTimePeriod, "", new { @class = "text-danger" })
                        </div>
                    </div>
                </div>
            </div>
    
            <div class="form-group">
                <div class="text-right">
                    <a class="btn btn-default" href="~/SyncSchedules/Schedules">Cancel</a>
                    <input type="submit" value="Save" class="btn btn-success" />
                </div>
            </div>
        </div>
    }