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

    <div class="navbar">
        <div class="navbar-inner">
            <div class="title">Netsyms</div>

            <div class="right">
                <a href="#" onclick="loadOTPPage()" class="link icon-only">
                    <i class="fas fa-key"></i>
                </a>
                <a href="/settings" class="link icon-only">
                    <i class="fas fa-cog"></i>
                </a>
            </div>
        </div>
    </div>

    <div class="page-content ptr-content">

        <div class="ptr-preloader">
            <div class="preloader"></div>
            <div class="ptr-arrow"></div>
        </div>

        {{#if unreadnotifications}}
        <div class="card">
            <div class="card-header">Notifications</div>
            <div class="card-content">
                <div class="list media-list">
                    <ul id="notificationlist">
                        {{#each notifications}}
                        <li class="swipeout notificationlist-item" data-id="{{id}}">
                            <div class="swipeout-content">
                                <div class="item-content">
                                    <div class="item-inner">
                                        <div class="item-title-row">
                                            <div class="item-title">{{title}}</div>
                                        </div>
                                        <div class="item-text">{{text}}</div>
                                    </div>
                                </div>
                            </div>
                            <div class="swipeout-actions-left">
                                <a href="#" class="swipeout-delete">Delete</a>
                            </div>
                            <div class="swipeout-actions-right">
                                <a href="#" class="swipeout-delete">Delete</a>
                            </div>
                        </li>
                        {{/each}}
                    </ul>
                </div>
            </div>
        </div>
        {{/if}}

        <div class="card">
            <div class="card-header">Apps</div>
            <div class="card-content">
                <div class="list media-list">
                    <ul id="applist">
                        {{#each appcards}}
                        <li class="item-content applist-item" data-api="{{api}}" data-url="{{url}}" data-icon="{{icon}}" data-title="{{title}}" >
                            <div class="item-media"><img src="{{icon}}" width="44"/></div>
                            <div class="item-inner">
                                <div class="item-title-row">
                                    <div class="item-title">{{title}}</div>
                                </div>
                                <div class="item-subtitle">{{text}}</div>
                            </div>
                        </li>
                        {{/each}}
                    </ul>
                </div>
            </div>
        </div>

        <!-- Reload the home page if it doesn't have valid context  -->
        {{#unless homeloaded}}
        <script>
            loadHomePage(true);
        </script>
        {{/unless}}
    </div>

</div>