Browse Source

[Administration] Menu administration

feature/souke
Guillaume Bourgeois 10 months ago
parent
commit
42173d5c47
3 changed files with 115 additions and 101 deletions
  1. +58
    -56
      backend/views/layouts/left.php
  2. +51
    -45
      backend/web/css/screen.css
  3. +6
    -0
      backend/web/sass/_adminlte.scss

+ 58
- 56
backend/views/layouts/left.php View File

@@ -60,9 +60,13 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
<section class="sidebar">
<?php
$producer = GlobalParam::getCurrentProducer();
$newVersionOpendistribLabel = '';
if ($producer && !$producerModule->isUpToDateWithOpendistribVersion($producer)) {
$newVersionOpendistribLabel = '<span class="pull-right-container"><small class="label pull-right bg-green">' . GlobalParam::getOpendistribVersion() . '</small></span>';
$versionOpendistribLabel = '';
if ($producer) {
$backgroundLabelVersionOpendistrib = 'black';
if(!$producerModule->isUpToDateWithOpendistribVersion($producer)) {
$backgroundLabelVersionOpendistrib = 'green';
}
$versionOpendistribLabel = '<span class="pull-right-container"><small class="label pull-right bg-'.$backgroundLabelVersionOpendistrib.'">' . GlobalParam::getOpendistribVersion() . '</small></span>';
}

$countTicketsProducerUnreadLabel = '';
@@ -91,28 +95,12 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
$sumUserProducerCreditsLabel = '';
//$sumUserProducerCreditsLabel = '<span class="pull-right-container"><small class="label pull-right '.($sumUserProducerCredits >= 0 ? 'bg-green' : 'bg-red') .'">'.number_format($sumUserProducerCredits, 2).' €</small></span>';

$countUsersWithStatusProducerOnline = $userModule->getRepository()->countUsersStatusProducerOnline();
$countUsersWithStatusProducerOnlineLabel = '';
if ($countUsersWithStatusProducerOnline) {
$countUsersWithStatusProducerOnlineLabel = '<small class="label pull-right bg-red">' . $countUsersWithStatusProducerOnline . '</small>';
}

$countUsersWithStatusProducerOnline = $userModule->getRepository()->countUsersStatusProducerOnline();
$countUsersWithStatusUserOnline = $userModule->getRepository()->countUsersStatusUserOnline();
$countUsersWithStatusUserOnlineLabel = '';
if ($countUsersWithStatusUserOnline) {
$countUsersWithStatusUserOnlineLabel = '<small class="label pull-right bg-blue">' . $countUsersWithStatusUserOnline . '</small>';
}

$countUsersOnlineLabel = '';
$countUsersProducersOnlineLabel = '';
if ($countUsersWithStatusProducerOnline || $countUsersWithStatusUserOnline) {
$countUsersOnlineLabel = '<span class="pull-right-container">';
if ($countUsersWithStatusUserOnline) {
$countUsersOnlineLabel .= $countUsersWithStatusUserOnlineLabel;
}
if ($countUsersWithStatusProducerOnline) {
$countUsersOnlineLabel .= $countUsersWithStatusProducerOnlineLabel;
}
$countUsersOnlineLabel .= '</span>';
$countUsersProducersOnlineLabel = '<span class="pull-right-container"><small class="label pull-right bg-blue">' . ($countUsersWithStatusProducerOnline + $countUsersWithStatusUserOnline) . '</small></span>';
}

$countProducerInvoicesUnpaidLabel = '';
@@ -129,6 +117,49 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
[
'options' => ['class' => 'sidebar-menu tree', 'data-widget' => 'tree'],
'items' => [

// Administration
['label' => 'Administration', 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsAdministrator],
[
'label' => 'En ligne',
'icon' => 'wifi',
'url' => ['online-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'template' => '<a href="{url}">{icon} {label}' . $countUsersProducersOnlineLabel . '</a>'
],
[
'label' => 'Support',
'icon' => 'comments',
'url' => ['support-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'template' => '<a href="{url}">{icon} {label}' . $countTicketsLabel . '</a>'
],
['label' => 'Producteurs', 'icon' => 'th-list', 'url' => ['/producer-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
[
'label' => 'Statistiques',
'icon' => 'line-chart',
'url' => ['/stats-admin/matomo'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'items' => [
['label' => 'Matomo', 'icon' => 'line-chart', 'url' => ['/stats-admin/matomo'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Chiffre d\'affaire', 'icon' => 'line-chart', 'url' => ['/stats-admin/turnover'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Commandes clients', 'icon' => 'calendar', 'url' => ['/stats-admin/customer-orders'], 'visible' => $isUserCurrentGrantedAsAdministrator],
],
],
[
'label' => 'Configuration',
'icon' => 'cog',
'url' => ['/setting-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'items' => [
['label' => 'Paramètres', 'icon' => 'cog', 'url' => ['/setting-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator && $featureChecker->isEnabled(Feature::ALIAS_SETTINGS)],
['label' => 'Fonctionnalités', 'icon' => 'flag', 'url' => ['/feature-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Tranches de prix', 'icon' => 'eur', 'url' => ['/producer-price-range-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Taxes', 'icon' => 'eur', 'url' => ['/tax-rate-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
],
],

// Support
['label' => "Besoin d'aide ?", 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer],
[
'label' => 'Support',
@@ -137,6 +168,8 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
'visible' => $isUserCurrentGrantedAsProducer,
'template' => '<a href="{url}">{icon} {label} <span class="pull-right-container">' . $developerOnlineLabel . $countTicketsProducerUnreadLabel . '</span></a>'
],

// Producteur
['label' => $producer->name, 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsProducer],
['label' => 'Tableau de bord', 'icon' => 'dashboard', 'url' => ['/dashboard/index'], 'visible' => $isUserCurrentGrantedAsProducer],
['label' => 'Distributions', 'icon' => 'calendar', 'url' => ['/distribution/index'], 'visible' => $isUserCurrentGrantedAsProducer],
@@ -219,45 +252,14 @@ $isUserCurrentGrantedAsProducer = $userModule->getAuthorizationChecker()->isGran
'url' => ['/development/index'],
'visible' => $isUserCurrentGrantedAsProducer,
'active' => Yii::$app->controller->id == 'development',
'template' => '<a href="{url}">{icon} {label}' . $newVersionOpendistribLabel . '</a>'
],
['label' => 'Administration', 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsAdministrator],
[
'label' => 'En ligne',
'icon' => 'wifi',
'url' => ['online-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'template' => '<a href="{url}">{icon} {label}' . $countUsersOnlineLabel . '</a>'
],
[
'label' => 'Support',
'icon' => 'comments',
'url' => ['support-admin/index'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'template' => '<a href="{url}">{icon} {label}' . $countTicketsLabel . '</a>'
],
['label' => 'Producteurs', 'icon' => 'th-list', 'url' => ['/producer-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
[
'label' => 'Statistiques',
'icon' => 'line-chart',
'url' => ['/stats-admin/matomo'],
'visible' => $isUserCurrentGrantedAsAdministrator,
'items' => [
['label' => 'Matomo', 'icon' => 'line-chart', 'url' => ['/stats-admin/matomo'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Chiffre d\'affaire', 'icon' => 'line-chart', 'url' => ['/stats-admin/turnover'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Commandes clients', 'icon' => 'calendar', 'url' => ['/stats-admin/customer-orders'], 'visible' => $isUserCurrentGrantedAsAdministrator],
],
'template' => '<a href="{url}">{icon} {label}' . $versionOpendistribLabel . '</a>'
],
['label' => 'Paramètres', 'icon' => 'cog', 'url' => ['/setting-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator && $featureChecker->isEnabled(Feature::ALIAS_SETTINGS)],
['label' => 'Fonctionnalités', 'icon' => 'flag', 'url' => ['/feature-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Tranches de prix', 'icon' => 'eur', 'url' => ['/producer-price-range-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Taxes', 'icon' => 'eur', 'url' => ['/tax-rate-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Communiquer', 'icon' => 'bullhorn', 'url' => ['/communicate-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],

//['label' => 'Communiquer', 'icon' => 'bullhorn', 'url' => ['/communicate-admin/index'], 'visible' => $isUserCurrentGrantedAsAdministrator],
//['label' => 'Outils', 'options' => ['class' => 'header'], 'visible' => $isUserCurrentGrantedAsAdministrator],
//['label' => 'Gii', 'icon' => 'file-code-o', 'url' => ['/gii'], 'visible' => $isUserCurrentGrantedAsAdministrator],
//['label' => 'Debug', 'icon' => 'dashboard', 'url' => ['/debug'], 'visible' => $isUserCurrentGrantedAsAdministrator],
['label' => 'Login', 'url' => ['site/login'], 'visible' => !$userModule->isCurrentConnected()],
//['label' => 'Login', 'url' => ['site/login'], 'visible' => !$userModule->isCurrentConnected()],
],
]
) ?>

+ 51
- 45
backend/web/css/screen.css View File

@@ -1709,85 +1709,91 @@ body.skin-black .main-header .navbar .nav li.producer-menu .offline {
body.skin-black .sidebar .sidebar-menu > li.header {
color: #899397;
}
/* line 179, ../sass/_adminlte.scss */
/* line 178, ../sass/_adminlte.scss */
body.skin-black .sidebar .label {
padding-top: 5px;
position: relative;
top: -3px;
}
/* line 185, ../sass/_adminlte.scss */
body.skin-black .sidebar-menu > li.active > a {
border-color: #F39C12;
}
/* line 184, ../sass/_adminlte.scss */
/* line 190, ../sass/_adminlte.scss */
body.skin-black section.sidebar .user-panel {
text-align: center;
}
/* line 187, ../sass/_adminlte.scss */
/* line 193, ../sass/_adminlte.scss */
body.skin-black section.sidebar .user-panel .image {
margin-bottom: 3px;
}
/* line 191, ../sass/_adminlte.scss */
/* line 197, ../sass/_adminlte.scss */
body.skin-black section.sidebar .user-panel .title {
font-weight: bold;
color: white;
}
/* line 198, ../sass/_adminlte.scss */
/* line 204, ../sass/_adminlte.scss */
body.skin-black .content-wrapper {
background-color: #f5f5f5;
}
/* line 201, ../sass/_adminlte.scss */
/* line 207, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header {
background-color: #F5F5F5;
padding-bottom: 15px;
border-bottom: solid 1px #e0e0e0;
border-top: solid 1px #e0e0e0;
}
/* line 207, ../sass/_adminlte.scss */
/* line 213, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header .btn {
padding: 3px 6px;
font-size: 10px;
font-family: Arial;
text-transform: uppercase;
}
/* line 214, ../sass/_adminlte.scss */
/* line 220, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .content-header h1 {
font-family: 'myriadpro-light';
font-size: 20px;
}
/* line 220, ../sass/_adminlte.scss */
/* line 226, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .col-no-padding-left {
padding-left: 0px;
}
/* line 224, ../sass/_adminlte.scss */
/* line 230, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .col-no-padding-right {
padding-right: 0px;
}
/* line 228, ../sass/_adminlte.scss */
/* line 234, ../sass/_adminlte.scss */
body.skin-black .content-wrapper a {
color: #e08e0b;
}
/* line 232, ../sass/_adminlte.scss */
/* line 238, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .label {
padding-top: 4px;
padding-bottom: 1px;
}
/* line 237, ../sass/_adminlte.scss */
/* line 243, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn {
color: white;
}
/* line 241, ../sass/_adminlte.scss */
/* line 247, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-default {
color: #333;
background-color: white;
}
/* line 246, ../sass/_adminlte.scss */
/* line 252, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .btn-primary {
background-color: #F39C12;
color: white;
border-color: #F39C12;
}
/* line 253, ../sass/_adminlte.scss */
/* line 259, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .nav.nav-tabs .badge {
margin-left: 4px;
background-color: #e0e0e0;
color: #444;
}
/* line 260, ../sass/_adminlte.scss */
/* line 266, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .tab-content {
border-left: solid 1px #ddd;
border-bottom: solid 1px #ddd;
@@ -1795,20 +1801,20 @@ body.skin-black .content-wrapper .tab-content {
padding: 30px 15px 15px 15px;
background-color: white;
}
/* line 268, ../sass/_adminlte.scss */
/* line 274, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert {
position: relative;
}
/* line 271, ../sass/_adminlte.scss */
/* line 277, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert a {
color: white;
}
/* line 274, ../sass/_adminlte.scss */
/* line 280, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert a.btn {
color: #333;
text-decoration: none;
}
/* line 279, ../sass/_adminlte.scss */
/* line 285, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert .close {
font-size: 30px;
position: absolute;
@@ -1818,55 +1824,55 @@ body.skin-black .content-wrapper .alert .close {
color: white;
opacity: 0.6;
}
/* line 288, ../sass/_adminlte.scss */
/* line 294, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .alert .close:hover {
opacity: 1;
}
/* line 295, ../sass/_adminlte.scss */
/* line 301, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout h4 .fa {
margin-right: 7px;
}
/* line 298, ../sass/_adminlte.scss */
/* line 304, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout a {
color: white;
}
/* line 301, ../sass/_adminlte.scss */
/* line 307, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .callout .btn {
color: #333;
text-decoration: none;
}
/* line 308, ../sass/_adminlte.scss */
/* line 314, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th {
font-size: 13px;
}
/* line 311, ../sass/_adminlte.scss */
/* line 317, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table th.column-actions, body.skin-black .content-wrapper .table td.column-actions {
width: 172px;
text-align: right;
}
/* line 315, ../sass/_adminlte.scss */
/* line 321, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .table td.text-small, body.skin-black .content-wrapper .table th.text-small {
font-size: 12px;
}
/* line 320, ../sass/_adminlte.scss */
/* line 326, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > .active > a, body.skin-black .content-wrapper .pagination > .active > span, body.skin-black .content-wrapper .pagination > .active > a:hover, body.skin-black .content-wrapper .pagination > .active > span:hover, body.skin-black .content-wrapper .pagination > .active > a:focus, body.skin-black .content-wrapper .pagination > .active > span:focus {
background-color: #F39C12;
border: solid 1px #F39C12;
color: white;
}
/* line 326, ../sass/_adminlte.scss */
/* line 332, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a, body.skin-black .content-wrapper .pagination > li > span {
color: #F39C12;
}
/* line 328, ../sass/_adminlte.scss */
/* line 334, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .pagination > li > a:hover, body.skin-black .content-wrapper .pagination > li > span:hover {
color: #c87f0a;
}
/* line 333, ../sass/_adminlte.scss */
/* line 339, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .submenu {
margin-bottom: 25px;
}
/* line 337, ../sass/_adminlte.scss */
/* line 343, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-actions {
position: fixed;
bottom: 0;
@@ -1880,59 +1886,59 @@ body.skin-black .content-wrapper .form-actions {
z-index: 10;
border-top: solid 1px #e0e0e0;
}
/* line 350, ../sass/_adminlte.scss */
/* line 356, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-actions a, body.skin-black .content-wrapper .form-actions button {
margin-left: 10px;
}
/* line 355, ../sass/_adminlte.scss */
/* line 361, ../sass/_adminlte.scss */
body.skin-black .content-wrapper .form-buttons {
margin-top: 25px;
text-align: right;
}
/* line 362, ../sass/_adminlte.scss */
/* line 368, ../sass/_adminlte.scss */
body.skin-black .main-footer a {
color: #F39C12;
}
/* line 367, ../sass/_adminlte.scss */
/* line 373, ../sass/_adminlte.scss */
body.skin-black .gridview-pagesize {
float: right;
margin-bottom: 8px;
}
/* line 372, ../sass/_adminlte.scss */
/* line 378, ../sass/_adminlte.scss */
body.skin-black #yii-debug-toolbar {
bottom: 64px;
}

/* line 377, ../sass/_adminlte.scss */
/* line 383, ../sass/_adminlte.scss */
body.login-page {
background: none;
background-color: white;
}
/* line 381, ../sass/_adminlte.scss */
/* line 387, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo {
text-align: center;
font-family: 'highvoltageregular';
}
/* line 385, ../sass/_adminlte.scss */
/* line 391, ../sass/_adminlte.scss */
body.login-page .login-box .login-logo img {
width: 50px;
}
/* line 390, ../sass/_adminlte.scss */
/* line 396, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary {
background-color: #F39C12;
border-color: #F39C12;
padding: 5px 10px;
}
/* line 395, ../sass/_adminlte.scss */
/* line 401, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body .btn-primary:active {
background-color: #f4a62a;
border-color: #F39C12;
}
/* line 401, ../sass/_adminlte.scss */
/* line 407, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a {
color: #F39C12;
}
/* line 403, ../sass/_adminlte.scss */
/* line 409, ../sass/_adminlte.scss */
body.login-page .login-box .login-box-body a:hover {
color: #f4a62a;
}

+ 6
- 0
backend/web/sass/_adminlte.scss View File

@@ -174,6 +174,12 @@ body.skin-black {
.sidebar-menu > li.header {
color: #899397;
}

.label {
padding-top: 5px;
position: relative;
top: -3px;
}
}

.sidebar-menu > li.active > a {

Loading…
Cancel
Save