Commit 00d07906 authored by Théo GUILLON's avatar Théo GUILLON
Browse files

Ajout : Amélioration de la navigation en tant que superadmin

Modification : générateur de menu pour prendre en compte un btn dans la nav.
Modification : rename class to icon qui correspond à l'icon devant le btn dans le menu
Modification : dissociation du header superadmin et user
parent d85ae55b
......@@ -46,6 +46,7 @@ Le format est basé sur le modèle [Keep a Changelog](http://keepachangelog.com/
- Modification de la variable "dpo_email" par "dpo_emaildpo"
- Modification de la variable "valeur_rt_organisation_email_dpo" par "valeur_rt_organisation_emaildpo"
- Modififcation de la police d'écriture (Ubuntu)
- Amélioration de la navigation en tant que superadmin
### Corrections
- Système de génération du numéro d'enregistrement du traitement au registre.
......
......@@ -822,8 +822,7 @@ class OrganisationsController extends AppController
} elseif ($this->Droits->isSu() === true && $redirect == 0) {
$this->Session->write('Droit.liste', $result);
$this->redirect([
'controller' => 'pannel',
'action' => 'superadmin'
'controller' => 'checks'
]);
} else {
if ($redirect != 1) {
......
......@@ -100,7 +100,7 @@ class PannelController extends AppController {
} elseif ($action === 'supprimer_la_notif') {
$this->Droits->assertNotSu();
} elseif ($action === 'superadmin') {
$this->Droits->assertSu();
throw new ForbiddenException(__d('default', 'default.flasherrorPasDroitPage'));
} elseif ($action === 'ajax_listing_users_organisation') {
$this->Droits->assertAuthorized([ListeDroit::DUPLIQUER_TRAITEMENT_OTHER_ORGANISATION]);
$this->Droits->assertNotSu();
......@@ -111,7 +111,10 @@ class PannelController extends AppController {
throw new ForbiddenException(__d('default', 'default.flasherrorPasDroitPage'));
}
}
/**
* @deprecated 14/04/2021 v2.1.0
*/
public function superadmin() {
// @todo : issues/255
// if (!empty($this->Session->read('Organisation'))) {
......
......@@ -16,4 +16,4 @@ msgstr ""
##################### Controller/ChecksController.php #######################
msgid "checks.titreIndex"
msgstr "Vérification de l'application"
msgstr "Bienvenue dans l'administration de l'application"
<?php
$this->Breadcrumbs->breadcrumbs([
$title => []
]);
?>
<div class="container-fluid" role="main">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
......
......@@ -14,14 +14,14 @@ if ($this->Session->read('Su') === false) {
<?php
$modalSelectOrganisations = false;
if ($this->Session->read('Su') === true) {
$logoAction = 'superadmin';
$logoAction = '/checks';
} else {
$logoAction = 'index';
$logoAction = '/';
}
?>
<li class="nav-item">
<a class="navbar-brand" href="/pannel/<?php echo $logoAction?>">
<a class="navbar-brand" href="<?php echo $logoAction?>">
<img src="/img/logo-white-blue.svg" title="Revenir à l'accueil de l'application" alt="<?php echo $cakeDescription?>">
</a>
</li>
......
This diff is collapsed.
<?php
$items = [
'Entités' => [
__d('default', 'default.sousTitreEntites') => [
'icon' => 'fa-building',
'url' => [
'controller' => 'organisations',
'action' => 'index'
]
],
__d('default', 'default.titreAdministrationEntite') => [
'icon' => 'fas fa-wrench',
'url' => [
'#' => '#'
],
'data-toggle' => 'modal',
'data-target' => '#modalAdministrerEntite'
],
'icon' => 'fas fa-wrench',
],
'Gestion' => [
__d('default', 'default.sousTitreSuperAdministrateur') => [
'icon' => 'fas fa-user',
'url' => [
'controller' => 'admins',
'action' => 'index'
]
],
__d('default', 'default.sousTitreGestionTousUtilisateurs') => [
'icon' => 'fas fa-users',
'url' => [
'controller' => 'users',
'action' => 'admin_index'
]
],
__d('default', 'default.sousTitreGestionTousSousTraitants') => [
'icon' => 'fas fa-list-alt',
'url' => [
'controller' => 'soustraitants',
'action' => 'index'
]
],
__d('default', 'default.sousTitreGestionTousResponsable') => [
'icon' => 'fa-list-alt',
'url' => [
'controller' => 'responsables',
'action' => 'index'
]
],
__d('default', 'default.sousTitreGestionTypagesAnnexes') => [
'icon' => 'fa-list-alt',
'url' => [
'controller' => 'typages',
'action' => 'index'
]
],
__d('default', 'default.sousTitreGestionPolitiqueConfidentialite') => [
'icon' => 'fas fa-user-secret',
'url' => [
'controller' => 'organisations',
'action' => 'gestionrgpd'
]
],
'icon' => 'fas fa-users'
],
__d('default', 'default.sousTitrePageConnexion') => [
'icon' => 'fas fa-sliders-h',
'url' => [
'controller' => 'admins',
'action' => 'changeviewlogin'
],
'class' => 'nav-link'
]
];
$menu = $this->WebdpoMenu->main($items);
?>
<nav class="navbar fixed-top second-nav navbar-expand-md navbar-custom navbar-dark bg-ls-dark">
<div class="collapse navbar-collapse">
<?php
echo $menu;
?>
</div>
</nav>
......@@ -34,8 +34,9 @@ class WebdpoMenuHelper extends AppHelper {
} elseif (!isset($item['disabled']) || !$item['disabled']) {
$sub = $item;
$title = ( isset($sub['title']) ? $sub['title'] : false );
$class = ( isset($sub['class']) ? $sub['class'] : false );
$title = (isset($sub['title']) ? $sub['title'] : false);
$icon = (isset($sub['icon']) ? $sub['icon'] : false);
$class = (isset($sub['class']) ? $sub['class'] : false);
// @todo Faire plus propre, on n'a peut-être pas que les data-* à gérer
$extra = [];
......@@ -45,7 +46,7 @@ class WebdpoMenuHelper extends AppHelper {
unset($sub[$subKey]);
}
}
unset($sub['url'], $sub['disabled'], $sub['title'], $sub['class']);
unset($sub['url'], $sub['disabled'], $sub['title'], $sub['icon'], $sub['class']);
$sub = $this->main($sub, $disabledTag, $level+1);
......@@ -71,14 +72,20 @@ class WebdpoMenuHelper extends AppHelper {
$url += ['plugin' => null];
}
if ($class !== false) {
$contentClass = $class;
} else {
$contentClass = 'dropdown-item';
}
$content .= $this->Html->link(
$this->Html->tag('i', '', ['class' => $class === false ? false : "far {$class} fa-fw"])
$this->Html->tag('i', '', ['class' => $icon === false ? false : "far {$icon} fa-fw"])
. ' ' . $key,
$url,
$extra + ['class' => "dropdown-item",'escape'=>false]
$extra + ['class' => $contentClass, 'escape'=>false]
). $sub;
} else if (!empty($sub)) {
} elseif (!empty($sub)) {
$htmlOptions = [];
if ($disabledTag == 'a') {
......@@ -87,8 +94,8 @@ class WebdpoMenuHelper extends AppHelper {
if ($level === 0) {
$icon = null;
if (!empty($item['class'])) {
$icon = "far {$item['class']} fa-fw";
if (!empty($item['icon'])) {
$icon = "far {$item['icon']} fa-fw";
}
$caret = $this->Html->tag('i', '', ['class' => $icon]);
......
......@@ -83,7 +83,11 @@ $cakeDescription = 'web-DPO';
'cakeDescription' => $cakeDescription
]);
echo $this->element('second_header');
if ($this->Session->read('Su') === false) {
echo $this->element('second_header');
} else {
echo $this->element('second_header_superadmin');
}
?>
<main role="main" class="container-fluid-custom">
......@@ -91,16 +95,16 @@ $cakeDescription = 'web-DPO';
echo $this->Flash->render();
if ($this->Session->read('Su') === true) {
$homeBreadcrumb = 'superadmin';
$homeBreadcrumb = 'checks';
} else {
$homeBreadcrumb = 'index';
$homeBreadcrumb = 'pannel';
}
echo $this->Html->getCrumbs(' / ', [
'text' => 'Accueil',
'url' => [
'controller' => 'pannel',
'action' => $homeBreadcrumb
'controller' => $homeBreadcrumb,
'action' => 'index'
],
'escape' => false
]);
......
......@@ -4,7 +4,10 @@ use Libriciel\Utility\Password\PasswordStrengthMeterAnssi;
echo $this->Html->script('users.js');
echo $this->Html->css('password-force.css');
$this->Breadcrumbs->firstBreadcrumb($title);
$breadcrumbs = [
$title => []
];
$this->Breadcrumbs->breadcrumbs($breadcrumbs, true);
if (isset($this->validationErrors['User']) && !empty($this->validationErrors['User'])) {
?>
......
......@@ -4,12 +4,16 @@ echo $this->Html->script('users.js');
echo $this->Html->script('filtre.js');
echo $this->Html->css('filtre.css');
$actionAdminIndex = 'admin_index' === $this->request->params['action'];
$breadcrumbs = [
$title => []
];
$this->Breadcrumbs->breadcrumbs($breadcrumbs, true);
$actionAdminIndex = 'admin_index' === $this->request->params['action'];
if ($actionAdminIndex === false) {
$this->Breadcrumbs->breadcrumbs($breadcrumbs, true);
} else {
$this->Breadcrumbs->breadcrumbs($breadcrumbs);
}
$pagination = null;
......
......@@ -29,43 +29,23 @@ body {
z-index: 2;
}
.dropdown-header {
color: white !important;
}
.dropdown-item {
background-color: var(--ls-primary-600) !important;
.dropdown-header,
.card-link {
color: white !important;
}
.dropdown-item > a:hover {
background-color: var(--ls-primary-700) !important;
}
.dropdown-menu {
.dropdown-item,
.dropdown-menu,
.card-header{
background-color: var(--ls-primary-600) !important;
color: white !important;
}
.dropdown-menu > a:hover {
background-color: var(--ls-primary-700) !important;
}
.dropdown-menu li > a:hover {
background-color: var(--ls-primary-700) !important;
}
.dropdown-item > a:hover,
.dropdown-menu > a:hover,
.dropdown-menu li > a:hover,
.dropdown-submenu > a:hover {
background-color: var(--ls-primary-700) !important;
}
.card-header {
background-color: var(--ls-primary-600) !important;
color: white !important;
}
.card-link {
color: white !important;
background-color: var(--ls-primary-500) !important;
}
.card {
......@@ -114,3 +94,24 @@ table {
#container {
margin-bottom: 100px !important;
}
.btn-default-primary-card {
background-color: #ffffff;
border-color: var(--ls-primary-700) !important;
color: var(--ls-primary-700) !important;
}
.btn-default-primary,
.btn-default-primary:hover,
.btn-default-primary:focus,
.btn-default-primary.focus,
.btn-default-primary:active,
.btn-default-primary.active {
border-color: var(--ls-primary-700) !important;
color: var(--ls-primary-700) !important;
}
.open > .dropdown-toggle.btn-default-primary {
border-color: var(--ls-primary-700) !important;
color: var(--ls-primary-700) !important;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment