<!-- ko if: chosenwo().id() != null -->
<div class="row text-right">
    <!-- Created at date -->
    <div class="pull-right">
        <strong>Created at: </strong>
        <span data-bind="text: chosenwo().created"></span>
        <div class="vertical-divider"></div>
        <!-- Created by -->
        <strong>Created By: </strong>
        <span data-bind="text: chosenwo().creator_id() != null ? chosenwo().creator_name() : '- - -'"></span>
        <div class="vertical-divider"></div>
        <strong>Cost: </strong>
        <span data-bind="text: chosenwo().formatedCost"
          style="color: red; font-weight: bold;"></span>
        <div class="vertical-divider"></div>
        <div class="dropdown" style="display: inline;">
            <a href="#" data-toggle="dropdown" aria-expanded="false">
                Options
                <span class="caret"></span>
            </a>
            <ul class="dropdown-menu" aria-labelledby="dLabel" role="menu">
                <li>
                    <a href="#" style="cursor: pointer;" onclick="go_print_view()">
                        <span class="glyphicon glyphicon-print"></span> Print</a>
                </li>
                <!-- ko if: chosenwo().stocks().length == 0 -->
                    <li>
                        <a href="#" style="cursor: pointer;" onclick="go_print_wo_stickers()">
                            <span class="glyphicon glyphicon-tags"></span> Tags</a>
                    </li>
                <!-- /ko -->
            </ul>
        </div>
    </div>
</div>
<script>
    function go_print_view(){var url = '{{ path("workorders_print_preview", {'id': 'id_val'}) }}';url = url.replace("id_val", viewModel.chosenwo().id());document.location = url;}
    function go_print_wo_stickers(){var url = '{{ path("show_workorders_stickers", {'id': 'id_val'}) }}';url = url.replace("id_val", viewModel.chosenwo().id());window.open(url,'_blank');}
</script>
<!-- /ko -->