From c2412b504c7bab5ff387faf7861b642668b13a86 Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 15 Nov 2019 11:17:25 +0100 Subject: [PATCH] prise en compte de la couleur des groupes (ref #38) --- .../src/Cadoles/CoreBundle/Command/data/core-init-01.sql | 2 +- .../src/Cadoles/CoreBundle/Resources/public/css/style.css | 4 ++++ .../PortalBundle/Controller/PagewidgetController.php | 6 ++++-- .../Resources/views/Pagewidget/viewgroup.html.twig | 3 ++- .../Resources/views/Pagewidget/viewgroupmessage.html.twig | 3 ++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql index 87ac2230..a1d6109e 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Command/data/core-init-01.sql @@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES (-100, 'DRAAF', '130007107'); INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES -(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}kqZ/9F8nhk0LurMspUojmlG3x0R/xd93 +(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}YAgr/O4uRUcWbNTTnUPNUYGt9TyvjbjJ ', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple'); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css index 3c4373bc..335c07cc 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/public/css/style.css @@ -232,6 +232,10 @@ span.item-drag { display: block; } +.grid-item .grid-item-content { + height: 100%; +} + .grid-item .grid-item-content:hover { opacity: 0.8; } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index 087e2b22..b2f4f876 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -1980,11 +1980,12 @@ class PagewidgetController extends Controller $title=$groupshared->getLabel(); $idpage=$groupshared->pagesshared[0]->getId(); + $color=$groupshared->getColor(); $icon=null; if($groupshared->getIcon()) $icon="/".$groupshared->getIcon()->getLabel(); - array_push($mygroups,["title"=>$title,"icon"=>$icon,"id"=>$idpage]); + array_push($mygroups,["title"=>$title,"icon"=>$icon,"id"=>$idpage,"color"=>$color]); } } @@ -2041,6 +2042,7 @@ class PagewidgetController extends Controller // On récupère les info du groupe $title=$groupshared->getLabel(); $idpage=$groupshared->pagesshared[0]->getId(); + $color=$groupshared->getColor(); // On récupère l'ensemble des messages du groupes $messages=$this->getDoctrine()->getRepository("CadolesWebsocketBundle:Message")->findBy(["group"=>$groupshared]); @@ -2055,7 +2057,7 @@ class PagewidgetController extends Controller } foreach($messages as $key => $message) { - $tmp=["id" => $message->getId(), "user" => $message->getUser(), "date"=>$message->getSubmitdate(), "topic"=>$message->getTopic(), "pageid" => $idpage, "pagetitle" => $title]; + $tmp=["id" => $message->getId(), "user" => $message->getUser(), "date"=>$message->getSubmitdate(), "topic"=>$message->getTopic(), "pageid" => $idpage, "pagetitle" => $title, "color" => $color]; array_push($mymsg,$tmp); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig index 9cecdf02..b42ca8cf 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/viewgroup.html.twig @@ -5,6 +5,7 @@ {% import "@CadolesPortal/Pagewidget/constants.twig" as constants %} +{% set colormain = constants.mycolormain() %} {% set stylewidget = constants.mystylewidget(entity) %} {% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} {% set stylewidgetheader = constants.mystylewidgetheader(entity) %} @@ -52,7 +53,7 @@ {% for group in groups %}
-
+