Browse Source

Header : intégration menu utilisateur

refactoring
Guillaume Bourgeois 5 years ago
parent
commit
9b9c46e060
5 changed files with 22 additions and 53 deletions
  1. +0
    -1
      backend/controllers/SiteController.php
  2. +1
    -0
      backend/views/layouts/content.php
  3. +19
    -50
      backend/views/layouts/header.php
  4. +1
    -1
      backend/web/css/screen.css
  5. +1
    -1
      backend/web/sass/_adminlte.scss

+ 0
- 1
backend/controllers/SiteController.php View File

'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
'actions' => [ 'actions' => [
'logout' => ['post'],
], ],
], ],
]; ];

+ 1
- 0
backend/views/layouts/content.php View File

<section class="content"> <section class="content">
<?= Alert::widget() ?> <?= Alert::widget() ?>
<?= $content ?> <?= $content ?>
<div class="clr"></div>
</section> </section>
</div> </div>



+ 19
- 50
backend/views/layouts/header.php View File

</li> </li>
</ul> </ul>
</li> </li>
<!-- User Account: style can be found in dropdown.less -->

<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="user-image" alt="User Image"/>
<span class="hidden-xs">Alexander Pierce</span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="img-circle"
alt="User Image"/>

<p>
Alexander Pierce - Web Developer
<small>Member since Nov. 2012</small>
</p>
</li>
<!-- Menu Body -->
<li class="user-body">
<div class="col-xs-4 text-center">
<a href="#">Followers</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">Sales</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">Friends</a>
</div>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="#" class="btn btn-default btn-flat">Profile</a>
</div>
<div class="pull-right">
<?= Html::a(
'Sign out',
['/site/logout'],
['data-method' => 'post', 'class' => 'btn btn-default btn-flat']
) ?>
</div>
</li>
</ul>
</li>

<!-- User Account: style can be found in dropdown.less -->
<li class="link-control-sidebar">
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
</li>
<?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?> <?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-home"></i>
<span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span> <span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span>
</a> </a>
<?php if(User::isCurrentAdmin()): ?> <?php if(User::isCurrentAdmin()): ?>
<?php endif; ?> <?php endif; ?>
</li> </li>
<?php endif; ?> <?php endif; ?>
<!-- User Account: style can be found in dropdown.less -->
<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(User::getCurrent()->name.' '.User::getCurrent()->lastname) ; ?></span>
</a>
<ul class="dropdown-menu">
<li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']); ?>"><i class="fa fa-user"></i> Profil</a></li>
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/logout']); ?>"><i class="fa fa-sign-out"></i> Déconnexion</a></li>
</ul>
</li>

<!-- User Account: style can be found in dropdown.less -->
<li class="link-control-sidebar">
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
</li>
</ul> </ul>
</div> </div>
</nav> </nav>

+ 1
- 1
backend/web/css/screen.css View File

} }


/* line 3, ../sass/_adminlte.scss */ /* line 3, ../sass/_adminlte.scss */
.main-header .messages-menu, .main-header .notifications-menu, .main-header .tasks-menu, .main-header .user-menu, .main-header .link-control-sidebar {
.main-header .messages-menu, .main-header .notifications-menu, .main-header .tasks-menu, .main-header .link-control-sidebar {
display: none; display: none;
} }

+ 1
- 1
backend/web/sass/_adminlte.scss View File



.main-header { .main-header {
.messages-menu, .notifications-menu, .tasks-menu, .user-menu, .link-control-sidebar {
.messages-menu, .notifications-menu, .tasks-menu, .link-control-sidebar {
display: none ; display: none ;
} }
} }

Loading…
Cancel
Save