This commit is contained in:
Arnaud Fornerot 2022-03-20 21:13:59 +01:00
parent d8db726fc4
commit d00a4e5a12
33 changed files with 976 additions and 642 deletions

View File

@ -4,6 +4,8 @@ oneup_uploader:
frontend: dropzone
logo:
frontend: dropzone
header:
frontend: dropzone
document:
frontend: dropzone
namer: app.upload.samename

View File

@ -94,28 +94,28 @@ oneup_uploader:
type: uploader
#== Cron =================================================================================================================
app_cron:
path: /admin/cron
app_cron_job:
path: /config/cron
defaults: { _controller: App\Controller\CronController:list }
app_cron_ajax_list:
path: /admin/cron/ajax/list
path: /config/cron/ajax/list
defaults: { _controller: App\Controller\CronController:ajaxlist }
app_cron_update:
path: /admin/cron/update/{id}
path: /config/cron/update/{id}
defaults: { _controller: App\Controller\CronController:update }
app_cron_exec:
path: /admin/cron/exec/{id}
path: /config/cron/exec/{id}
defaults: { _controller: App\Controller\CronController:exec }
app_cron_log:
path: /admin/cron/log
path: /config/cron/log
defaults: { _controller: App\Controller\CronController:log }
app_cron_getlog:
path: /admin/cron/getlog/{id}
path: /config/cron/getlog/{id}
defaults: { _controller: App\Controller\CronController:getlog }
#== User ========================================================================================================
@ -147,6 +147,10 @@ app_user_profil:
path: /user/profil
defaults: { _controller: App\Controller\UserController:profil }
app_user_preference:
path: /user/preference
defaults: { _controller: App\Controller\UserController:preference }
#== Group ========================================================================================================
app_group:
path: /admin/group

View File

@ -71,6 +71,7 @@ services:
$ldapUser: '%ldapUser%'
$ldapPassword: '%ldapPassword%'
$ldapBasedn: '%ldapBasedn%'
$wssport: '%wssport%'
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
@ -89,7 +90,7 @@ services:
app.session.init:
public: true
class: App\Service\sessionInit
arguments: ["@service_container","@doctrine.orm.entity_manager","@session",]
arguments: ["@service_container","@doctrine.orm.entity_manager","@session","@security.token_storage"]
tags:
- { name: kernel.event_listener, event: kernel.request, method: onDomainParse }
@ -130,3 +131,7 @@ services:
tags:
- { name: twig.extension }
app.websocket.service:
public: true
class: App\Service\messageService
arguments: ['%wssport%']

View File

