<!--ko foreach:$root.AdisyonListesi-->
<div class="row adisyon">
    <strong data-bind="text:$data.DisplayText, click:function(){$data.selected(!$data.selected())}" class="adisyonHeader"></strong>
    <!--ko if:!$data.selected()-->
    <!--ko foreach:$data.list()-->
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12" style="margin:0px; padding:0px;" data-bind="click:function(){$data.selected(!$data.selected())}">
            <!--ko if:$root.TransferEnabled()-->
            <div class="col-xs-1 col-sm-1 col-md-1 editIcon">
                <img data-bind="attr:{src:icons.edit}" class="adisyonEditIcon" />
            </div>
            <!--/ko-->
            <div data-bind="css:$root.TransferEnabled() ? 'col-xs-7 col-sm-7 col-md-8' : 'col-xs-8 col-sm-8 col-md-9'">
                <div class="adisyonProduct" data-bind="html:$data.Name"></div>
            </div>
            <div class="col-xs-4 col-sm-4 col-md-3 priceRight">
                <div class="adisyonPrice" data-bind="html:$data.DisplayText"></div>
            </div>
        </div>
        <!--ko template:'transferTemplate'--><!--/ko-->
    </div>
    <!--/ko-->
    <!--/ko-->
    <strong data-bind="text: $data.LastRowInfo" class="adisyonTotal"></strong>
</div>
<!--/ko-->



<script type="text/html" id="transferTemplate">
    <!--ko if:$root.TransferEnabled() && $data.selected()-->
    <div class="col-xs-12 col-sm-12 col-md-12">
        <div class="col-xs-12 col-sm-4 col-md-4 transferDiv">
            <select class="form-control loginInput transferItems" data-bind="
                            options: $root.TransfereMusaitMasalistesi,
                            optionsText: 'MASANO',
                            optionsValue:$data,
                            value:$data.TransferTo,
                            optionsCaption:'Lütfen hedef masa seçin'
                            "></select>
        </div>
        <!--ko if:$data.TransferTo()-->
        <div class="col-xs-12 col-sm-4 col-md-4 transferDiv">
            <select class="form-control loginInput transferItems" data-bind="
                            options: Array.apply(null, Array(parseInt($data.Quantity()))).map(function (x, i) { return i+1; }),
                            optionsText: $data,
                            optionsValue: $data,
                            value:$data.TransferQuantity,
                            "></select>
        </div>
        <!--/ko-->
        <!--ko if:$data.TransferTo()-->
        <div class="col-xs-12 col-sm-4 col-md-4 transferDiv">
            <button type="button" class="btn btn-default btn-block transferItems"
                    data-bind="click:function(){$root.transferTo($data,$index(),$parentContext.$index())}">
                Transfer Et
            </button>
        </div>
        <!--/ko-->
    </div>
    <!--/ko-->
</script>