Преглед изворни кода

Améliorations header

- gestion des listes vides (nouveaux utilisateurs, utilisateurs au crédit négatif)
- lien vers "Mon espace producteur"
dev
Guillaume Bourgeois пре 5 година
родитељ
комит
735eda6ed0
1 измењених фајлова са 33 додато и 8 уклоњено
  1. +33
    -8
      backend/views/layouts/header.php

+ 33
- 8
backend/views/layouts/header.php Прегледај датотеку

@@ -74,6 +74,7 @@ use yii\helpers\ArrayHelper;
<?php else: ?><span class="label label-warning">0</span><?php endif; ?>
</a>
<ul class="dropdown-menu">
<?php if(count($usersArray)): ?>
<li class="header">Inscriptions des 7 derniers jours</li>
<li>
<ul class="menu">
@@ -86,6 +87,9 @@ use yii\helpers\ArrayHelper;
<?php endforeach; ?>
</ul>
</li>
<?php else: ?>
<li class="header">Aucun nouvel inscrit ces 7 derniers jours.</li>
<?php endif; ?>
</ul>
</li>
@@ -104,7 +108,9 @@ use yii\helpers\ArrayHelper;
<?php if(count($usersNegativeCreditArray)): ?><span class="label label-warning"><?= count($usersNegativeCreditArray) ?></span>
<?php else: ?><span class="label label-success">0</span><?php endif; ?>
</a>
<ul class="dropdown-menu">
<?php if(count($usersNegativeCreditArray)): ?>
<li class="header">Utilisateurs au crédit négatif</li>
<li>
<ul class="menu">
@@ -117,7 +123,11 @@ use yii\helpers\ArrayHelper;
<?php endforeach; ?>
</ul>
</li>
<?php else: ?>
<li class="header">Aucun de vos utilisateurs n'a de crédit négatif.</li>
<?php endif; ?>
</ul>
</li>
<?php if (User::isCurrentProducer() || User::isCurrentAdmin()): ?>
@@ -125,23 +135,39 @@ use yii\helpers\ArrayHelper;
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-home"></i>
<span><?= Html::encode(Yii::$app->user->identity->getNameProducer()); ?></span>
<i class="fa fa-caret-down"></i>
</a>
<?php if(User::isCurrentAdmin()): ?>
<ul class="dropdown-menu">
<?php $producersArray = Producer::find()->orderBy('name ASC')->all(); ?>
<?php foreach($producersArray as $producer): ?>
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/change-producer', 'id' => $producer->id]); ?>"><?= Html::encode($producer->name) ?></a></li>
<?php endforeach; ?>
<?php if(User::isCurrentAdmin()): ?>
<li>
<a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/index','slug_producer' => Producer::getCurrent()->slug]); ?>">
<i class="fa fa-th-large"></i>
<span class="hidden-xs">Espace du producteur</span>
</a>
</li>
<li class="header">&nbsp;<strong>Autres producteurs</strong></li>
<?php $producersArray = Producer::find()->orderBy('name ASC')->all(); ?>
<?php foreach($producersArray as $producer): ?>
<li><a href="<?= Yii::$app->urlManagerBackend->createUrl(['site/change-producer', 'id' => $producer->id]); ?>"><?= Html::encode($producer->name) ?></a></li>
<?php endforeach; ?>
<?php else: ?>
<li>
<a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/index','slug_producer' => Producer::getCurrent()->slug]); ?>">
<i class="fa fa-th-large"></i>
<span class="hidden-xs">Mon espace</span>
</a>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
</li>
<?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>
<i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu">
<li><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl(['user/update']); ?>"><i class="fa fa-user"></i> Profil</a></li>
@@ -149,7 +175,6 @@ use yii\helpers\ArrayHelper;
</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>

Loading…
Откажи
Сачувај