@model PantheonApi.SyncApi.ViewModels.ReferencedTableViewModel

<!-- MODAL-->
<div id="referenced-table-div">
    <div class="modal fade" id="referenced-table-modal" tabindex="-1" role="dialog" data-backdrop="true" data-keyboard="true" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">Add new referenced table</h4>
                </div>
                <div class="modal-body">
                    <form action="/PartialSync/AddSyncFilterReferencedTable" method="post">
                        <div class="form-horizontal">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.SourceTableName, "Source table name", htmlAttributes: new { @class = "control-label col-md-3" })
                                        <div class="col-md-9">
                                            @Html.EditorFor(model => model.SourceTableName, new { htmlAttributes = new { @class = "form-control", @readonly = "readonly" } })
                                            @Html.ValidationMessageFor(model => model.SourceTableName, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.SourceColumnName, "Source column name", htmlAttributes: new { @class = "control-label col-md-3" })
                                        <div class="col-md-9">
                                            @Html.DropDownListFor(model => model.SourceColumnName,
                                                new SelectList(Model.ColumnNamesList),
                                                "Select column",
                                                new { @class = "form-control", @required = "required" })
                                            @Html.ValidationMessageFor(model => model.SourceColumnName, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.ReferencedTableName, "Referenced table name", htmlAttributes: new { @class = "control-label col-md-3" })
                                        <div class="col-md-9">
                                            @Html.DropDownListFor(model => model.ReferencedTableName,
                                                new SelectList(Model.ReferencedTablesList),
                                                "Select referenced table",
                                                new { @class = "form-control", @required = "required" })
                                            @Html.ValidationMessageFor(model => model.ReferencedTableName, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.ReferencedColumnName, "Referenced column name", htmlAttributes: new { @class = "control-label col-md-3" })
                                        <div class="col-md-9">
                                            @Html.EditorFor(model => model.ReferencedColumnName, new { htmlAttributes = new { @class = "form-control", @required = "required" } })
                                            @Html.ValidationMessageFor(model => model.ReferencedColumnName, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.ReferencedDocTypeColumnName, "Referenced document type column name", htmlAttributes: new { @class = "control-label col-md-3" })
                                        <div class="col-md-9">
                                            @Html.EditorFor(model => model.ReferencedDocTypeColumnName, new { htmlAttributes = new { @class = "form-control", @required = "required" } })
                                            @Html.ValidationMessageFor(model => model.ReferencedDocTypeColumnName, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        @Html.LabelFor(model => model.Condition, "Criteria", htmlAttributes: new { @class = "control-label col-md-3" })
                                        <div class="col-md-9">
                                            @Html.EditorFor(model => model.Condition, new { htmlAttributes = new { @class = "form-control" } })
                                            @Html.ValidationMessageFor(model => model.Condition, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                    @Html.LabelFor(model => model.Active, "Active", htmlAttributes: new { @class = "control-label col-md-3" })
                                    <div class="col-md-9">
                                        <div class="checkbox">
                                            @Html.CheckBox("Active", true)
                                            @Html.ValidationMessageFor(model => model.Active, "", new { @class = "text-danger" })
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                <input type="submit" value="Save" class="btn btn-success" />
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<!-- /MODAL-->