<?php

/**
 * @var string $content
 * @var \yii\web\View $this
 */

use yii\helpers\Html;
use yii\helpers\Url;
use app\models\Messages;
use app\assets\BackendAsset;

$messages_count = Messages::find()->where(['user_id' => Yii::$app->user->id, 'status' => 0])->count();

BackendAsset::register($this);
?>
<?php $this->beginPage(); ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>" ng-app="pulseApp">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta charset="<?= Yii::$app->charset ?>" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
    <link href="/bower_components/angular-notify/dist/angular-notify.css" rel="stylesheet">
    <script src="/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="/bower_components/angular/angular.min.js"></script>
    <!-- <script src="/bower_components/angular-route/angular-route.js"></script> -->
    <script src="/js/i18n/angular-locale_uk-ua.js"></script>
    <script src="/bower_components/angular-cookies/angular-cookies.min.js"></script>
    <script src="/bower_components/angular-notify/dist/angular-notify.js"></script>
    <script src="/bower_components/angular-tooltips/dist/angular-tooltips.min.js"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="/js/head.js"></script>
    <script src="/js/main_user.js"></script>
    <script src="/js/auclots.js"></script>
</head>
<body class="nav-<?= !empty($_COOKIE['menuIsCollapsed']) && $_COOKIE['menuIsCollapsed'] == 'true' ? 'sm' : 'md' ?>" >
<?php $this->beginBody(); ?>
<div class="container body">
    <div class="main_container">
        <div class="col-md-3 left_col">
            <div class="left_col scroll-view">
                <div class="navbar nav_title" style="border: 0;">
                    <a href="/" class="site_title">
                        <img src="/images/logo__.png" alt="logo" style="position: relative;left: -5px;top: 0;width: 60px;">
                        <span><?= Yii::$app->name; ?></span>
                    </a>
                </div>
                <div class="clearfix"></div>
                <br />
                <!-- sidebar menu -->
                <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                    <div class="menu_section">
                        <h3><?= Yii::t('app', 'Меню'); ?></h3>
                        <?= $this->render('@app/views/layouts/backend/left'); ?>
                    </div>
                </div>
                <!-- /sidebar menu -->
            </div>
        </div>
        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <nav class="" role="navigation">
                    <div class="nav toggle">
                        <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                    </div>
                    <ul class="nav navbar-nav navbar-right">
                        <li class="">
                            <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                <img src="//placehold.it/128x128" alt=""><?= \Yii::$app->user->identity->username; ?>
                                <span class=" fa fa-angle-down"></span>
                            </a>
                            <?= $this->render('@app/views/layouts/backend/top'); ?>
                        </li>
                        <li role="presentation" class="dropdown">
                            <a href="<?= Url::to(['/messages']); ?>" class="info-number" aria-expanded="false">
                                <i class="fa fa-envelope-o"></i>
                                <?php if($messages_count): ?>
                                    <span class="badge bg-green" id="messages-count"><?= $messages_count; ?></span>
                                <?php endif; ?>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
        <!-- /top navigation -->
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="page-title">
                <div class="title_left">
                    <h1><?= $this->title; ?></h1>
                </div>
                <!--                <div class="title_right">-->
                <!--                    <div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">-->
                <!--                        <div class="input-group">-->
                <!--                            <input type="text" class="form-control" placeholder="Search for...">-->
                <!--                            <span class="input-group-btn">-->
                <!--                                <button class="btn btn-default" type="button">Go!</button>-->
                <!--                            </span>-->
                <!--                        </div>-->
                <!--                    </div>-->
                <!--                </div>-->
            </div>
            <div class="clearfix"></div>
            <?= $content; ?>
        </div>
        <!-- /page content -->
        <!-- footer content -->
        <footer>
            <div class="pull-right">
                <?= Html::a(Yii::$app->name, 'http://react-logic.com', ['target' => '_blank']); ?>
            </div>
            <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
    </div>
</div>
<div id="custom_notifications" class="custom-notifications dsp_none">
    <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group">
    </ul>
    <div class="clearfix"></div>
    <div id="notif-group" class="tabbed_notifications"></div>
</div>
<!-- /footer content -->
<?php $this->endBody(); ?>
<script src="/bower_components/angular-strap/dist/angular-strap.min.js"></script>
<script src="/bower_components/angular-strap/dist/angular-strap.tpl.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.js"></script>
</body>
</html>
<?php $this->endPage(); ?>
