@using PantheonRA.WebApi.Contracts

@{
    var _isMobile = Request.Browser.IsMobileDevice;
    List<WoExToolsLookup> toolsLookup = ViewBag.ToolsLookup ?? new List<WoExToolsLookup>();
}
@Html.Hidden("AddNewToolUrl", Url.Action("AddNewTool", "Service"))

<div class="modal" id="add-tool-modal" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="@(_isMobile ? "width: 100%; margin: 10px auto;" : "width: 70%")">
        <div class="modal-content">
            <div class="modal-header">
                <div class="row" style="padding:0px 15px">
                    <div>
                        <button type="button" class="close" data-dismiss="modal" aria-label="@Loc.Close"><span aria-hidden="true">&times;</span></button>
                        <h3>@Loc.NewTool</h3>
                    </div>

                    <div class="card-work-reg-card">
                        <div class="card card-work-reg">
                            <div class="card-header">
                                <h3 class="card-title">@Loc.Tool</h3>
                            </div>
                            <div class="card-body">
                                <div class="input2-selectpicker-wrapper">
                                    <select id="selected-tool" name="Ident" class="form-control input-lg input-border selectpicker" data-live-search="true">
                                        <option selected disabled>@Loc.Select</option>
                                        @foreach (var item in toolsLookup)
                                        {
                                            <option value="@item.AcToolId" data-name="@item.AcName" data-table="@item.Table">@item.AcToolId</option>
                                        }
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="card-work-reg-card">
                        <div class="card card-work-reg">
                            <div class="card-header">
                                <h3 class="card-title">@Loc.Description</h3>
                            </div>
                            <div class="card-body">
                                <input type="text" id="description" name="Description" required class="form-control input-lg input-border" autocomplete="off" readonly />
                            </div>
                        </div>
                    </div>

                    <div class="card-work-reg-card">
                        <div class="card card-work-reg">
                            <div class="card-header">
                                <h3 class="card-title">@Loc.Quantity</h3>
                            </div>
                            <div class="card-body">
                                <div class="input-group input-group-lg" style="width:100%">
                                    <span class="input-group-btn">
                                        <button id="b_dQuantity" type="button" class="btn btn-plus-minus"><i class="fa fa-minus fa-lg text-primary"></i></button>
                                    </span>
                                    <input type="number" id="quantity" name="Quantity" value="0" required class="form-control col-md-8 text-center input-lg input-border" autocomplete="off" min="0" />
                                    <span class="input-group-btn">
                                        <button id="b_iQuantity" type="button" class="btn btn-plus-minus"><i class="fa fa-plus fa-lg text-primary"></i></button>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <input id="table" hidden />

                    <br />
                    <button type="button" id="save-tool-btn" class="btn btn-primary pull-right @(_isMobile ? "btn-rounded" : string.Empty)">
                        <i class="fa fa-check m-r-xs" id="submit-btn-icon"></i>@Loc.Add
                    </button>
                    <button type="button" data-dismiss="modal" class="btn btn-link pull-right @(_isMobile ? "btn-rounded" : string.Empty)">
                        <i class="fa fa-times m-r-xs text-primary"></i>@Loc.Cancel
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="~/Scripts/custom/manufacturing/addToolModal.js"></script>