<!DOCTYPE html>
<html ng-app="Application" ng-controller="MainController">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />

    <!-- this gets changed once we get the config (because angular has not loaded yet, we see template string for a flash) -->
    <title>&lrm;</title>

    <link id="favicon" type="image/png" rel="icon" href="/api/v1/cloudron/avatar">
    <link rel="apple-touch-icon" href="/api/v1/cloudron/avatar">
    <link rel="icon" href="/api/v1/cloudron/avatar">

    <!-- CSS -->
    <link type="text/css" rel="stylesheet" href="/3rdparty/slick.css?<%= revision %>"/>
    <link type="text/css" rel="stylesheet" href="/3rdparty/angular-ui-notification.css?<%= revision %>"/>
    <link type="text/css" rel="stylesheet" href="/3rdparty/bootstrap-slider/bootstrap-slider.min.css?<%= revision %>"/>
    <link type="text/css" rel="stylesheet" href="/theme.css?<%= revision %>">

    <!-- Fontawesome -->
    <link type="text/css" rel="stylesheet" href="/3rdparty/fontawesome/css/all.css?<%= revision %>"/>

    <!-- jQuery-->
    <script type="text/javascript" src="/3rdparty/js/jquery.min.js?<%= revision %>"></script>

    <!-- async -->
    <script type="text/javascript" src="/3rdparty/js/async-3.2.0.min.js?<%= revision %>"></script>

    <!-- toBlob() polyfill-->
    <script type="text/javascript" src="/3rdparty/js/canvas-to-blob.min.js?<%= revision %>"></script>

    <!-- Bootstrap Core JavaScript -->
    <script type="text/javascript" src="/3rdparty/js/bootstrap.min.js?<%= revision %>"></script>

    <!-- Slick carousel -->
    <script type="text/javascript" src="/3rdparty/js/slick.js?<%= revision %>"></script>

    <!-- Angularjs scripts -->
    <script type="text/javascript" src="/3rdparty/js/angular.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-loader.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-route.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-cookies.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-animate.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-base64.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-md5.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-sanitize.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-slick.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-ui-notification.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-fittext.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/autofill-event.js?<%= revision %>"></script>

    <!-- Angular directives for tldjs -->
    <script type="text/javascript" src="/3rdparty/js/tld.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-tld.js?<%= revision %>"></script>

    <!-- Angular directives for bootstrap https://angular-ui.github.io/bootstrap/ -->
    <script type="text/javascript" src="/3rdparty/js/ui-bootstrap-tpls-1.3.3.min.js?<%= revision %>"></script>

    <!-- Angular translate https://angular-translate.github.io/ -->
    <script type="text/javascript" src="/3rdparty/js/angular-translate.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-translate-loader-static-files.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-translate-storage-cookie.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/angular-translate-storage-local.min.js?<%= revision %>"></script>

    <!-- Chart.js https://www.chartjs.org/ -->
    <link type="text/css" rel="stylesheet" href="/3rdparty/Chart/Chart.min.css?<%= revision %>"/>
    <script type="text/javascript" src="/3rdparty/Chart/Chart.min.js?<%= revision %>"></script>

    <script type="text/javascript" src="/3rdparty/js/ansi_up.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/js/clipboard.min.js?<%= revision %>"></script>

    <!-- Showdown (markdown converter) -->
    <script type="text/javascript" src="/3rdparty/js/showdown-1.9.1.min.js?<%= revision %>"></script>

    <!-- Bootstrap slider -->
    <script type="text/javascript" src="/3rdparty/bootstrap-slider/bootstrap-slider.min.js?<%= revision %>"></script>
    <script type="text/javascript" src="/3rdparty/bootstrap-slider/slider.js?<%= revision %>"></script>

    <!-- Anugular Multiselect https://github.com/sebastianha/angular-bootstrap-multiselect -->
    <script type="text/javascript" src="/3rdparty/js/angular-bootstrap-multiselect.js?<%= revision %>"></script>

    <!-- colors -->
    <script type="text/javascript" src="/3rdparty/js/colors.js?<%= revision %>"></script>

    <!-- moment -->
    <script type="text/javascript" src="/3rdparty/js/moment.min.js?<%= revision %>"></script>

    <!-- timezone list -->
    <script type="text/javascript" src="/js/timezones.js?<%= revision %>"></script>

    <!-- Main Application -->
    <script type="text/javascript" src="/js/index.js?<%= revision %>"></script>

</head>

