|
- <?php
- use yii\helpers\Html;
- use yii\bootstrap\Nav;
- use yii\bootstrap\NavBar;
- use yii\widgets\Breadcrumbs;
- use common\widgets\Alert;
- use common\helpers\Url ;
-
- /* @var $this \yii\web\View */
- /* @var $content string */
-
- $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ;
-
- \common\assets\CommonAsset::register($this);
- \frontend\assets\AppAsset::register($this);
-
- ?>
- <?php $this->beginPage() ?>
- <!DOCTYPE html>
- <head>
- <title><?php if($is_home): ?>La boîte à pain • <?= Html::encode($this->title) ?> <?php else: ?><?= Html::encode($this->title) ?> • La boîte à pain<?php endif; ?></title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <?= Html::csrfMetaTags() ?>
- <link rel="icon" type="image/png" href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
- <!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon.ico" /><![endif]-->
- <?php $this->head() ?>
- <!--[if lt IE 9]>
- <script src="<?= Yii::$app->urlManager->getBaseUrl(); ?>/js/html5shiv.min.js"></script>
- <link href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/css/ie.css" rel="stylesheet">
- <![endif]-->
- <!--[if IE 7]>
- <link href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet">
- <![endif]-->
- </head>
- <body class="<?php if($is_home): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>">
- <?php $this->beginBody() ?>
- <div id="back"></div>
- <?php if(YII_ENV == 'demo'): ?>
- <div id="block-demo">
- <div class="container">
- <span class="glyphicon glyphicon-eye-open"></span> <strong>Espace de démonstration</strong> :
- Testez la plateforme sans avoir à vous inscrire. Les données sont réinitialisées quotidiennement • <?= Html::a('Retour', Url::env('prod', 'frontend')) ?>
- </div>
- </div>
- <?php endif; ?>
- <header id="header">
- <div id="the-header" class="container">
- <a id="link-home" href="<?= Yii::$app->urlManager->createUrl('site/index') ; ?>">
- <img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
- <div class="text">
- <div class="bap">La boîte à pain</div>
- <div class="plateforme">Plateforme de réservation
- <?php if(YII_ENV == 'dev' || YII_ENV == 'demo'): ?><?php if(YII_ENV == 'dev'): ?>(dév)<?php elseif(YII_ENV == 'demo'): ?>(démo)<?php endif; ?><?php endif; ?></div>
- </div>
- </a>
- <nav>
- <?php
- echo Nav::widget([
- 'encodeLabels' => false,
- 'options' => ['class' =>'nav nav-pills'],
- 'items' => [
- [
- 'label' => '<span class="glyphicon glyphicon-th-list"></span> Accueil',
- 'url' => Yii::$app->urlManager->createUrl(['site/index']),
- 'active' => $this->getControllerAction() == 'site/index'
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-grain"></span> Producteurs',
- 'url' => Yii::$app->urlManager->createUrl(['site/producers']),
- 'active' => $this->getControllerAction() == 'site/producers',
- 'options' => ['id' => 'link-producteurs']
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
- 'url' => Yii::$app->urlManager->createUrl(['site/login']),
- 'visible' => Yii::$app->user->isGuest,
- 'active' => $this->getControllerAction() == 'site/login'
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-user"></span> Inscription',
- 'url' => Yii::$app->urlManager->createUrl(['site/signup']),
- 'visible' => Yii::$app->user->isGuest,
- 'active' => $this->getControllerAction() == 'site/signup'
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-user"></span> '.((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->prenom .' '.strtoupper(substr(Yii::$app->user->identity->nom, 0, 1))) : '').'. ',
- 'options' => ['id' => 'label1'],
- 'url' => '#',
- 'items' => [
- [
- 'label' => 'Profil',
- 'url' => Yii::$app->urlManager->createUrl(['user/update']),
- ],
- [
- 'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
- 'url' => Yii::$app->urlManager->createUrl(['site/logout']),
- ]
- ],
- 'visible' => !Yii::$app->user->isGuest
- ],
- ]
- ]);
- ?>
- </nav>
- </div>
- </header>
-
- <?php if(!Yii::$app->user->isGuest): ?>
- <section id="favorite-producers">
- <div class="container">
- <?php
- $producers = Etablissement::find()
- ->joinWith(['userEtablissement user_etablissement'])
- ->where([
- 'user_etablissement.id_user' => Yii::$app->user->id,
- 'user_etablissement.favoris' => 1,
- 'etablissement.actif' => 1
- ])
- ->all() ;
- ?>
- <?php if(count($producers)): ?>
- <h2>Mes producteurs</h2>
- <?php foreach($producers as $producer): ?>
- <div class="col-md-<?php if(count($producers) == 1): ?>6<?php elseif(count($producers) == 2): ?>6<?php else: ?>3<?php endif; ?>">
- <div class="producer" style="background-image:url('<?= Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ; ?>/uploads/<?= $producer->photo ?>');">
- <a class="btn btn-primary" href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index','slug_producer' => $producer->slug]); ?>"><?= Html::encode($producer->nom); ?></a>
- </div>
- </div>
- <?php endforeach;?>
- <?php else: ?>
- <div id="discover">
- <p>Vous n'avez aucun producteur dans vos favoris : </p>
- <a class="btn btn-default btn-lg" href="<?= Yii::$app->urlManager->createUrl(['site/producers']); ?>"><span class="glyphicon glyphicon-grain"></span> Découvrez les producteurs</a>
- </div>
- <?php endif; ?>
- <div class="clr"></div>
- </div>
- </section>
- <?php endif; ?>
-
- <div id="main">
- <section class="container" id="content">
- <?php if(Yii::$app->session->hasFlash('error')): ?>
- <div class="alert alert-danger" role="alert">
- <?= Yii::$app->session->getFlash('error') ?>
- </div>
- <?php endif; ?>
- <?php if(Yii::$app->session->hasFlash('success')): ?>
- <div class="alert alert-success" role="alert">
- <?= Yii::$app->session->getFlash('success') ?>
- </div>
- <?php endif; ?>
-
- <?= $content ?>
-
- </section>
- </div>
- <footer id="footer">
- <div class="container">
- <a href="<?php echo Yii::$app->urlManager->createUrl('site/contact') ; ?>">Contact</a> •
- <a href="<?php echo Yii::$app->urlManager->createUrl('site/mentions') ; ?>">Mentions légales</a> •
- <a href="<?php echo Yii::$app->urlManager->createUrl('site/cgv') ; ?>">CGS</a>
- </div>
- </footer>
-
- <?php $this->endBody() ?>
-
- <!-- analytics -->
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
-
- ga('create', 'UA-86917043-1', 'auto');
- ga('send', 'pageview');
- </script>
- </body>
- </html>
- <?php $this->endPage() ?>
|