Browse Source

Amélioration navigation frontend/producer/backend

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
b6ffd4c569
3 changed files with 20 additions and 11 deletions
  1. +4
    -2
      backend/views/layouts/header.php
  2. +1
    -1
      frontend/views/layouts/main.php
  3. +15
    -8
      producer/views/layouts/main.php

+ 4
- 2
backend/views/layouts/header.php View File

@@ -274,12 +274,14 @@ $producer = GlobalParam::getCurrentProducer();
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-user"></i>
<span class="hidden-xs"><?= Html::encode(GlobalParam::getCurrentUser()->name . ' ' . GlobalParam::getCurrentUser()->lastname); ?></span>
<span class="hidden-xs"><?= Html::encode(GlobalParam::getCurrentUser()->name . ' ' . substr(GlobalParam::getCurrentUser()->lastname, 0, 1) .'.'); ?></span>
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/index']); ?>"><i
class="fa fa-chevron-left"></i> Retour à l'accueil</a></li>
<li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']); ?>"><i
class="fa fa-user"></i> Profil</a></li>
class="fa fa-user"></i> Mon profil</a></li>
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/logout']); ?>"><i
class="fa fa-sign-out"></i> Déconnexion</a></li>
</ul>

+ 1
- 1
frontend/views/layouts/main.php View File

@@ -84,7 +84,7 @@ if ($userManager->isCurrentProducer()) {
<section id="section-user-top">
<nav class="navbar navbar-default">
<div class="container">
<?php if ($userManager->isCurrentProducer()): ?>
<?php if ($userManager->isCurrentProducer() && false): ?>
<div class="navbar-header">
<span class="producer-panel<?php if (!$producer->logo): ?> without-logo<?php endif; ?>">
<?php if ($producer->logo): ?>

+ 15
- 8
producer/views/layouts/main.php View File

@@ -81,7 +81,7 @@ if (!Yii::$app->user->isGuest) {
<section id="section-user-top">
<nav class="navbar navbar-default">
<div class="container">
<?php if ($userManager->isCurrentProducer()): ?>
<?php if ($userManager->isCurrentProducer() && false): ?>
<div class="navbar-header">
<span class="producer-panel<?php if (!$producerUser->logo): ?> without-logo<?php endif; ?>">
<?php if ($producerUser->logo): ?>
@@ -107,18 +107,26 @@ if (!Yii::$app->user->isGuest) {
'url' => $this->getUrlManagerBackend()->createAbsoluteUrl(['site/index']),
'visible' => $userManager->isCurrentProducer()
],
/*[
[
'label' => '<span class="glyphicon glyphicon-search"></span> Producteurs',
'url' => $this->getUrlManagerFrontend()->createAbsoluteUrl(['site/producers']),
'visible' => true
],*/
'visible' => !$userManager->isCurrentProducer()
],
[
'label' => '<span class="glyphicon glyphicon-user"></span> ' . ((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->name . ' ' . strtoupper(substr(Yii::$app->user->identity->lastname, 0, 1))) : '') . '. ',
'options' => ['id' => 'label1'],
'url' => '#',
'items' => [
/*[
'label' => '<span class="glyphicon glyphicon-search"></span> Producteurs',
'url' => $this->getUrlManagerFrontend()->createUrl(['site/producers']),
],*/
[
'label' => '<span class="glyphicon glyphicon-chevron-left"></span> Retour à l\'accueil',
'url' => $this->getUrlManagerFrontend()->createUrl(['site/index']),
],
[
'label' => '<span class="glyphicon glyphicon-user"></span> Profil',
'label' => '<span class="glyphicon glyphicon-user"></span> Mon profil',
'url' => $this->getUrlManagerFrontend()->createUrl(['user/update']),
],
[
@@ -175,7 +183,6 @@ echo Nav::widget([
],
'visible' => \Yii::$app->user->isGuest
],

[
'label' => '<span class="glyphicon glyphicon-menu-hamburger"></span>',
'options' => ['id' => 'label1'],
@@ -293,12 +300,12 @@ echo Nav::widget([
'url' => $this->getUrlManagerProducer()->createUrl(['site/contact']),
'active' => $this->getControllerAction() == 'site/contact',
],
[
/*[
'label' => '<span class="glyphicon glyphicon-cog"></span> Administration',
'url' => $this->getUrlManagerBackend()->createAbsoluteUrl(['site/index']),
'visible' => isset(Yii::$app->user->identity) && $this->getUserManager()->isProducer(\Yii::$app->user->identity),
'options' => ['id' => 'btn-administration']
],
],*/
],
]);
?>

Loading…
Cancel
Save