<!-- 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="trackresult">

    <div class="navbar">
        <div class="navbar-bg"></div>
        <div class="navbar-inner">
            <div class="left">
                <a class="link back" href="#">
                    <i class="icon icon-back"></i>
                    <span class="if-not-md">Back</span>
                </a>
            </div>
            <div class="title">Track</div>
            <div class="right">
                <a class="link icon-only" onclick="window.plugins.socialsharing.share(null, null, null, 'https://helena.express/track#{{code}}')">
                    <i class="fal fa-share-alt"></i>
                </a>
            </div>
        </div>
    </div>


    <div class="page-content">
        <div class="row justify-content-center">
            <div class="col-100 medium-75 large-90 xlarge-75">
                <div class="row justify-content-center align-items-stretch flex-direction-row-reverse-md">
                    {{#if map.enabled}}
                    <div class="col-100 large-50 xlarge-50">
                        <div class="no-margin-vertical-md tablet-inset elevation-tablet display-flex align-items-stretch" id="trackMapContainer">
                            <div class="mapbox" style="width: 100%; height: 100%;" id="mapbox-track" data-latitude="{{map.latitude}}" data-longitude="{{map.longitude}}" data-accurate="{{map.accurate}}"></div>
                        </div>
                    </div>
                    {{/if}}
                    <div class="col-100 large-50 xlarge-50">
                        <div class="list transparent no-hairlines no-margin-vertical-md tablet-inset elevation-tablet" id="trackResultContainer">
                            <ul>
                                {{#js_if "this.info != []"}}
                                <li class="item-divider">Info</li>
                                {{#each info}}
                                <li>
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="item-title" style="white-space: normal !important;">
                                                <div class="item-header">{{label}}</div>
                                                {{value}}
                                            </div>
                                        </div>
                                    </div>
                                </li>
                                {{/each}}
                                {{/js_if}}
                                {{#if carrierurl}}
                                <li>
                                    <div class="item-content item-link hapticbtn" onclick='openExternalBrowser("{{carrierurl}}");'>
                                        <div class="item-inner">
                                            <div class="item-title">
                                                <i class="far fa-external-link"></i> More Info
                                            </div>
                                        </div>
                                    </div>
                                </li>
                                {{/if}}
                                {{#if events}}
                                <li class="item-divider">Events</li>
                                {{#each events}}
                                <li>
                                    <div class="item-content">
                                        <div class="item-inner item-cell">
                                            <div class="item-row">
                                                <div class="item-cell">
                                                    <img src="{{icon}}" class="trackingeventicon" /> {{text}}
                                                </div>
                                            </div>
                                            <div class="item-row">
                                                <div class="item-cell">
                                                    {{date}}
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                                {{/each}}
                                {{/if}}
                                {{#if carrier_attribution}}
                                <li class="item-divider"></li>
                                <li>
                                    <div class="item-content">
                                        <div class="item-inner item-cell">
                                            <div class="item-row">
                                                <div class="item-cell">
                                                    {{carrier_attribution}}
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                                {{/if}}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>