<body>

    <script type="text/ng-template" id="notification.html">
        <div class="ui-notification">
            <h3 ng-show="title" ng-bind-html="title"></h3>
            <div class="message">
                <a href="{{action}}" ng-show="action" ng-bind-html="message"></a>
                <span ng-hide="action" ng-bind-html="message"></span>
            </div>
        </div>
    </script>

    <a class="offline-banner animateMe" ng-show="client.offline" ng-cloak href="https://docs.cloudron.io/troubleshooting/" target="_blank"><i class="fa fa-circle-notch fa-spin"></i> {{ 'main.offline' | tr }}</a>

    <!-- Modal reboot server -->
    <div class="modal fade" id="rebootModal" tabindex="-1" role="dialog">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title">{{ 'main.rebootDialog.title' | tr }}</h4>
          </div>
          <div class="modal-body">
            <p class="text-bold">{{ 'main.rebootDialog.warning' | tr }}</p>
            <p>{{ 'main.rebootDialog.description' | tr }}</p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">{{ 'main.dialog.cancel' | tr }}</button>
            <button type="button" class="btn btn-danger" ng-click="reboot.submit()" ng-disabled="reboot.busy"><i class="fa fa-circle-notch fa-spin" ng-show="reboot.busy"></i> {{ 'main.rebootDialog.rebootAction' | tr }}</button>
          </div>
        </div>
      </div>
    </div>

    <div class="animateMe ng-hide layout-root" ng-show="initialized">

        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top shadow" role="navigation" style="margin-bottom: 0">
            <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand navbar-brand-icon" href="#/"><img ng-src="{{ client.avatar }}" width="40" height="40"/></a>
                    <a class="navbar-brand" href="#/">{{ config.cloudronName || 'Cloudron' }}</a>
                </div>
                <!-- /.navbar-header -->

                <div class="collapse navbar-collapse">
                  <ul class="nav navbar-nav navbar-right" ng-hide="hideNavBarActions">
                    <li ng-show="user.isAtLeastOwner && (subscription.plan.id === 'free' || subscription.plan.id === 'expired')">
                      <a ng-click="openSubscriptionSetup()" style="cursor: pointer">
                        <span class="badge badge-success">{{ subscription.plan.id === 'free' ? 'Setup' : 'Reactivate' }} Subscription</span>
                      </a>
                    </li>
                    <li>
                      <a ng-class="{ active: isActive('/apps')}" href="#/apps"><i class="fa fa-th fa-fw"></i> {{ 'apps.title' | tr }}</a>
                    </li>
                    <li ng-show="user.isAtLeastAdmin">
                      <a ng-class="{ active: isActive('/appstore')}" href="#/appstore"><i class="fa fa-cloud-download-alt fa-fw"></i> {{ 'appstore.title' | tr }}</a>
                    </li>
                    <li ng-show="user.isAtLeastUserManager">
                      <a ng-class="{ active: isActive('/users')}" href="#/users"><i class="fa fa-users fa-fw"></i> {{ 'users.title' | tr }}</a>
                    </li>
                    <li>
                      <a href="#/notifications">
                        <i class="fas fa-bell" ng-show="notifications.length"></i>
                        <i class="far fa-bell" ng-hide="notifications.length"></i>
                        <span class="badge badge-danger" ng-show="notifications.length">{{ notifications.length }}</span>
                      </a>
                    </li>
                    <li class="dropdown">
                      <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><img ng-src="{{user.avatarUrl}}" style="width: 24px; height: 24px;"/> {{user.username}} <span class="caret"></span></a>
                      <ul class="dropdown-menu" role="menu">
                        <li><a href="#/profile"><i class="fa fa-user fa-fw"></i> {{ 'profile.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin" class="divider"></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/backups"><i class="fa fa-archive fa-fw"></i> {{ 'backups.title' | tr }}</a></li>
                        <li ng-show="user.role === 'owner'"><a href="#/branding"><i class="fa fa-passport fa-fw"></i> {{ 'branding.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/domains"><i class="fa fa-globe fa-fw"></i> {{ 'domains.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/email"><i class="fa fa-envelope fa-fw"></i> {{ 'emails.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/activity"><i class="fa fa-list-alt fa-fw"></i> {{ 'eventlog.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/network"><i class="fas fa-network-wired fa-fw"></i> {{ 'network.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/services"><i class="fa fa-cogs fa-fw"></i> {{ 'services.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/settings"><i class="fa fa-wrench fa-fw"></i> {{ 'settings.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/volumes"><i class="fa fa-hdd fa-fw"></i> {{ 'volumes.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin" class="divider"></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/support"><i class="fa fa-comment fa-fw"></i> {{ 'support.title' | tr }}</a></li>
                        <li ng-show="user.isAtLeastAdmin"><a href="#/system"><i class="fa fa-chart-area fa-fw"></i> {{ 'system.title' | tr }}</a></li>
                        <li class="divider"></li>
                        <li><a href="" ng-click="logout($event)"><i class="fa fa-sign-out-alt fa-fw"></i> {{ 'main.logout' | tr }}</a></li>
                      </ul>
                    </li>
                  </ul>
                </div>
            </div>
        </nav>

        <div ng-view id="ng-view" class="layout-content"></div>

        <footer class="text-center ng-cloak">
          <span class="text-muted" ng-bind-html="config.footer | markdown2html"></span>
        </footer>
    </div>

</body>
</html>
