<!--
Copyright 2020 Netsyms Technologies.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<div class="page" data-name="client">

    <div class="navbar">
        <div class="navbar-bg"></div>
        <div class="navbar-inner">
            <div class="left">
                <a href="#" class="link icon-only back">
                    <i class="icon icon-back"></i>
                </a>
            </div>
            <div class="title">Client Info</div>
        </div>
    </div>

    <div class="toolbar tabbar toolbar-top">
        <div class="toolbar-inner">
            <a href="#tab-info" class="tab-link tab-link-active">Info</a>
            <a href="#tab-machines" class="tab-link">Machines</a>
        </div>
    </div>

    <div class="tabs-swipeable-wrap">
        <div class="tabs">

            <div id="tab-info" class="page-content tab tab-active">
                {{#with client}}
                <div class="list no-margin-top">
                    <ul>
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title">
                                        <div class="item-header">Name</div>
                                        {{name}}
                                    </div>
                                </div>
                            </div>
                        </li>
                        {{#if phone}}
                        <li>
                            <a class="item-content item-link" href="tel:{{phonestripped}}">
                                <div class="item-inner">
                                    <div class="item-title">
                                        <div class="item-header">Phone</div>
                                        {{phone}}
                                    </div>
                                </div>
                            </a>
                        </li>
                        {{/if}}
                        {{#if billingaddress}}
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title">
                                        <div class="item-header">Billing Address</div>
                                        {{billingaddress}}
                                    </div>
                                </div>
                            </div>
                        </li>
                        {{/if}}
                        {{#if mailingaddress}}
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title">
                                        <div class="item-header">Mailing Address</div>
                                        {{mailingaddress}}
                                    </div>
                                </div>
                            </div>
                        </li>
                        {{/if}}
                        {{#if privatenotes}}
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title">
                                        <div class="item-header">Private Notes</div>
                                        {{privatenotes}}
                                    </div>
                                </div>
                            </div>
                        </li>
                        {{/if}}
                        {{#if publicnotes}}
                        <li>
                            <div class="item-content">
                                <div class="item-inner">
                                    <div class="item-title">
                                        <div class="item-header">Public Notes</div>
                                        {{publicnotes}}
                                    </div>
                                </div>
                            </div>
                        </li>
                        {{/if}}
                    </ul>
                </div>
                {{/with}}
            </div>

            <div id="tab-machines" class="page-content tab">
                <div class="list accordion-list no-margin-top">
                    <ul>
                        {{#each machines}}
                        <li class="accordion-item">
                            <div class="item-content item-link">
                                <div class="item-inner">
                                    <div class="item-title"><i class="{{icon}}"></i> {{id}}</div>
                                    <div class="item-after">{{type.label}}</div>
                                </div>
                            </div>
                            <div class="accordion-item-content">
                                <a href="/machine/{{id}}" class="button">Open</a>
                                <div class="list">
                                    <ul>
                                        {{#each props}}
                                        <li>
                                            <div class="item-content">
                                                <div class="item-inner">
                                                    <div class="item-title" style="white-space: normal !important;">
                                                        <div class="item-header">{{title}}</div>
                                                        {{content}}
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                        {{/each}}
                                    </ul>
                                </div>
                            </div>
                        </li>
                        {{/each}}
                    </ul>
                </div>
            </div>

        </div>
    </div>
</div>