@model PantheonRA.BackOffice.Models.FiscalDeviceViewModel
@using PantheonRA.BackOffice.Models
@{
    ViewBag.Title = Loc.FiscalPrinter;
}

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        @Html.Partial("~/Views/Company/_CompanySettingsTabNavigation.cshtml")

        <div class="tab-content">
            <form method="post">
                @Html.HiddenFor(model => model.AnQid)
                <div class="row buttons-tabbed">
                    @Html.Partial("_FormButtons", new FormButtonsViewModel {
                   BackUrl = Url.Action("Index", "FiscalDevice"),
                   SaveButtonGroup = new FormButtonGroup
                   {
                       Buttons = new List<FormButton>
                        {
                            new FormButton { Text = Loc.Save, Icon = "fa fa-save fa-lg", IsSubmit = true }
                        }
                   },
                   DeleteButtonGroup = new FormButtonGroup
                   {
                       Buttons = new List<FormButton>
                        {
                            new FormButton { Url = Url.Action("Delete", new { id = Model.AnQid }) }
                        }
                   }
               })
                </div>
                <div class="row">
                    <div class="col-lg-6 col-md-8 col-sm-12">
                        <h3 class="m-t-md">@Loc.FiscalPrinter</h3>

                        <div class="form-horizontal form-md">
                            <div class="form-group">
                                @Html.LabelFor(model => model.AcDeviceId, Loc.Id, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.TextBoxFor(model => model.AcDeviceId, new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AcDeviceId)
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.AcDeviceName, Loc.DeviceName, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.TextBoxFor(model => model.AcDeviceName, new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AcDeviceName)
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.AnTemplateQid, Loc.Template, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.DropDownListFor(model => model.AnTemplateQid, (SelectList)ViewBag.Templates, new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AnTemplateQid)
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.AcInputDir, Loc.InputDirectory, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.TextBoxFor(model => model.AcInputDir, new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AcInputDir)
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.AcOutputDir, Loc.OutputDirectory, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.TextBoxFor(model => model.AcOutputDir, new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AcOutputDir)
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.AbBackup, Loc.Backup, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.CheckBoxFor(model => model.AbBackup, new { @class = "js-switch" })
                                    @Html.ValidationMessageFor(model => model.AbBackup)
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.AcBackupDir, Loc.BackupDirectory, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.TextBoxFor(model => model.AcBackupDir, new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AcBackupDir)
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.AnComPort, Loc.ComPort, new { @class = "col-md-3 control-label" })
                                <div class="col-md-9">
                                    @Html.TextBoxFor(model => model.AnComPort, new { @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.AnComPort)
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-3">
                                    @Html.ValidationSummary(true)
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

@section pageScripts{
    @Scripts.Render("~/bundles/product")
    <script>
        $(document).ready(function () {
            let elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
            elems.forEach(function (html) {
                new Switchery(html, { size: 'small' });
            });
        });
    </script>
}