選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

77 行
2.7KB

  1. <?php
  2. use backend\assets\AppAsset;
  3. use yii\helpers\Html;
  4. use yii\bootstrap\Nav;
  5. use yii\bootstrap\NavBar;
  6. use yii\widgets\Breadcrumbs;
  7. /* @var $this \yii\web\View */
  8. /* @var $content string */
  9. AppAsset::register($this);
  10. ?>
  11. <?php $this->beginPage() ?>
  12. <!DOCTYPE html>
  13. <html lang="<?= Yii::$app->language ?>">
  14. <head>
  15. <meta charset="<?= Yii::$app->charset ?>">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <?= Html::csrfMetaTags() ?>
  18. <title><?= Html::encode($this->title) ?> - Le Chat des Noisettes</title>
  19. <?php $this->head() ?>
  20. </head>
  21. <body>
  22. <?php $this->beginBody() ?>
  23. <div class="wrap">
  24. <?php
  25. NavBar::begin([
  26. 'brandLabel' => 'Le Chat des Noisettes',
  27. 'brandUrl' => Yii::$app->homeUrl,
  28. 'options' => [
  29. 'class' => 'navbar-inverse navbar-fixed-top',
  30. ],
  31. ]);
  32. $menuItems = [
  33. ['label' => 'Production', 'url' => ['/commande/index'], 'visible'=> !Yii::$app->user->isGuest],
  34. ['label' => 'Pain', 'url' => ['/produit/index'], 'visible'=> !Yii::$app->user->isGuest],
  35. ['label' => 'Vrac', 'url' => ['/vrac/index'], 'visible'=> !Yii::$app->user->isGuest],
  36. ['label' => 'Points de vente', 'url' => ['/point-vente/index'], 'visible'=> !Yii::$app->user->isGuest],
  37. ['label' => 'Utilisateurs', 'url' => ['/user/index'], 'visible'=> !Yii::$app->user->isGuest],
  38. ['label' => 'Statistiques', 'url' => ['/stats/index'], 'visible'=> !Yii::$app->user->isGuest],
  39. ];
  40. if (Yii::$app->user->isGuest) {
  41. $menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']];
  42. } else {
  43. $menuItems[] = [
  44. 'label' => 'Déconnexion (' . Yii::$app->user->identity->username . ')',
  45. 'url' => ['/site/logout'],
  46. 'linkOptions' => ['data-method' => 'post']
  47. ];
  48. }
  49. echo Nav::widget([
  50. 'options' => ['class' => 'navbar-nav navbar-right'],
  51. 'items' => $menuItems,
  52. ]);
  53. NavBar::end();
  54. ?>
  55. <div class="container">
  56. <?= Breadcrumbs::widget([
  57. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  58. ]) ?>
  59. <?= $content ?>
  60. </div>
  61. </div>
  62. <footer class="footer">
  63. <div class="container">
  64. <p class="pull-left"></p>
  65. <p class="pull-right"><?= Yii::powered() ?></p>
  66. </div>
  67. </footer>
  68. <?php $this->endBody() ?>
  69. </body>
  70. </html>
  71. <?php $this->endPage() ?>