<div class="order-tree tree-view">
    <div class="tree-scroll">
        <ul class="tree">
            <li class="tree-item first" ng-include="node.treeTemplateUrl ? node.treeTemplateUrl : 'orderOperationDefault.tpl.html'"></li>
        </ul>
    </div>
</div>

<script type="text/ng-template" id="orderOperationDefault.tpl.html">
    <div class="tree-block" ng-click="selectOperation(node)" ng-class="{'__selected': currentOperationId == node.operation.id}">
        <div class="inner">
            <div class="tree-el __title">
                <i class="tree-ico fa fa-info-circle"></i>
                {{node.operation.operationType +' #'+node.operation.number}}
            </div>
            <div class="tree-el __date" ng-if="node.operation.createdDate">
                <i class="tree-ico fa fa-calendar"></i>
                {{node.operation.createdDate | amParse | date}}
            </div>
            <div class="tree-el __price" va-permission="order:read_prices">
                <i class="tree-ico fa fa-money"></i>
                {{node.operation.sum || node.operation.amount | currency:node.operation.currency}}
            </div>
            <div class="tree-el __canceled" ng-if="node.operation.status">
                {{node.operation | statusTranslate}}
            </div>
        </div>
    </div>
    <ul class="tree-node" ng-class="{'__empty': node.childrenNodes.length == 1}" ng-if="node.childrenNodes.length > 0">
        <li class="tree-item" ng-repeat="node in node.childrenNodes" ng-include="node.treeTemplateUrl ? node.treeTemplateUrl : 'orderOperationDefault.tpl.html'"></li>
    </ul>
</script>

<script type="text/ng-template" id="shipmentOperationDefault.tpl.html">
    <div class="tree-block" ng-click="selectOperation(node)" ng-class="{'__selected': currentOperationId == node.operation.id}">
        <div class="inner">
            <div class="tree-el __title">
                <i class="tree-ico fa fa-info-circle"></i>
                {{node.operation.operationType +' #'+node.operation.number}}
            </div>
            <div class="tree-el __date" ng-if="node.operation.createdDate">
                <i class="tree-ico fa fa-calendar"></i>
                {{node.operation.createdDate | amParse | date}}
            </div>
            <div class="tree-el __deliveryDate">
                <i class="tree-ico fa fa-truck"></i>
                {{node.operation.deliveryDate ? (node.operation.deliveryDate | amParse | date) : '-' }}
            </div>
            <div class="tree-el __price" va-permission="order:read_prices" ng-if="node.operation.sum || node.operation.amount">
                <i class="tree-ico fa fa-money"></i>
                {{node.operation.sum || node.operation.amount | currency:node.operation.currency}}
            </div>
            <div class="tree-el __canceled" ng-if="node.operation.status">
                {{node.operation | statusTranslate}}
            </div>
        </div>
    </div>
    <ul class="tree-node" ng-class="{'__empty': node.childrenNodes.length == 1}" ng-if="node.childrenNodes.length > 0">
        <li class="tree-item" ng-repeat="node in node.childrenNodes" ng-include="node.treeTemplateUrl ? node.treeTemplateUrl : 'orderOperationDefault.tpl.html'"></li>
    </ul>
</script>
