@using PAW.Contracts.Enums
@using PantheonRA.WebApi.Contracts.Enums
@model PantheonRA.BackOffice.Models.SetItemCreateViewModel

@{
    ViewBag.Title = Model.ProductEditData != null && string.IsNullOrEmpty(Model.ProductEditData.Id) ? Loc.CreateNewProduct : Loc.EditProduct;
    Layout = null;
}
@Html.Hidden("DurationMinute", Durations.Minute)
@Html.Hidden("DurationHour", Durations.Hour)

@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "productForm" }))
{
    <div class="row">
        <div class="col-xs-12 col-md-6">
            <div class="form-horizontal form-md m-t-md">
                @if (PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.SI)
                {
                    <h3>@Loc.IsArso</h3>

                    <div class="form-group">
                        @Html.LabelFor(model => model.ProductEditData.IsArso, Loc.IsArso, new { @class = "col-md-2 control-label" })
                        <div class="col-md-8 m-t-xs">
                            @Html.CheckBoxFor(model => model.ProductEditData.IsArso, new { @class = "form-control js-switch" })
                        </div>
                    </div>
                 }
                <div class="hidden" id="packagingWrapper">
                    <div class="form-group">
                        @Html.LabelFor(model => model.ProductEditData.GrossWeight, Loc.GrossWeight, new { @class = "col-md-3 control-label" })
                        <div class="col-md-8">
                            <div class="input-group">
                                @Html.TextBoxFor(model => model.ProductEditData.GrossWeight, new
                                {
                                    @class = "form-control numberInput",
                                    @placeholder = Loc.GrossWeight,
                                    @autocomplete = "off",
                                    @min = "0.001"
                                })
                                <span class="input-group-addon">kg</span>
                            </div>
                            @Html.ValidationMessageFor(model => model.ProductEditData.GrossWeight, "", new { @class = "text-danger" })
                        </div>
                    </div>

                    <div class="row m-b-sm m-t-sm">
                        <div class="col-md-3">
                            <div class="form-group">
                                @Html.Label(Loc.Packaging, new { @class = "col-md-12 control-label" })
                            </div>
                        </div>
                        <div class="col-md-8">
                            <div class="form-group">
                                @Html.LabelFor(model => model.ProductEditData.CardboardWeight, Loc.CardboardWeight, new { @class = "col-md-4 control-label" })
                                <div class="col-md-8">
                                    <div class="input-group">
                                        @Html.TextBoxFor(model => model.ProductEditData.CardboardWeight, new { @class = "form-control numberInput", @placeholder = Loc.CardboardWeight, @autocomplete = "off", @min = "0.001" })
                                        <span class="input-group-addon">kg</span>
                                    </div>
                                    @Html.ValidationMessageFor(model => model.ProductEditData.CardboardWeight, "", new { @class = "text-danger" })
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.ProductEditData.PlasticWeight, Loc.PlasticWeight, new { @class = "col-md-4 control-label" })
                                <div class="col-md-8">
                                    <div class="input-group">
                                        @Html.TextBoxFor(model => model.ProductEditData.PlasticWeight, new { @class = "form-control numberInput", @placeholder = Loc.PlasticWeight, @autocomplete = "off", @min = "0.001" })
                                        <span class="input-group-addon">kg</span>
                                    </div>
                                    @Html.ValidationMessageFor(model => model.ProductEditData.PlasticWeight, "", new { @class = "text-danger" })
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.ProductEditData.GlassWeight, Loc.GlassWeight, new { @class = "col-md-4 control-label" })
                                <div class="col-md-8">
                                    <div class="input-group">
                                        @Html.TextBoxFor(model => model.ProductEditData.GlassWeight, new { @class = "form-control numberInput", @placeholder = Loc.GlassWeight, @autocomplete = "off", @min = "0.001" })
                                        <span class="input-group-addon">kg</span>
                                    </div>
                                    @Html.ValidationMessageFor(model => model.ProductEditData.GlassWeight, "", new { @class = "text-danger" })
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.ProductEditData.MetalWeight, Loc.MetalWeight, new { @class = "col-md-4 control-label" })
                                <div class="col-md-8">
                                    <div class="input-group">
                                        @Html.TextBoxFor(model => model.ProductEditData.MetalWeight, new { @class = "form-control numberInput", @placeholder = Loc.MetalWeight, @autocomplete = "off", @min = "0.001" })
                                        <span class="input-group-addon">kg</span>
                                    </div>
                                    @Html.ValidationMessageFor(model => model.ProductEditData.MetalWeight, "", new { @class = "text-danger" })
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.ProductEditData.WoodWeight, Loc.WoodWeight, new { @class = "col-md-4 control-label" })
                                <div class="col-md-8">
                                    <div class="input-group">
                                        @Html.TextBoxFor(model => model.ProductEditData.WoodWeight, new { @class = "form-control numberInput", @placeholder = Loc.WoodWeight, @autocomplete = "off", @min = "0.001" })
                                        <span class="input-group-addon">kg</span>
                                    </div>
                                    @Html.ValidationMessageFor(model => model.ProductEditData.WoodWeight, "", new { @class = "text-danger" })
                                </div>
                            </div>

                            <div class="form-group">
                                @Html.LabelFor(model => model.ProductEditData.OtherWeight, Loc.OtherWeight, new { @class = "col-md-4 control-label" })
                                <div class="col-md-8">
                                    <div class="input-group">
                                        @Html.TextBoxFor(model => model.ProductEditData.OtherWeight, new { @class = "form-control numberInput", @placeholder = Loc.OtherWeight, @autocomplete = "off", @min = "0.001" })
                                        <span class="input-group-addon">kg</span>
                                    </div>
                                    @Html.ValidationMessageFor(model => model.ProductEditData.OtherWeight, "", new { @class = "text-danger" })
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        @Html.LabelFor(model => model.ProductEditData.NetWeight, Loc.NetWeight, new { @class = "col-md-3 control-label" })
                        <div class="col-md-8">
                            <div class="input-group">
                                @Html.TextBoxFor(model => model.ProductEditData.NetWeight, new { @class = "form-control numberInput", @placeholder = Loc.NetWeight, @autocomplete = "off", @min = "0.001" })
                                <span class="input-group-addon">kg</span>
                            </div>
                            @Html.ValidationMessageFor(model => model.ProductEditData.NetWeight, "", new { @class = "text-danger" })
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
}

<div id="Company" data-text="@Loc.Company" style="display:none"></div>
<div id="CompanyName" data-text="@Loc.Name" style="display:none"></div>
<div id="CompanyAddress" data-text="@Loc.Address" style="display:none"></div>
<div id="CompanyPost" data-text="@Loc.Post" style="display:none"></div>
<div id="CompanyRegisterVatNumber" data-text="@Loc.RegisterVatNumber" style="display:none"></div>
<input id="GetItemPriceUrl" value="@Url.Action("GetItemPrice", "SetItem")" hidden />
<input type="hidden" value="@ViewBag.ReturnUrl" id="ReturnUrl" name="ReturnUrl" />
<input type="hidden" id="YesLoc" value="@Loc.Yes" />
<input type="hidden" id="NoLoc" value="@Loc.No" />
<input type="hidden" id="FieldRequiredForCreatingKeyLoc" value="@Loc.FieldRequiredForCreatingKey" />
<input type="hidden" id="FieldDoesNotExistLoc" value="@Loc.FieldDoesNotExist" />
