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.

76 lines
4.8KB

  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. /* @var $this \yii\web\View */
  9. /* @var $content string */
  10. $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ;
  11. AppAsset::register($this);
  12. ?>
  13. <?php $this->beginPage() ?>
  14. <!DOCTYPE html>
  15. <head>
  16. <title><?php if($is_home): ?>Le Chat des Noisettes &bull; <?= Html::encode($this->title) ?> <?php else: ?><?= Html::encode($this->title) ?> &bull; Le Chat des Noisettes<?php endif; ?></title>
  17. <meta charset="utf-8">
  18. <meta name="viewport" content="width=device-width, initial-scale=1">
  19. <?php if($is_home): ?><meta name="description" content="Pains sur levain, à la farine de meule et au sel de Salins, cuits au feu de bois, à Déservillers." /><?php endif; ?>
  20. <?= Html::csrfMetaTags() ?>
  21. <link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon2.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. <div id="back"></div>
  35. <header id="header">
  36. <div class="container">
  37. <a id="link-home" href="<?= Yii::$app->urlManager->createUrl('site/index') ; ?>"><img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/fournisseurs.png" alt="" /></a>
  38. <nav>
  39. <ul class="nav nav-pills">
  40. <?php if(!Yii::$app->user->isGuest): ?>
  41. <li><a <?php if(Yii::$app->controller->id == 'commande' && Yii::$app->controller->action->id == 'create'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('commande/create') ; ?>"><span class="glyphicon glyphicon-plus"></span> Commander</a></li>
  42. <li><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> Historique</a></li>
  43. <li><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> Profil</a></li>
  44. <li><a id="link-logout" href="<?php echo Yii::$app->urlManager->createUrl('site/logout') ; ?>"><span class="glyphicon glyphicon-off"></span> Déconnexion <span class="nom">(<?php echo Html::encode(Yii::$app->user->identity->prenom .' '. substr(strtoupper(Yii::$app->user->identity->nom), 0, 1).'.') ; ?>)</span></a></li>
  45. <?php if(Yii::$app->user->identity->isBoulanger()): ?><li><a class="btn btn-default" id="link-espace-boulanger" href="../../backend/web/"><span class="glyphicon glyphicon-grain"></span> Espace boulanger</a></li><?php endif; ?>
  46. <?php else: ?>
  47. <li><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>
  48. <li><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>
  49. <?php endif;?>
  50. </ul>
  51. </nav>
  52. </div>
  53. </header>
  54. <div id="main">
  55. <section class="<?php if(!$is_home): ?>container<?php endif;?>" id="content">
  56. <?= $content ?>
  57. </section>
  58. </div>
  59. <footer id="footer">
  60. <div class="container">
  61. <a href="<?php echo Yii::$app->urlManager->createUrl('site/mentions') ; ?>">Mentions légales</a>
  62. </div>
  63. </footer>
  64. <?php $this->endBody() ?>
  65. </body>
  66. </html>
  67. <?php $this->endPage() ?>