@using PantheonRA.BackOffice.Models
@model PantheonRA.BackOffice.Models.CertificateUploadViewModel
@{
    ViewBag.Title = @Loc.FiscalCertificateUpload;
}

<div class="tabs-container">
    @Html.Partial("~/Views/Company/_CompanySettingsTabNavigation.cshtml")
    <div class="tab-content">
        <form id="certificateForm" action="@Url.Action("Upload", "Certificate")" method="post" enctype="multipart/form-data">
            <div class="row buttons-tabbed">
                @Html.Partial("_FormButtons", new FormButtonsViewModel
                {
                    BackUrl = PantheonRA.BackOffice.CurrentUser.Localization == PAW.Contracts.Enums.Localization.Code.RS ? Url.Action("Index", "Certificate") : Url.Action("Index", "Company")
                })
            </div>

            <h3 class="m-b-md m-t-md">@Loc.FiscalCertificateUpload</h3>
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <input type="file" accept=".p12,.pfx" name="file" class="form-control" required />
                        @Html.ValidationMessage("file", new { @class = "text-danger" })
                    </div>
                </div>
                <div class="col-sm-5">
                    <div class="form-group">
                        @Html.PasswordFor(x => x.CertificatePassword, new { placeholder = Loc.EnterCertificatePassword, @class = "form-control" })
                        @Html.ValidationMessageFor(model => model.CertificatePassword, null, new { @class = "text-danger" })
                    </div>
                </div>
                @if (PantheonRA.BackOffice.CurrentUser.Localization == PAW.Contracts.Enums.Localization.Code.RS)
                {
                    <div class="col-sm-3">
                        <div class="form-group">
                            @Html.TextBoxFor(x => x.Pac, new { placeholder = "Pac", @class = "form-control" })
                            @Html.ValidationMessageFor(model => model.Pac, null, new { @class = "text-danger" })
                        </div>
                    </div>
                }
            </div>
            <div class="row">
                <div class="col-xs-2">
                    <button id="submitCertificateButton" type="submit" class="btn btn-primary btn-block pull-right">@Loc.OK</button>
                </div>
            </div>
        </form>
    </div>
</div>