You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
8.9KB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\bootstrap\Nav;
  4. use yii\bootstrap\NavBar;
  5. use yii\widgets\Breadcrumbs;
  6. use frontend\assets\AppAsset;
  7. use frontend\widgets\Alert;
  8. use common\helpers\Url ;
  9. /* @var $this \yii\web\View */
  10. /* @var $content string */
  11. $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ;
  12. AppAsset::register($this);
  13. ?>
  14. <?php $this->beginPage() ?>
  15. <!DOCTYPE html>
  16. <head>
  17. <title><?php if($is_home): ?>La boîte à pain &bull; <?= Html::encode($this->getPageTitle()) ?> <?php else: ?><?= Html::encode($this->getPageTitle()) ?> &bull; La boîte à pain<?php endif; ?></title>
  18. <meta charset="utf-8">
  19. <meta name="viewport" content="width=device-width, initial-scale=1">
  20. <?= Html::csrfMetaTags() ?>
  21. <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
  22. <!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico" /><![endif]-->
  23. <?php $this->head() ?>
  24. <!--[if lt IE 9]>
  25. <script src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/js/html5shiv.min.js"></script>
  26. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie.css" rel="stylesheet">
  27. <![endif]-->
  28. <!--[if IE 7]>
  29. <link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet">
  30. <![endif]-->
  31. </head>
  32. <body class="<?php if($is_home): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>">
  33. <?php $this->beginBody() ?>
  34. <?php if(YII_ENV == 'demo'): ?>
  35. <div id="block-demo">
  36. <div class="container">
  37. <span class="glyphicon glyphicon-eye-open"></span> <strong>Espace de démonstration</strong> :
  38. Testez la plateforme sans avoir à vous inscrire. Les données sont réinitialisées quotidiennement &bull; <?= Html::a('Retour', Url::env('prod', 'frontend')) ?>
  39. </div>
  40. </div>
  41. <?php endif; ?>
  42. <div id="main">
  43. <div class="col-md-3" id="col-left">
  44. <div class="affix">
  45. <section id="logo">
  46. <a id="link-home" href="<?php if(Yii::$app->user->isGuest): echo Yii::$app->urlManager->createUrl('site/index') ; else: echo Yii::$app->urlManager->createUrl('commande/index') ; endif; ?>">
  47. <img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
  48. <div class="text">
  49. <div class="bap">La boîte à pain</div>
  50. <div class="plateforme">Plateforme de réservation
  51. <?php if(YII_ENV == 'dev' || YII_ENV == 'demo'): ?><?php if(YII_ENV == 'dev'): ?><?php elseif(YII_ENV == 'demo'): ?><?php endif; ?></div><?php endif; ?>
  52. </div>
  53. <div class="clr"></div>
  54. </a>
  55. </section>
  56. <section id="links">
  57. <nav>
  58. <ul class="">
  59. <?php if(!Yii::$app->user->isGuest):?>
  60. <li class="col-md-3"><a <?php if(Yii::$app->controller->id == 'commande' && Yii::$app->controller->action->id == 'index'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('commande/index') ; ?>"><span class="glyphicon glyphicon-th-list"></span><span class="libelle">Tableau de bord</span></a></li>
  61. <li class="col-md-3"><a <?php if(Yii::$app->controller->id == 'user' && Yii::$app->controller->action->id == 'update'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('user/update') ; ?>"><span class="glyphicon glyphicon-user"></span><span class="libelle">Profil</span></a></li>
  62. <?php if(Yii::$app->user->identity->isBoulanger()): ?><li class="col-md-3"><a class="" id="link-espace-boulanger" href="<?php echo Url::backend(); ?>"><span class="glyphicon glyphicon-grain"></span> <span class="libelle">Espace boulanger</span></a></li><?php endif; ?>
  63. <li class="col-md-3"><a id="link-logout" href="<?php echo Yii::$app->urlManager->createUrl('site/logout') ; ?>"><span class="glyphicon glyphicon-off"></span> <span class="libelle">Déconnexion</span><br /><span class="nom"><?php echo Html::encode(Yii::$app->user->identity->prenom .' '. substr(strtoupper(Yii::$app->user->identity->nom), 0, 1).'.') ; ?></span></a></li>
  64. <?php else: ?>
  65. <li class="col-md-6"><a <?php if(Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'login'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('site/login') ; ?>"><span class="glyphicon glyphicon-log-in"></span> Connexion</a></li>
  66. <li class="col-md-6"><a <?php if(Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'signup'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('site/signup') ; ?>"><span class="glyphicon glyphicon-user"></span> Inscription</a></li>
  67. <?php endif;?>
  68. </ul>
  69. </nav>
  70. <div class="clr"></div>
  71. </section>
  72. <?php if(Yii::$app->user->isGuest):?>
  73. <p>&#10149; Connectez-vous ou créez un compte pour passer commande chez votre producteur.</p>
  74. <p>&#10149; Producteurs, vous pouvez tester l'outil avant de créer votre compte : <a class="btn btn-default btn-xs" id="btn-demo" href="http://demo.laboiteapain.net/"><span class="glyphicon glyphicon-eye-open"></span> Espace de démo</a>
  75. </p>
  76. <?php else: ?>
  77. <section id="producteurs">
  78. <h2>Producteurs</h2>
  79. <nav class="nav-producteurs">
  80. <ul>
  81. <li>
  82. <a href="<?= Yii::$app->urlManager->createUrl(['etablissement/index']) ; ?>">
  83. <span class="name">Le Chat des Noisettes</span>
  84. </a>
  85. </li>
  86. <li><a href="<?= Yii::$app->urlManager->createUrl(['etablissement/index']) ; ?>">Ferme de Coucourdon</a></li>
  87. <li><a href="<?= Yii::$app->urlManager->createUrl(['etablissement/index']) ; ?>">Terre de Pains</a></li>
  88. <li><a href="#"><span class="glyphicon glyphicon-plus"></span> Ajouter un producteur</a></li>
  89. </ul>
  90. </nav>
  91. </section>
  92. <?php endif; ?>
  93. <footer id="footer">
  94. <div class="">
  95. <a href="<?php echo Yii::$app->urlManager->createUrl('site/contact') ; ?>">Contact</a>
  96. <a href="<?php echo Yii::$app->urlManager->createUrl('site/mentions') ; ?>">Mentions légales</a>
  97. <a href="<?php echo Yii::$app->urlManager->createUrl('site/cgv') ; ?>">CGS</a>
  98. </div>
  99. </footer>
  100. </div>
  101. </div>
  102. <section class="col-md-9 col-lg-offset-3" id="content">
  103. <?php if(strlen($this->getTitle())): ?>
  104. <div class="header-title">
  105. <h1><?php if(strlen($this->getTitleIcon())): ?><span class="glyphicon <?= $this->getTitleIcon(); ?>"></span><?php endif; ?> <?= $this->getTitle(); ?></h1>
  106. <?php if(strlen($this->getSubtitle())): ?><h2><?= $this->getSubtitle(); ?></h2><?php endif; ?>
  107. </div>
  108. <?php endif; ?>
  109. <div id="the-content">
  110. <?php if(Yii::$app->session->hasFlash('error')): ?>
  111. <div class="alert alert-danger" role="alert">
  112. <?= Yii::$app->session->getFlash('error') ?>
  113. </div>
  114. <?php endif; ?>
  115. <?php if(Yii::$app->session->hasFlash('success')): ?>
  116. <div class="alert alert-success" role="alert">
  117. <?= Yii::$app->session->getFlash('success') ?>
  118. </div>
  119. <?php endif; ?>
  120. <?= $content ?>
  121. </div>
  122. </section>
  123. <div class="clr"></div>
  124. </div>
  125. <?php $this->endBody() ?>
  126. <!-- analytics -->
  127. <script>
  128. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  129. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  130. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  131. })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  132. ga('create', 'UA-86917043-1', 'auto');
  133. ga('send', 'pageview');
  134. </script>
  135. </body>
  136. </html>
  137. <?php $this->endPage() ?>