@ -1,23 +1,38 @@
h1{
padding: 40px 0px 9px 0px;
border-bottom: 1px solid #eee;
.headertitle a{
text-transform: uppercase;
}
.headertitle small {
font-size:60%;
}
#switchHeader{
cursor:pointer;
}
.navbar {
height:60px;
}
.nav a {
background: none;
color: #CFD8DC;
font-size: 14px;
padding: 5px 0px 5px 25px;
display: block;
padding-left: 15px;
}
.page-maxed {
max-width:1200px;
margin:auto !important;
}
/* Sidebar Styles */
.avatar {
background-color: #343a40;
width: 35px;
height: 35px;
border-radius: 100%;
margin-top: -2px;
}
.avatar.big{
width: 90px;
height: 90px;
margin-bottom: 10px;
}
.contentsidebar {
margin-left:250px;
}
@ -32,439 +47,59 @@ h1{
background: #37474F;
}
#sidebar header {
background-color: #263238;
font-size: 20px;
line-height: 52px;
text-align: center;
#sidebar .nav-link.active, .nav-link:hover {
background-color:var(--colorbgbodydark-darker);
}
#sidebar header a {
color: #fff;
#sidebar .nav-link {
padding:5px 0px 5px 10px;
}
#sidebar .nav-first-level {
zoom:120%
}
#sidebar .nav-second-level .nav-link {
padding:5px 0px 5px 25px;
display: block;
text-decoration: none;
}
#sidebar header a:hover {
color: #fff;
}
#sidebar .nav{
display: block;
margin: 0px 10px;
}
#sidebar .nav a {
padding: 0px 10px 5px 10px;
}
#sidebar .nav .last{
border-bottom: 1px solid #455A64;
padding-bottom:5px;
margin-bottom: 10px;
}
#sidebar .title {
color: #CFD8DC;
font-size: 16px;
padding: 0px 10px 0px 10px;
display: block;
text-transform: uppercase;
margin-left: 0px !important;
font-weight: bold;
}
#sidebar .nav .last{
border-bottom: 1px solid #fff;
padding-bottom: 5px;
}
#sidebar .nav a:hover{
background: none;
color: #ECEFF1;
}
#sidebar .nav a i{
margin-right: 5px;
width: 20px;
text-align: center;
}
#sidebar .nav .select-control {
padding: 0px 10px 5px 10px;
margin-top: -12px;
}
.avatar {
background-color: #343a40;
width: 35px;
height: 35px;
border-radius: 100%;
margin-top: -5px;
}
.avatar.big{
width: 90px;
height: 90px;
margin-bottom: 10px;
width:100%;
}
@media (max-width: 991px) {
#headercontainer{
display:none !important;
}
#switchHeader{
display:none !important;
}
.contentsidebar {
margin-left: auto;
}
.navbar-toggler {
display: inline-block !important;
}
#sidebar {
position: static;
margin:0px -15px;
width: auto;
}
#sidebar .nav-second-level .nav-link {
width: auto;
}
a.btn {
color:#ffffff;
}
.btn-link {
padding:0px;
}
.media-body p {
font-size :12px;
margin-bottom:0px;
}
@media (min-width: 992px) {
#sidebar {
display: block;
}
}
{% if useheader is defined and useheader %}
#main {
padding-top:55px;
}
{% endif %}
th.dt-center, td.dt-center { text-align: center; }
/* heros */
.heroheader {
width:100%;
height:800px;
position:relative;
}
.heroheader div{
width:100%;
height:100%;
background-size: cover;
background-position: center;
color:#fff;
text-align: center;
}
/* Dots */
.slick-dotted.slick-slider
{
margin-bottom: 30px;
}
.slick-dots
{
position: absolute;
bottom: -105px;
display: block;
width: 100%;
padding: 0;
margin: 0;
list-style: none;
text-align: center;
}
.slick-dots li
{
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button
{
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus
{
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before
{
opacity: 1;
}
.slick-dots li button:before
{
font-family: 'slick';
font-size: 6px;
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
content: '•';
text-align: center;
opacity: .25;
color: black;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-dots li.slick-active button:before
{
opacity: .75;
color: black;
}
.slick-dotted.slick-slider{margin-bottom:0px;}
.slick-dots {
position: absolute;
top: 135px;
left:46px;
text-align:left;
z-index: 9100;
bottom:unset;
width:auto;
}
.heroheader-dot { color:#fff; }
.herobox {
position:absolute;
float: left;
top: 0;
bottom: 0;
left: -200px;
z-index: 8000;
padding: 0;
text-align: center;
text-shadow: none;
background-color: rgba(0,0,0,0.7);
height: auto;
width: 45%;
box-shadow: 0px -1px 2px rgba(0,0,0,0.5);
margin: 0 auto;
//opacity: 0.9;
transform-origin: 50% 50%;
transform: skew(-20deg);
-webkit-transform: skew(-20deg);
-moz-transform: skew(-20deg);
-o-transform: skew(-20deg);
-ms-transform: skew(-20deg);
border-left: 1px solid #fff;
border-right: 1px solid #fff;
}
.herotitle {
text-align: left;
position:absolute;
//width:100%;
top: 80px;
left:50px;
z-index: 9000;
}
.herotitle h1 {
padding:0px;
border:none;
}
.heromenu {
padding-top: 30px;
font-size: 20px;
}
.herofloatmenu .avatar {
width: 20px;
height: 20px;
margin: 3px 3px 0px 0px;
}
.herofloatmenu a:hover {
text-decoration: none;
}
.heromenu .linkmenu {
font-size:16px;
padding-left: 5px;
}
.heromenu .linkmenu a {
margin-right:5px;
}
.herologo {
position: absolute;
top: 0px;
text-align: center;
width: 100%;
}
.herologo img {max-height:200px;}
@media (max-width: 980px) {
.herobox { display: none; }
.herotitle { width:100%; top: 70px; left:0px; text-align:center; }
.slick-dots { top: 120px; left: 0px; text-align: center; width: 100%; }
.heromenu .facatmenu {display: none;}
.catmenu { display:none }
.linkmenu { display:none }
.herofloatmenu a {
font-size: 40px;
}
.herofloatmenu .avatar {
height: 40px;
width:40px;
margin-top:15px;
}
}
.grid-sizer { width: 10%; margin-bottom: 0%;float:left;}
.grid-item-size { width: 10%; margin-bottom: 0%;float:left;}
.grid-item-size-2 { width: 20%; margin-bottom: 0%;float:left;}
.grid-item-size-3 { width: 30%; margin-bottom: 0%;float:left;}
.grid-item-size-4 { width: 40%; margin-bottom: 0%;float:left;}
.grid-item-size-5 { width: 40%; margin-bottom: 0%;float:left;}
.grid-item-size-6 { width: 60%; margin-bottom: 0%;float:left;}
.grid-item-size-7 { width: 70%; margin-bottom: 0%;float:left;}
.grid-item-size-8 { width: 80%; margin-bottom: 0%;float:left;}
.grid-item-size-9 { width: 90%; margin-bottom: 0%;float:left;}
.grid-item-full { width: 100%; margin-bottom: 0%; font-size:20px;float:left; }
.grid-item-full h1 {margin: 0; border:none; padding: 20px 0px 0px 10px; }
.gutter-sizer { width: 0%;float:left; }
@media (max-width: 980px) {
.grid-sizer { width: 50%; margin-bottom: 0%;}
.grid-item-size { width: 50%; margin-bottom: 0%;}
}
.foliomenu {
position: fixed;
width:100%;
height:60px;
background-color: var(--colorbgbodydark) ;
z-index: 100000;
display:none;
padding-left:10px;
border-bottom: 1px solid var(--colorftbodydark);
}
.foliomenu .logo { float:left; height:40px; margin-top:7px }
.foliomenu .avatar { height: 20px; margin: 3px 3px 0px 0px; width: 20px; }
.foliomenu div { padding: 10px; line-height:35px; float:left;}
.foliomenu a {
color: var(--colorftbodydark);
font-size: 15px;
}
.foliomenu .float-right a:hover {
text-decoration: none;
}
.foliomenu .fa { font-size: 14px; color: var(--colorftbodydark);}
.foliotop {
float:right;
position:fixed;
bottom: 10px;
right:10px;
z-index: 100000;
background-color: var(--colorbgbodydark) ;
padding:10px;
border-radius: 100%;
width:55px;
height:55px;
text-align: center;
line-height: 28px;
border: 1px solid var(--colorbgbodylight);
display:none;
}
.foliotop a {
color: var(--colorftbodydark);
font-size: 25px;
}
@media (max-width: 980px) {
.herofloatmenu {
display:none;
}
.foliomenu {
display: block!important;
}
.foliomenu a {
font-size:30px;
}
.foliomenu .float-right a {
margin-top: -8px;
}
.foliomenu .float-right img {
height:35px;
width:35px;
margin-top:0px;
}
.foliomenu .float-right .fa {
font-size:30px!important;
}
}
.linkurl a {
background-color: var(--colorbgbodylight) ;
color: var(--colorftbodylight)!important;
font-size: 14px;
padding: 5px;
display: inline-block;
margin: 0px 10px 10px 0px;
}
.contactdescription {
max-width:300px;
text-align:justify;
.page-header {
padding-top:20px;
text-transform: uppercase;
border-bottom: 3px solid var(--colorfttitlelight);
padding-bottom: 5px;
}

View File

@ -1,6 +1,9 @@
:root{
--colorbgbodydark: #3a539b;
--colorfttitlelight: #3a539b;
--colorbgbodydark-darker: #082169;
--colorfttitlelight-darker: #082169;
--colorbgbodydark-rgb: 58,83,155;
/* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut
--colorbgbodylight: #;
@ -18,7 +21,8 @@
--colorbgbodylight-darker: #;
--colorfttitlelight-darker: #;
}
--colorbgbodydark-darker: #;
--colorbgbodydark-rgb: R,V,G
*/
}

View File

@ -2,6 +2,9 @@
--colorbgbodydark: #2e3131;
--colorfttitlelight: #2e3131;
--colorfttitlelight-darker: #95a5a6;
--colorbgbodydark-darker: #000000;
--colorfttitlelight-darker: #000000;
--colorbgbodydark-rgb: 46,49,49;
/* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut
--colorbgbodylight: #;
@ -19,7 +22,8 @@
--colorbgbodylight-darker: #;
--colorfttitlelight-darker: #;
}
--colorbgbodydark-darker: #;
--colorbgbodydark-rgb: R,V,G
*/
}

View File

@ -1,6 +1,9 @@
:root{
--colorbgbodydark: #6c7a89;
--colorfttitlelight: #6c7a89;
--colorbgbodydark-darker: #3a4857;
--colorfttitlelight-darker: #3a4857;
--colorbgbodydark-rgb: 108,122,137;
/* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut
--colorbgbodylight: #;
@ -18,7 +21,8 @@
--colorbgbodylight-darker: #;
--colorfttitlelight-darker: #;
}
--colorbgbodydark-darker: #;
--colorbgbodydark-rgb: R,V,G
*/
}

View File

@ -1,6 +1,9 @@
:root{
--colorbgbodydark: #1e824c;
--colorfttitlelight: #1e824c;
--colorbgbodydark: #1e824c;
--colorbgbodydark-darker: #00501a;
--colorfttitlelight-darker: #00501a;
--colorbgbodydark-rgb: 30,130,76;
/* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut
--colorbgbodylight: #;
@ -18,7 +21,8 @@
--colorbgbodylight-darker: #;
--colorfttitlelight-darker: #;
}
--colorbgbodydark-darker: #;
--colorbgbodydark-rgb: R,V,G
*/
}
@ -37,7 +41,3 @@

View File

@ -1,6 +1,9 @@
:root{
--colorbgbodydark: #f15a22;
--colorfttitlelight: #f15a22;
--colorbgbodydark-darker: #bf2800;
--colorfttitlelight-darker: #bf2800;
--colorbgbodydark-rgb: 241,90,34;
/* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut
--colorbgbodylight: #;
@ -18,7 +21,8 @@
--colorbgbodylight-darker: #;
--colorfttitlelight-darker: #;
}
--colorbgbodydark-darker: #;
--colorbgbodydark-rgb: R,V,G
*/
}

View File

@ -1,6 +1,9 @@
:root{
--colorbgbodydark: #96281b;
--colorfttitlelight: #96281b;
--colorbgbodydark-darker: #640000;
--colorfttitlelight-darker: #640000;
--colorbgbodydark-rgb: 150,40,27;
/* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut
--colorbgbodylight: #;
@ -18,7 +21,8 @@
--colorbgbodylight-darker: #;
--colorfttitlelight-darker: #;
}
--colorbgbodydark-darker: #;
--colorbgbodydark-rgb: R,V,G
*/
}

View File

@ -1,6 +1,9 @@
:root{
--colorbgbodydark: #f7ca18;
--colorfttitlelight: #171717;
--colorfttitlelight: #c59800;
--colorbgbodydark-darker: #c59800;
--colorfttitlelight-darker: #584403;
--colorbgbodydark-rgb: 247,202,24;
/* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut
--colorbgbodylight: #;
@ -18,7 +21,8 @@
--colorbgbodylight-darker: #;
--colorfttitlelight-darker: #;
}
--colorbgbodydark-darker: #;
--colorbgbodydark-rgb: R,V,G
*/
}

View File

@ -0,0 +1,13 @@
TRUNCATE TABLE sidebar;
INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`, `appactivate`) VALUES
(1000, NULL, 1000, 'CONFIGURATION', NULL, 'fa fa-cog', 'ROLE_ADMIN,ROLE_MODO', ''),
(1010, 1000, 1010, 'Générale', 'app_config', 'fa fa-table', 'ROLE_ADMIN,ROLE_MODO', ''),
(1020, 1000, 1020, 'Thème', 'app_theme', 'fa fa-paint-brush', 'ROLE_ADMIN,ROLE_MODO', ''),
(1200, NULL, 1200, 'ORGANISATION', NULL, 'fa fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''),
(1240, 1200, 1240, 'Groupes', 'app_group', 'fa fa-users', 'ROLE_ADMIN,ROLE_MODO', ''),
(1260, 1200, 1260, 'Utilisateurs', 'app_user', 'fa fa-child', 'ROLE_ADMIN,ROLE_MODO', ''),
(7000, NULL, 7000, 'CRON', NULL, 'fa fa-bolt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'),
(7010, 7000, 7010, 'Jobs', 'app_cron_job', 'fa fa-bullseye', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'),
(7020, 7000, 7020, 'Logs / Dump', 'app_cron_log', 'fa fa-list-alt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate');

View File

@ -3,12 +3,11 @@
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Finder\Finder;
use Ramsey\Uuid\Uuid;
use Doctrine\ORM\Mapping\ClassMetadata;
@ -60,6 +59,17 @@ class AppInitCommand extends Command
$this->insertUser("admin","admin");
// Init Sidebar
$finder = new Finder();
$finder->in('scripts');
$finder->name('sidebar.sql');
foreach( $finder as $file ){
$content = $file->getContents();
$stmt = $this->em->getConnection()->prepare($content);
$stmt->execute();
}
$stmt->closeCursor();
// colorbgbody = Couleur des fonds de page
$this->insertConfig(
1, // order
@ -67,7 +77,7 @@ class AppInitCommand extends Command
"appname", // id
"Titre de votre site", // title
"", // value
"", // defalut
$this->appname, // default
"string", // type,
true, // visible
true, // changeable
@ -82,7 +92,7 @@ class AppInitCommand extends Command
"appsubname", // id
"Sous-titre de votre site", // title
"", // value
"", // defalut
"", // default
"string", // type,
true, // visible
true, // changeable
@ -97,7 +107,7 @@ class AppInitCommand extends Command
"appdescription", // id
"Description de votre site", // title
"", // value
"", // defalut
"", // default
"editor", // type,
true, // visible
true, // changeable
@ -112,7 +122,7 @@ class AppInitCommand extends Command
"apptheme", // id
"Thème de votre site", // title
"", // value
"", // defalut
"", // default
"string", // type,
false, // visible
true, // changeable
@ -129,7 +139,7 @@ class AppInitCommand extends Command
"colorbgbodydark", // id
"Couleur de fond fonçée", // title
"", // value
"#2574a9", // defalut
"#2574a9", // default
"color", // type,
true, // visible
true, // changeable
@ -144,7 +154,7 @@ class AppInitCommand extends Command
"colorbgbodylight", // id
"Couleur de fond claire", // title
"", // value
"#ffffff", // defalut
"#ffffff", // default
"color", // type,
true, // visible
true, // changeable
@ -160,7 +170,7 @@ class AppInitCommand extends Command
"colorfttitledark", // id
"Couleur des titres sur fond fonçé", // title
"", // value
"#ffffff", // defalut
"#ffffff", // default
"color", // type,
true, // visible
true, // changeable
@ -175,7 +185,7 @@ class AppInitCommand extends Command
"colorfttitlelight", // id
"Couleur des titres sur fond claire", // title
"", // value
"#2574a9", // defalut
"#2574a9", // default
"color", // type,
true, // visible
true, // changeable
@ -191,7 +201,7 @@ class AppInitCommand extends Command
"colorftbodydark", // id
"Couleur de la police sur fond fonçé", // title
"", // value
"#ffffff", // defalut
"#ffffff", // default
"color", // type,
true, // visible
true, // changeable
@ -206,7 +216,7 @@ class AppInitCommand extends Command
"colorftbodylight", // id
"Couleur de la police sur fond claire", // title
"", // value
"#343a40", // defalut
"#343a40", // default
"color", // type,
true, // visible
true, // changeable
@ -222,7 +232,7 @@ class AppInitCommand extends Command
"fonttitle", // id
"Police pour les titres", // title
"", // value
"FredokaOne-Regular", // defalut
"FredokaOne-Regular", // default
"font", // type,
true, // visible
true, // changeable
@ -237,7 +247,7 @@ class AppInitCommand extends Command
"fontbody", // id
"Police principale", // title
"", // value
"Roboto-Regular", // defalut
"Roboto-Regular", // default
"font", // type,
true, // visible
true, // changeable
@ -252,7 +262,7 @@ class AppInitCommand extends Command
"fontsizeh1", // id
"Taille des titres h1", // title
"", // value
"40", // defalut
"40", // default
"integer", // type,
true, // visible
true, // changeable
@ -267,7 +277,7 @@ class AppInitCommand extends Command
"fontsizeh2", // id
"Taille des titres h2", // title
"", // value
"32", // defalut
"32", // default
"integer", // type,
true, // visible
true, // changeable
@ -282,7 +292,7 @@ class AppInitCommand extends Command
"fontsizeh3", // id
"Taille des titres h3", // title
"", // value
"28", // defalut
"28", // default
"integer", // type,
true, // visible
true, // changeable
@ -297,7 +307,7 @@ class AppInitCommand extends Command
"fontsizeh4", // id
"Taille des titres h4", // title
"", // value
"24", // defalut
"24", // default
"integer", // type,
true, // visible
true, // changeable
@ -313,7 +323,7 @@ class AppInitCommand extends Command
"logodark", // id
"Logo sur fond fonçé", // title
"", // value
"", // defalut
"logo.png", // default
"logo", // type,
true, // visible
true, // changeable
@ -328,7 +338,7 @@ class AppInitCommand extends Command
"logolight", // id
"Logo sur fond clair", // title
"", // value
"", // defalut
"logo.png", // default
"logo", // type,
true, // visible
true, // changeable
@ -337,6 +347,37 @@ class AppInitCommand extends Command
"Logo sur fond clair"
);
// header =
$this->insertConfig(
1, // order
"header", // category
"headerimage", // id
"Image de fond de la bannière", // title
"", // value
"header.png", // default
"header", // type,
true, // visible
true, // changeable
false, // required
"", // grouped
"Image de fond de la bannière"
);
$this->insertConfig(
1, // order
"header", // category
"headerheight", // id
"Hauteur de la bannière", // title
"", // value
"100", // default
"integer", // type,
true, // visible
true, // changeable
false, // required
"", // grouped
"Image de fond de la bannière"
);
$output->writeln('');
return 1;

View File

@ -54,10 +54,10 @@ class CropController extends AbstractController
$ratio="1:1";
break;
case "hero":
case "header":
$max_height=1600;
$max_width=1600;
$ratio="16:9";
$ratio="16:2";
break;
case "image":

View File

@ -174,6 +174,7 @@ class UserController extends AbstractController
'usesidebar' => false,
$this->data => $data,
'mode' => 'profil',
'maxwidth' => true,
'form' => $form->createView()
]);
}
@ -231,6 +232,50 @@ class UserController extends AbstractController
return $response;
}
public function preference(Request $request) {
// S'assurer que c'est un appel ajax
if (!$request->isXmlHttpRequest()) {
return new JsonResponse(array('message' => 'Interdit'), 400);
}
$key=$request->request->get('key');
$id=$request->request->get('id');
$value=$request->request->get('value');
// Récupérer les préférences de l'utilisateur
$preference=$this->getUser()->getPreference();
// Mise à jour de la préférence
$toupdate=false;
if(!is_array($preference)) {
$toupdate=true;
$preference=[];
}
if(!array_key_exists($key,$preference)) {
$toupdate=true;
$preference[$key]=[];
}
if((!array_key_exists($id,$preference[$key]))) {
$toupdate=true;
$preference[$key][$id]=$value;
}
if($preference[$key][$id]!=$value) {
$toupdate=true;
$preference[$key][$id]=$value;
}
// Mise à jour des préferences
if($toupdate) {
$em = $this->getDoctrine()->getManager();
$this->getUser()->setPreference($preference);
$em->persist($this->getUser());
$em->flush();
}
return new Response();
}
protected function getErrorForm($id,$form,$request,$data,$mode) {
if ($form->get('submit')->isClicked()&&$mode=="delete") {
}

View File

@ -86,7 +86,8 @@ class Config
public function getValue(): ?string
{
return $this->value;
if($this->value=="") return $this->default;
else return $this->value;
}
public function setValue(string $value): self

View File

@ -0,0 +1,288 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="sidebar")
* @ORM\HasLifecycleCallbacks()
*
*/
class Sidebar
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="integer")
*/
private $roworder;
/**
* @ORM\Column(type="string", length=250)
*/
private $label;
/**
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $path;
/**
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $fonticon;
/**
* @ORM\Column(type="simple_array", length=250, nullable=true)
*/
private $permission;
/**
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $appactivate;
/**
* @ORM\ManyToOne(targetEntity="Sidebar", inversedBy="childs")
* @ORM\JoinColumn(nullable=true)
*/
private $parent;
/**
* @var ArrayCollection $childs
* @var Child
*
* @ORM\OneToMany(targetEntity="Sidebar", mappedBy="parent", cascade={"persist"}, orphanRemoval=false)
* @ORM\OrderBy({"roworder" = "ASC"})
*/
private $childs;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set roworder
*
* @param integer $roworder
*
* @return Sidebar
*/
public function setRoworder($roworder)
{
$this->roworder = $roworder;
return $this;
}
/**
* Get roworder
*
* @return integer
*/
public function getRoworder()
{
return $this->roworder;
}
/**
* Set label
*
* @param string $label
*
* @return Sidebar
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set path
*
* @param string $path
*
* @return Sidebar
*/
public function setPath($path)
{
$this->path = $path;
return $this;
}
/**
* Get path
*
* @return string
*/
public function getPath()
{
return $this->path;
}
/**
* Set fonticon
*
* @param string $fonticon
*
* @return Sidebar
*/
public function setFonticon($fonticon)
{
$this->fonticon = $fonticon;
return $this;
}
/**
* Get fonticon
*
* @return string
*/
public function getFonticon()
{
return $this->fonticon;
}
/**
* Set permission
*
* @param array $permission
*
* @return Sidebar
*/
public function setPermission($permission)
{
$this->permission = $permission;
return $this;
}
/**
* Get permission
*
* @return array
*/
public function getPermission()
{
return $this->permission;
}
/**
* Set appactivate
*
* @param string $appactivate
*
* @return Sidebar
*/
public function setAppactivate($appactivate)
{
$this->appactivate = $appactivate;
return $this;
}
/**
* Get appactivate
*
* @return string
*/
public function getAppactivate()
{
return $this->appactivate;
}
/**
* Set parent
*
* @param Sidebar $parent
*
* @return Sidebar
*/
public function setParent(Sidebar $parent = null)
{
$this->parent = $parent;
return $this;
}
/**
* Get parent
*
* @return Sidebar
*/
public function getParent()
{
return $this->parent;
}
/**
* Constructor
*/
public function __construct()
{
$this->childs = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add child
*
* @param Sidebar $child
*
* @return Sidebar
*/
public function addChild(Sidebar $child)
{
$this->childs[] = $child;
return $this;
}
/**
* Remove child
*
* @param Sidebar $child
*/
public function removeChild(Sidebar $child)
{
$this->childs->removeElement($child);
}
/**
* Get childs
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getChilds()
{
return $this->childs;
}
}

View File

@ -80,6 +80,10 @@ class User implements UserInterface, \Serializable
*/
private $apikey;
/**
* @ORM\Column(name="preference", type="array", nullable=true)
*/
private $preference;
/**
* @ORM\ManyToMany(targetEntity="Group", inversedBy="users", cascade={"persist"})
@ -286,4 +290,16 @@ class User implements UserInterface, \Serializable
return $this;
}
public function getPreference(): ?array
{
return $this->preference;
}
public function setPreference(?array $preference): self
{
$this->preference = $preference;
return $this;
}
}

View File

@ -126,7 +126,7 @@ class ConfigType extends AbstractType
$builder->add('value',HiddenType::class);
break;
case "hero":
case "header":
$builder->add('value',HiddenType::class);
break;

View File

@ -0,0 +1,25 @@
<?php
namespace App\Service;
class messageService {
private $wssport;
public function __construct($wssport)
{
$this->wssport = $wssport;
}
public function addMessage($userkey,$groupid,$message){
\Ratchet\Client\connect('ws://localhost:'.$this->wssport)->then(function($conn) use ($userkey,$groupid,$message) {
$msg = ['command' => 'pushsubscribe', 'log'=>'','channel' => 'message-'.$groupid, 'channeltype' => 'message', 'channelkey' => $groupid, 'userkey' => $userkey,"subdata"=>["command"=>"message","message"=>$message]];
$msg = json_encode($msg);
$conn->send($msg);
$conn->close();
}, function ($e) {
die("Could not connect: {$e->getMessage()}");
});
}
}

View File

@ -5,95 +5,114 @@
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpFoundation\Session\Session;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class sessionInit {
private $container;
protected $em;
protected $session;
protected $token;
public function __construct(ContainerInterface $container, EntityManager $em,Session $session)
public function __construct(ContainerInterface $container, EntityManager $em,Session $session, TokenStorageInterface $token)
{
$this->container = $container;
$this->session = $session;
$this->em = $em;
$this->token = $token;
}
public function onDomainParse(RequestEvent $event) {
// Config
$configs = $this->em->getRepository("App:Config")->findAll();
foreach($configs as $config) {
$this->session->set($config->getId(), strval($config->getValue()));
}
$this->session->set("headerimage","uploads/header/".$this->session->get("headerimage"));
// Valeur par défaut appname
if($this->session->get("appname")=="")
$this->session->set("appname", $this->container->getParameter('appName'));
// Current user
$token = $this->token->getToken();
if(!$token) return;
$curentuser=$token->getUser();
// Valeur par defaut colorbgbodydark = #343a40
if($this->session->get("colorbgbodydark")=="")
$this->session->set("colorbgbodydark", $this->em->getRepository("App:Config")->find("colorbgbodydark")->getDefault());
// Roles actif
if($curentuser=="anon.") $roles=[];
else $roles=$curentuser->getRoles();
// Valeur par defaut colorbgbodydark = #ffffff
if($this->session->get("colorbgbodylight")=="")
$this->session->set("colorbgbodylight",$this->em->getRepository("App:Config")->find("colorbgbodylight")->getDefault());
// Sidebar
$sidebar=array();
$request = $event->getRequest();
$route = $request->attributes->get('_route');
$nvs1 = $this->em->getRepository("App:Sidebar")->findBy(array('parent'=> NULL), array('roworder' => 'ASC'));
foreach($nvs1 as $nv1) {
if($this->haveRole($curentuser,$roles,$nv1->getPermission(),$nv1->getPath())) {
$sidebar[$nv1->getRoworder()] = array(
"fonticon" => $nv1->getFonticon(),
"label" => $nv1->getLabel(),
"path" => $nv1->getPath(),
);
// Valeur par defaut colorfttitledark = #ffffff
if($this->session->get("colorfttitledark")=="")
$this->session->set("colorfttitledark", $this->em->getRepository("App:Config")->find("colorfttitledark")->getDefault());
foreach($nv1->getChilds() as $nv2) {
// Valeur par defaut colorfttitlelight = #343a40
if($this->session->get("colorfttitlelight")=="")
$this->session->set("colorfttitlelight", $this->em->getRepository("App:Config")->find("colorfttitlelight")->getDefault());
if($this->haveRole($curentuser,$roles,$nv2->getPermission(),$nv2->getPath())) {
$sidebar[$nv1->getRoworder()]["childs"][$nv2->getRoworder()] = array (
"fonticon" => $nv2->getFonticon(),
"label" => $nv2->getLabel(),
"path" => $nv2->getPath(),
"active" => (stripos($route,$nv2->getPath())!==false)
);
// Valeur par defaut colorftbodydark = #ffffff
if($this->session->get("colorftbodydark")=="")
$this->session->set("colorftbodydark", $this->em->getRepository("App:Config")->find("colorftbodydark")->getDefault());
// Valeur par defaut colorftbodylight = #343a40
if($this->session->get("colorftbodylight")=="")
$this->session->set("colorftbodylight", $this->em->getRepository("App:Config")->find("colorftbodylight")->getDefault());
// Valeur par defaut fonttitle = FredokaOne-Regular
if($this->session->get("fonttitle")=="")
$this->session->set("fonttitle", $this->em->getRepository("App:Config")->find("fonttitle")->getDefault());
// Valeur par defaut fontbody = Roboto-Regular
if($this->session->get("fontbody")=="")
$this->session->set("fontbody", $this->em->getRepository("App:Config")->find("fontbody")->getDefault());
// Valeur par defaut fontsizeh1 = 40
if($this->session->get("fontsizeh1")=="")
$this->session->set("fontsizeh1", $this->em->getRepository("App:Config")->find("fontsizeh1")->getDefault());
// Valeur par defaut fontsizeh2 = 32
if($this->session->get("fontsizeh2")=="")
$this->session->set("fontsizeh2", $this->em->getRepository("App:Config")->find("fontsizeh2")->getDefault());
// Valeur par defaut fontsizeh3 = 28
if($this->session->get("fontsizeh3")=="")
$this->session->set("fontsizeh3", $this->em->getRepository("App:Config")->find("fontsizeh3")->getDefault());
// Valeur par defaut fontsizeh4 = 24
if($this->session->get("fontsizeh4")=="")
$this->session->set("fontsizeh4", $this->em->getRepository("App:Config")->find("fontsizeh4")->getDefault());
// Valeur par defaut logo
if($this->session->get("logodark")==""&&$this->session->get("logolight")=="") {
$this->session->set("logodark", "logo.png");
$this->session->set("logolight", "logo.png");
}
elseif($this->session->get("logodark")=="")
$this->session->set("logodark", $this->session->get("logolight"));
elseif($this->session->get("logolight")=="")
$this->session->set("logolight", $this->session->get("logodark"));
}
}
}
$this->session->set('sidebar', $sidebar);
// Préférence
$this->session->set("fgheader", true);
if($curentuser!="anon.") {
$preference=$curentuser->getPreference();
if(is_array($preference)) {
// Préférence header
if(array_key_exists("fgheader",$preference)) {
$fgheader=($preference["fgheader"][0]=="true");
$this->session->set("fgheader", $fgheader);
}
}
}
// Calcul couleur
$this->session->set("colorbgbodylight-darker", $this->adjustBrightness($this->session->get("colorbgbodylight"),-10));
$this->session->set("colorbgbodydark-darker", $this->adjustBrightness($this->session->get("colorbgbodydark"),-50));
$this->session->set("colorfttitlelight-darker", $this->adjustBrightness($this->session->get("colorfttitlelight"),-50));
$this->session->set("colorbgbodydark-darker", $this->adjustBrightness($this->session->get("colorbgbodydark"),-50));
$this->session->set("colorbgbodydark-lighter", $this->adjustBrightness($this->session->get("colorbgbodydark"),+50));
$this->session->set("colorbgbodydark-rgb", $this->hexToRgb($this->session->get("colorbgbodydark")));
$this->session->set("colorbgbodydark-darkrgb", $this->hexToRgb($this->session->get("colorbgbodydark-darker")));
$this->session->set("colorbgbodydark-lightrgb", $this->hexToRgb($this->session->get("colorbgbodydark-lighter")));
}
public function haveRole($curentuser,$roles,$tohave,$route) {
$haverole=false;
if($roles=="") {
if(empty($tohave)) $haverole=true;
}
else {
foreach($roles as $role) {
if(in_array($role,$tohave))
$haverole=true;
}
}
if($route!=null) {
if($haverole&&in_array("ROLE_MODO",$roles)) {
$permmodo=$this->em->getRepository("App:PermModo")->findOneBy(["route"=>$route,"visible"=>true,"permmodoprofil"=>$curentuser->getPermmodoprofil()]);
if(!$permmodo) $haverole=false;
}
}
return $haverole;
}
private function adjustBrightness($hex, $steps) {
// Steps should be between -255 and 255. Negative = darker, positive = lighter
$steps = max(-255, min(255, $steps));
@ -116,4 +135,14 @@
return '#'.$return;
}
public function hexToRgb($hex) {
$hex = str_replace('#', '', $hex);
$length = strlen($hex);
$rgb['r'] = hexdec($length == 6 ? substr($hex, 0, 2) : ($length == 3 ? str_repeat(substr($hex, 0, 1), 2) : 0));
$rgb['g'] = hexdec($length == 6 ? substr($hex, 2, 2) : ($length == 3 ? str_repeat(substr($hex, 1, 1), 2) : 0));
$rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0));
return $rgb['r'].",".$rgb['g'].",".$rgb['b'];
}
}

View File

@ -8,9 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Doctrine\ORM\EntityManagerInterface;
use SplObjectStorage;
use App\Entity\Scrum;
use App\Entity\Scrumcolumn;
use App\Entity\Scrumwidget;
use App\Entity\Message;
class MessageHandler implements MessageComponentInterface
{
@ -35,6 +33,7 @@ class MessageHandler implements MessageComponentInterface
$this->channelkeys = [];
$this->userconns = [];
$this->userkeys = [];
$this->ispush = [];
}
public function onOpen(ConnectionInterface $conn)
@ -48,8 +47,8 @@ class MessageHandler implements MessageComponentInterface
$data= new \stdClass;
$data->command = "adead";
// Envoyer le message de deconnection
if (isset($this->channels[$conn->resourceId])) {
// Envoyer le message de deconnection que si la connection n'est issu d'un push
if (isset($this->channels[$conn->resourceId])&&!$this->ispush[$conn->resourceId]) {
$this->sendMessage($conn,$data,"other");
}
@ -70,11 +69,54 @@ class MessageHandler implements MessageComponentInterface
$data = json_decode($msg);
switch ($data->command) {
case "subscribe":
case "pushsubscribe":
$this->channels[$conn->resourceId] = $data->channel;
$this->channeltypes[$conn->resourceId] = $data->channeltype;
$this->channelkeys[$conn->resourceId] = $data->channelkey;
$this->userkeys[$conn->resourceId] = $data->userkey;
$this->ispush[$conn->resourceId] = true;
if (isset($this->channels[$conn->resourceId])) {
switch ($this->channeltypes[$conn->resourceId]) {
//case "type": $this->onMessageType($conn,$data); break;
default:
$user=$this->em->getRepository("App:User")->findOneBy(["apikey"=>$data->userkey]);
if(!$user) return false;
$group=$this->em->getRepository("App:Group")->find($data->channelkey);
if(!$group) return false;
$message=new Message();
$message->setTopic($data->subdata->message);
$message->setUser($user);
$message->setGroup($group);
$this->em->persist($message);
$this->em->flush();
$this->sendMessage($conn,$data->subdata);
break;
}
}
break;
case "subscribe":
// Channel privé ?
switch ($data->channeltype) {
case "message":
$user=$this->em->getRepository("App:User")->findOneBy(["apikey"=>$data->userkey]);
if(!$user) return false;
$group=$this->em->getRepository("App:Group")->find($data->channelkey);
if(!$group) return false;
if(!$user->hasRole("ROLE_ADMIN")&&$user->hasRole("ROLE_MODO")) {
$usergroup=$this->em->getRepository("App:UserGroup")->findOneBy(["user"=>$user,"group"=>$data->channelkey]);
if(!$usergroup) return false;
}
break;
}
$this->channels[$conn->resourceId] = $data->channel;
$this->channeltypes[$conn->resourceId] = $data->channeltype;
$this->channelkeys[$conn->resourceId] = $data->channelkey;
$this->userkeys[$conn->resourceId] = $data->userkey;
$this->ispush[$conn->resourceId] = false;
break;
case "meto":
@ -89,10 +131,28 @@ class MessageHandler implements MessageComponentInterface
}
break;
case "message":
if (isset($this->channels[$conn->resourceId])) {
$user=$this->em->getRepository("App:User")->findOneBy(["apikey"=>$this->userkeys[$conn->resourceId]]);
if(!$user) return false;
$group=$this->em->getRepository("App:Group")->find($this->channelkeys[$conn->resourceId]);
if(!$group) return false;
$message=new Message();
$message->setTopic($data->message);
$message->setUser($user);
$message->setGroup($group);
$this->em->persist($message);
$this->em->flush();
$this->sendMessage($conn,$data);
}
break;
default:
if (isset($this->channels[$conn->resourceId])) {
switch ($this->channeltypes[$conn->resourceId]) {
//case "type": $this->onMessageYype($conn,$data); break;
//case "type": $this->onMessageType($conn,$data); break;
default: $this->sendMessage($conn,$data);
}
}
@ -118,11 +178,14 @@ class MessageHandler implements MessageComponentInterface
// Send
if($from && $to) {
$now=new \DateTime();
$data->from= new \stdClass;
$data->from->id = $from->getId();
$data->from->username = $from->getUsername();
$data->from->displayname = $from->getDisplayname();
$data->from->avatar = $this->getAvatar($from->getAvatar());
$data->date = $now->format("d/m/Y H:i");
$data->log="== GET MSG from ".$data->from->username." to ".$to->getUsername()." = ".$data->command;
$this->userconns[$id]->send(json_encode($data));

View File

@ -63,10 +63,10 @@
<img id="config_value_img" src="/{{ appAlias }}/uploads/logo/{{ config.value }}" style="background-color: {{color}}; width:90px;height:90px; margin:auto;display:block;">
<a class="btn btn-info" style="width:90px" onClick="ModalLoad('mymodallarge','Logo','{{ path('app_config_logo') }}');" title='Ajouter un Logo'>Modifier</a>
</div>
{% elseif config.type=="hero" %}
{% elseif config.type=="header" %}
<div style="margin:10px auto;">
<img id="config_value_img" src="/{{ appAlias }}/uploads/hero/{{ config.value }}" style="width:100%;margin:auto;display:block;">
<a class="btn btn-info" style="width:100%" onClick="ModalLoad('mymodallarge','Carrousel','{{ path('app_crop01', {"type": "hero", "reportinput": "#config_value" }) }}');" title='Ajouter une Bannière'>Modifier</a>
<img id="config_value_img" src="/{{ appAlias }}/uploads/header/{{ config.value }}" style="width:100%;margin:auto;display:block;">
<a class="btn btn-info" style="width:100%" onClick="ModalLoad('mymodallarge','Bannière','{{ path('app_crop01', {"type": "header", "reportinput": "#config_value" }) }}');" title='Ajouter une Bannière'>Modifier</a>
</div>
{% elseif config.type=="image" %}
<div style="margin:10px auto;">

View File

@ -36,6 +36,12 @@ CONFIGURATIONS
<h3>Logo</h3>
{{ render(path("app_config_render",{category:"logo"})) }}
</div>
<div class="col-md-12">
<h3>Bannière</h3>
{{ render(path("app_config_render",{category:"header"})) }}
</div>
</div>

View File

@ -70,6 +70,10 @@
{%if not val is empty %}
<img src="/{{appAlias}}/uploads/logo/{{ val }}" height=50px>
{% endif %}
{% elseif config.type=="header" %}
{%if not val is empty %}
<img src="/{{appAlias}}/uploads/header/{{ val }}" width="100%">
{% endif %}
{% else %}
{{ val|raw }}
{% endif %}

View File

@ -111,8 +111,8 @@
{% set nbratio=1 %}
{% elseif ratio=="16:9" %}
{% set nbratio=(16/9) %}
{% elseif nbratio=="16:2" %}
{% set class=(16/2) %}
{% elseif ratio=="16:2" %}
{% set nbratio=(16/2) %}
{% endif %}
$('#largeimg').CropSelectJs('setSelectionAspectRatio',{{nbratio}});

View File

@ -1,37 +1,84 @@
$(document).ready(function() {
{% if app.request.attributes.get('_route')=='app_home' %}
{% if not app.user and app.session.get("fgforceconnect") %}
{% if appAuth=="SQL" %}
window.location="{{url("app_login")}}"
{% elseif appAuth=="CAS" %}
window.location="{{url("app_logincas")}}"
{% endif %}
{% endif %}
{% endif %}
$(document).ready(function() {
$(".pick-a-color").spectrum(
{
type: "text",
showAlpha: false
}
);
$(".pick-a-color").attr("autocomplete","off");
var doit = true;
$("a[data-method]").on('click',function(){
if($(this).data('confirm')){
doit = confirm($(this).data('confirm'));
if(!doit) return false;
}
});
$("button[data-method]").on('click',function(){
if($(this).data('confirm')){
doit = confirm($(this).data('confirm'));
if(!doit) return false;
}
});
Resize();
});
$( window ).resize(function() {
Resize();
});
function Resize() {
if($("#headercontainer").is(":visible")){
//$(".navbar-toggler").hide();
$("#navbar-link").hide();
$("#navbar-logo").hide();
}
else {
//$(".navbar-toggler").show();
$("#navbar-link").show();
$("#navbar-logo").show();
}
$("#sidebar").css("padding-top",$(".header").height());
$("#mycontent").css("padding-top",$(".header").height());
}
function ModalLoad(idmodal,title,path) {
$("#"+idmodal+" .modal-header h4").text(title);
$("#"+idmodal+" iframe").attr("src",path);
$("#"+idmodal).modal("show");
}
function switchHeader() {
{% if app.user %}
$.ajax({
method: "POST",
url: "{{ path('app_user_preference') }}",
data: {
id:0,
key:'fgheader',
value: !($("#headercontainer").is(":visible"))
},
success: function() {
location.reload();
}
});
{% endif %}
}
{% if wssuse %}
function subscribe(channeltype,channelkey,userkey) {
console.log("== SUBSCRIBE "+channeltype+"-"+channelkey+" with userkey "+userkey);

View File

@ -1,49 +1,32 @@
{% set sidebar = app.session.get('sidebar') %}
<div id="sidebar" class="collapse">
<ul class="nav">
{% if is_granted('ROLE_ADMIN') %}
<br>
<li class="title">Configuration</li>
<li>
<a href="{{path("app_config")}}">
<i class="fa fa-cog"></i>Générale
<ul class="nav flex-column">
{% for nav01 in sidebar %}
<li class="nav-item nav-first-level">
<a class="nav-link nav-section" style="cursor:pointer">
<i class="{{ nav01.fonticon }} fa-fw"></i> {{ nav01.label }}
</a>
</li>
<li class="last">
<a href="{{path("app_theme")}}">
<i class="fa fa-paint-brush"></i>Thème
{% if nav01.childs is defined %}
<ul class="nav nav-second-level">
{% for nav02 in nav01.childs %}
<a class="nav-link {%if nav02.active%}active{%endif%}" href="{{ path(nav02.path) }}">
<i class="{{ nav02.fonticon }} fa-fw"></i> {{ nav02.label }}
</a>
</li>
<li class="title">Organisation</li>
<li>
<a href="{{path("app_user")}}">
<i class="fa fa-user"></i>Utilisateurs
</a>
</li>
<li class="last">
<a href="{{path("app_group")}}">
<i class="fa fa-users"></i>Groupes
</a>
</li>
{% if appCron %}
<li class="title">Outils</li>
<li>
<a href="{{path("app_cron")}}">
<i class="fa fa-cogs"></i>Jobs
</a>
</li>
{% endfor %}
</ul>
{% endif %}
<li class="last">
<a href="{{path("app_cron_log")}}">
<i class="fa fa-list-alt"></i>Logs / Dump
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
<script>
$("#sidebar .nav-second-level").hide();
$("#sidebar").find(".active").parent().show();
$("#sidebar .nav-first-level .nav-section").click(function(){
$("#sidebar .nav-second-level").hide();
$(this).parent().children(".nav-second-level").fadeToggle("fast");
});
</script>

View File

@ -15,6 +15,9 @@
--colorbgbodylight-darker: {{ app.session.get('colorbgbodylight-darker')|raw }};
--colorbgbodydark-darker: {{ app.session.get('colorbgbodydark-darker')|raw }};
--colorfttitlelight-darker: {{ app.session.get('colorfttitlelight-darker')|raw }};
--header: url("\{{ appAlias }}\uploads\header\{{ app.session.get('headerimage')|raw }}");
--colorbgbodydark-rgb: {{ app.session.get('colorbgbodydark-rgb')|raw }};
}
/* COLOR BODY */
@ -24,6 +27,18 @@ body {
color: var(--colorftbodylight);
}
body .header {
color: var(--colorfttitledark);
}
body .header a {
color: var(--colorfttitledark);
}
body .header a:hover {
color: var(--colorfttitledark);
text-decoration:none;
}
body .navbar.bg-dark {
background-color: var(--colorbgbodydark)!important;
}
@ -48,6 +63,10 @@ body h1, body h2, body h3, body .modal-header h4 {
color: var(--colorfttitlelight);
}
.btn {
color: var(--colorftbodydark) !important;
}
body a, body .btn-link {
color: var(--colorfttitlelight);
}
@ -105,6 +124,15 @@ body.monocolor {
color: var(--colorftbodydark);
}
body.monocolor .header {
color: var(--colorfttitledark);
text-decoration:none;
}
body.monocolor .header a {
color: var(--colorfttitledark);
}
body.monocolor .navbar.bg-dark {
background-color: var(--colorbgbodydark)!important;
}
@ -162,11 +190,15 @@ body {
font-family: var(--fontbody);
}
h1,h2,h3, .navbar-brand, .card-header, .modal-header h4 {
.headertitle {
line-height:{{app.session.get("fontsizeh1")-10}}px;
}
.headertitle, h1, h2, h3, .navbar-brand, .card-header, .modal-header h4 {
font-family: var(--fonttitle);
}
h1 { font-size: var(--fontsizeh1); }
.headertitle,h1 { font-size: var(--fontsizeh1); }
h2 { font-size: var(--fontsizeh2); }
h3 { font-size: var(--fontsizeh3); }
h4 { font-size: var(--fontsizeh4); }

View File

@ -51,11 +51,73 @@
<body class={{ class }}>
{% if useheader is defined and useheader %}
<nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="{{ path('app_home')}}">
<img src="/{{ appAlias }}/uploads/logo/{{app.session.get("logodark")}}" style="height:30px;margin-top:-3px;">
<div class="header fixed-top">
{% if app.session.get("fgheader") %}
<div id="headercontainer" class="d-flex align-items-center" style="height:{{app.session.get("headerheight")}}px; background-image: linear-gradient(90deg,rgba(var(--colorbgbodydark-rgb),1),rgba(var(--colorbgbodydark-rgb),0.1)),url(/{{appAlias}}/{{app.session.get("headerimage")}});background-size:cover">
<a href="{{ path('app_home')}}">
<img src="/{{ appAlias }}/uploads/logo/{{app.session.get("logodark")}}"style="height:{{app.session.get("headerheight")-20}}px;margin-left:10px;">
</a>
{% if app.session.get("sublogo") %}
<a href="{{ path('app_home')}}">
<img src="/{{ appAlias }}/{{app.session.get("sublogo")}}"style="height:{{app.session.get("headerheight")-20}}px;margin-left:10px;">
</a>
{% endif %}
<div class="headertitle mr-auto" style="padding-left:10px">
<a href="{{ path('app_home')}}">
{{app.session.get("appname")}}
</a>
<br>
<small>{{app.session.get("appsubname")}}</small>
</div>
<div class="pr-3">
<ul class="nav">
{% if app.user %}
<li>
<a href="{{path("app_user_profil")}}">
<img src="{{app.user.avatar|urlavatar}}" class="avatar">
</a>
</li>
{% endif %}
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MODO') %}
<li>
<a href="{{path("app_admin")}}"><i class="fa fa-cog fa-2x"></i></a>
</li>
{% endif %}
{% if app.user %}
<li id="switchHeader">
<a onclick="switchHeader()" title="Cacher / Afficher Bannière"><i class="fa fa-chevron-up fa-2x"></i></a>
<li>
{% if appAuth=="SQL" %}
<li><a href="{{path("app_logout")}}"><i class="fa fa-sign-out-alt fa-2x"></i></a></li>
{% elseif appAuth=="CAS" %}
<li><a href="{{path("app_logoutcas")}}"><i class="fa fa-sign-out-alt fa-2x"></i></a></li>
{% endif %}
{% else %}
{% if appAuth=="SQL" %}
<li><a href="{{path("app_login")}}"><i class="fa fa-sign-in-alt fa-2x"></i></a></li>
{% elseif appAuth=="CAS" %}
<li><a href="{{path("app_logincas")}}"><i class="fa fa-sign-in-alt fa-2x"></i></a></li>
{% endif %}
{% endif %}
</li>
</ul>
{% if app.user %}
<div id="nameuser" style="text-align:right; margin-top:5px"><a href="{{ path('app_user_profil') }}" title="Profil">{{ app.user.firstname }} {{ app.user.lastname }}</a></div>
{% endif %}
</div>
</div>
{% endif %}
<nav class="navbar navbar-expand navbar-dark bg-dark">
<a id="navbar-logo" href="{{ path('app_home')}}" style="display:none;margin-right:10px;">
<img src="/{{ appAlias }}/uploads/logo/{{app.session.get("logodark")}}" style="height:40px;">
</a>
{% if usesidebar is defined and usesidebar %}
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#sidebar" aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
@ -68,11 +130,11 @@
</ul>
</div>
<ul class="nav navbar-top-links navbar-right">
<ul id="navbar-link" class="nav navbar-top-links navbar-right" style="display:none;">
{% if app.user %}
<li>
<a href="{{path("app_user_profil")}}">
<img src="{{app.user.avatar|urlavatar}}" class="avatar">
<img src="{{app.user.avatar|urlavatar}}" class="avatar" style="width:25px; height:25px">
</a>
</li>
{% endif %}
@ -83,23 +145,27 @@
</li>
{% endif %}
<li>
{% if app.user %}
<li id="switchHeader">
<a class="btn-link" onclick="switchHeader()" title="Cacher / Afficher Bannière"><i class="fa fa-chevron-down fa-fw"></i></a>
<li>
{% if appAuth=="SQL" %}
<a href="{{path("app_logout")}}"><i class="fa fa-sign-out-alt fa-fw"></i></a>
<li><a href="{{path("app_logout")}}"><i class="fa fa-sign-out-alt fa-fw"></i></a></li>
{% elseif appAuth=="CAS" %}
<a href="{{path("app_logoutcas")}}"><i class="fa fa-sign-out-alt fa-fw"></i></a>
<li><a href="{{path("app_logoutcas")}}"><i class="fa fa-sign-out-alt fa-fw"></i></a></li>
{% endif %}
{% else %}
{% if appAuth=="SQL" %}
<a href="{{path("app_login")}}"><i class="fa fa-sign-in-alt fa-fw"></i></a>
<li><a href="{{path("app_login")}}"><i class="fa fa-sign-in-alt fa-fw"></i></a></li>
{% elseif appAuth=="CAS" %}
<a href="{{path("app_logincas")}}"><i class="fa fa-sign-in-alt fa-fw"></i></a>
<li><a href="{{path("app_logincas")}}"><i class="fa fa-sign-in-alt fa-fw"></i></a></li>
{% endif %}
{% endif %}
</li>
</ul>
</nav>
</div>
{% endif %}
<main id="main" class="container-fluid {% if maxwidth is defined and maxwidth %} page-maxed {% endif %}">
@ -116,6 +182,11 @@
</div>
</main>
<script>
$("#sidebar").css("padding-top",$(".header").height());
$("#mycontent").css("padding-top",$(".header").height());
</script>
<div id="mymodal" class="modal" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">