From 66fd7e275d0763e8f32ad9d69c833155563eccd5 Mon Sep 17 00:00:00 2001 From: afornerot Date: Wed, 13 Sep 2023 17:21:06 +0200 Subject: [PATCH] =?UTF-8?q?gestion=20footer=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 10 +- assets/js/app.js | 11 +- assets/styles/app.css | 29 + docker-compose.yml | 3 +- src/Command/InitCommand.php | 230 +- src/Service/AppSession.php | 10 +- templates/Config/list.html.twig | 66 +- templates/Config/render.html.twig | 2 + templates/Include/social.html.twig | 26 + templates/Include/style.css.twig | 2 + templates/base.html.twig | 55 +- yarn.lock | 7074 ++++++++++++++-------------- 12 files changed, 3898 insertions(+), 3620 deletions(-) create mode 100644 templates/Include/social.html.twig diff --git a/.env b/.env index a0d15b2..2a821d5 100755 --- a/.env +++ b/.env @@ -52,11 +52,11 @@ APP_NIVEAU04MANDATORY='[""]' APP_GROUPUSE=1 APP_GROUPSUBMITER='["ALL"]' -APP_ANNUSCOPEADMIN=ALL # ALL or number of niveau view : 1||2||3||4 -APP_ANNUSCOPEMODO=ALL # ALL or number of niveau view : 1||2||3||4 -APP_ANNUSCOPEMASTER=ALL # ALL or number of niveau view : 1||2||3||4 -APP_ANNUSCOPEMANAGER=ALL # ALL or number of niveau view : 1||2||3||4 -APP_ANNUSCOPEUSER=ALL # ALL or number of niveau view : 1||2||3||4 +APP_ANNUSCOPEADMIN=ALL # ALL or number of niveau view : 1||2||3||4 or 0 desactivé +APP_ANNUSCOPEMODO=ALL # ALL or number of niveau view : 1||2||3||4 or 0 desactivé +APP_ANNUSCOPEMASTER=ALL # ALL or number of niveau view : 1||2||3||4 or 0 desactivé +APP_ANNUSCOPEMANAGER=ALL # ALL or number of niveau view : 1||2||3||4 or 0 desactivé +APP_ANNUSCOPEUSER=ALL # ALL or number of niveau view : 1||2||3||4 or 0 desactivé APP_USERVIEWISVISIBLE=1 # Profil user with isvisible field diff --git a/assets/js/app.js b/assets/js/app.js index 924fbc2..04369c5 100755 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -44,6 +44,8 @@ $( window ).resize(function() { function resize() { + console.log("resize"); + if($("#header").is(":visible")){ $(".navbar-logo").hide(); $("#menulink").hide(); @@ -55,8 +57,13 @@ function resize() { $("#header").show(); } - $("main").css("height",$(window).height()-$(".header").height()); - $("#page").css("height",$(window).height()-$(".header").height()); + var footerheight=$("footer").height(); + if(footerheight) footerheight=footerheight+10; + else footerheight=0; + console.log(footerheight); + + $("main").css("height",$(window).height()-$(".header").height()-footerheight); + $("#page").css("height",$(window).height()-$(".header").height()-footerheight); $("#sidebar").css("min-height",$("body").height()-$(".header").height()); } diff --git a/assets/styles/app.css b/assets/styles/app.css index 7a18471..4cb54f1 100755 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -219,4 +219,33 @@ border-width: 1px; #page { overflow-y: auto; width:100%; +} + +/* FOOTER */ +footer { + padding:5px 30px; + background-color: var(--colorbgbodydark); + color: var(--colorftbodydark) !important; + position:absolute; + bottom: 0px; + left:0px; + width: 100%; +} + +.footer-adress { + font-size:80%; + width:50%; +} + +.footer-adress p { + margin:0px; +} + +.footer-social { + text-align: right; + width:50%; +} + +footer a { + color: var(--colorftbodydark) !important; } \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 280669f..5aabb06 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,6 +59,7 @@ services: build: context: . dockerfile: ./misc/images/app/app-docker/Dockerfile + container_name: nineskeletor-app ports: - ${APP_HTTP_PORT:-8080}:8080 links: @@ -79,7 +80,7 @@ services: environment: PHP_FPM_MEMORY_LIMIT: 128m APP_ENV: dev - + # Service websocket mercure: image: dunglas/mercure diff --git a/src/Command/InitCommand.php b/src/Command/InitCommand.php index 274051e..cc820d9 100755 --- a/src/Command/InitCommand.php +++ b/src/Command/InitCommand.php @@ -133,21 +133,6 @@ class InitCommand extends Command $this->insertConfig( 2, // order 'site', // category - 'appsubname', // id - 'Sous-titre de votre site', // title - '', // value - '', // default - 'string', // type, - true, // visible - true, // changeable - false, // required - '', // grouped - 'Sous-titre de votre site' - ); - - $this->insertConfig( - 3, // order - 'site', // category 'appdescription', // id 'Description de votre site', // title '', // value @@ -160,21 +145,22 @@ class InitCommand extends Command 'Description de votre site' ); + $this->insertConfig( - 100, // order - 'site', // category - 'fgforceconnect', // id - 'Forcer la connexion', // title - '', // value - '0', // default - 'boolean', // type, + 3, // order + "site", // category + "appmeta", // id + "Metadatas associées à votre site", // title + "", // value + "", // default + "textarea", // type true, // visible true, // changeable - true, // required - '', // grouped - 'Forcer la connexion afin de rendre votre site privé' + false, // required + "", // grouped + "Metadatas associées à votre site" ); - + $this->insertConfig( 500, // order 'site', // category @@ -409,6 +395,36 @@ class InitCommand extends Command $this->insertConfig( 1, // order 'header', // category + 'haveheader', // id + 'Afficher une bannière', // title + '', // value + '1', // default + 'boolean', // type, + true, // visible + true, // changeable + false, // required + '', // grouped + 'Permettre l\'affichage d\'une bannière' + ); + + $this->insertConfig( + 2, // order + 'header', // category + 'appsubname', // id + 'Sous-titre de votre site', // title + '', // value + '', // default + 'string', // type, + true, // visible + true, // changeable + false, // required + 'haveheader', // grouped + 'Sous-titre de votre site' + ); + + $this->insertConfig( + 3, // order + 'header', // category 'headerimage', // id 'Image de fond de la bannière', // title '', // value @@ -417,12 +433,12 @@ class InitCommand extends Command true, // visible true, // changeable false, // required - '', // grouped - 'Image appnamede fond de la bannière' + 'haveheader', // grouped + 'Image de fond de la bannière' ); $this->insertConfig( - 1, // order + 4, // order 'header', // category 'headerheight', // id 'Hauteur de la bannière', // title @@ -432,9 +448,163 @@ class InitCommand extends Command true, // visible true, // changeable false, // required - '', // grouped + 'haveheader', // grouped 'Image de fond de la bannière' ); + + // footer = + $this->insertConfig( + 1, // order + 'footer', // category + 'havefooter', // id + 'Afficher un pied de page', // title + '', // value + '0', // default + 'boolean', // type, + true, // visible + true, // changeable + false, // required + '', // grouped + 'Permettre l\'affichage d\'un pied de page' + ); + + + $this->insertConfig( + 2, // order + "footer", // category + "adress", // id + "Votre adresse postale", // title + "", // value + "", // default + "editor", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Votre adresse postale" + ); + + $this->insertConfig( + 3, // order + "footer", // category + "email", // id + "Email", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "L'email du site" + ); + + $this->insertConfig( + 4, // order + "footer", // category + "facebook", // id + "Facebook", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Le Facebook du site" + ); + + $this->insertConfig( + 5, // order + "footer", // category + "instagram", // id + "Instagram", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Le Instagram du site" + ); + + $this->insertConfig( + 6, // order + "footer", // category + "twitter", // id + "Twitter", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Le Twitter du site" + ); + + $this->insertConfig( + 7, // order + "footer", // category + "google", // id + "Google", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Le Google du site" + ); + + $this->insertConfig( + 8, // order + "footer", // category + "youtube", // id + "Youtube", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Le Youtube du site" + ); + + $this->insertConfig( + 9, // order + "footer", // category + "pinterest", // id + "Pinterest", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Le Pinterest du site" + ); + + $this->insertConfig( + 10, // order + "footer", // category + "linkedIn", // id + "LinkedIn", // title + "", // value + "", // default + "string", // type + true, // visible + true, // changeable + false, // required + "havefooter", // grouped + "Le LinkedIn du site" + ); + + $output->writeln(''); // Job synchronisation des comptes utilisateur diff --git a/src/Service/AppSession.php b/src/Service/AppSession.php index 6f50938..77dae99 100755 --- a/src/Service/AppSession.php +++ b/src/Service/AppSession.php @@ -77,19 +77,19 @@ class AppSession $showannuaire = false; $submitgroup = false; if ('anon.' != $curentuser) { - if ($curentuser->hasRole('ROLE_ADMIN') && null != $this->container->getParameter('appAnnuscopeadmin')) { + if ($curentuser->hasRole('ROLE_ADMIN') && 0 != $this->container->getParameter('appAnnuscopeadmin')) { $showannuaire = true; $session->set('scopeannu', $this->container->getParameter('appAnnuscopeadmin')); - } elseif ($curentuser->hasRole('ROLE_MODO') && null != $this->container->getParameter('appAnnuscopemodo')) { + } elseif ($curentuser->hasRole('ROLE_MODO') && 0 != $this->container->getParameter('appAnnuscopemodo')) { $showannuaire = true; $session->set('scopeannu', $this->container->getParameter('appAnnuscopemodo')); - } elseif ($curentuser->hasRole('ROLE_MASTER') && null != $this->container->getParameter('appAnnuscopemaster')) { + } elseif ($curentuser->hasRole('ROLE_MASTER') && 0 != $this->container->getParameter('appAnnuscopemaster')) { $showannuaire = true; $session->set('scopeannu', $this->container->getParameter('appAnnuscopemaster')); - } elseif ($curentuser->hasRole('ROLE_MANAGER') && null != $this->container->getParameter('appAnnuscopemanager')) { + } elseif ($curentuser->hasRole('ROLE_MANAGER') && 0 != $this->container->getParameter('appAnnuscopemanager')) { $showannuaire = true; $session->set('scopeannu', $this->container->getParameter('appAnnuscopemanager')); - } elseif ($curentuser->hasRole('ROLE_USER') && null != $this->container->getParameter('appAnnuscopeuser')) { + } elseif ($curentuser->hasRole('ROLE_USER') && 0 != $this->container->getParameter('appAnnuscopeuser')) { $showannuaire = true; $session->set('scopeannu', $this->container->getParameter('appAnnuscopeuser')); } diff --git a/templates/Config/list.html.twig b/templates/Config/list.html.twig index 7679626..4e00a90 100755 --- a/templates/Config/list.html.twig +++ b/templates/Config/list.html.twig @@ -11,41 +11,51 @@ CONFIGURATIONS {% endif %}
-
-

Générale

- {{ render(path("app_admin_config_render",{category:"site"})) }} +
+
+
Générale
+ {{ render(path("app_admin_config_render",{category:"site"})) }} +
-
-

Couleurs des fonds de page

- {{ render(path("app_admin_config_render",{category:"colorbgbody"})) }} +
+
+
Logo
+ {{ render(path("app_admin_config_render",{category:"logo"})) }} +
+ +
+
Couleurs des fonds de page
+ {{ render(path("app_admin_config_render",{category:"colorbgbody"})) }} +
+ +
+
Couleurs des titres
+ {{ render(path("app_admin_config_render",{category:"colorfttitle"})) }} +
+ +
+
Pied de Page
+ {{ render(path("app_admin_config_render",{category:"footer"})) }} +
-
-

Polices

- {{ render(path("app_admin_config_render",{category:"font"})) }} -
+
+
+
Polices
+ {{ render(path("app_admin_config_render",{category:"font"})) }} +
-
-

Couleurs des titres

- {{ render(path("app_admin_config_render",{category:"colorfttitle"})) }} -
+
+
Couleurs de la police
+ {{ render(path("app_admin_config_render",{category:"colorftbody"})) }} +
-
-

Couleurs de la police

- {{ render(path("app_admin_config_render",{category:"colorftbody"})) }} +
+
Bannière
+ {{ render(path("app_admin_config_render",{category:"header"})) }} +
- -
-

Logo

- {{ render(path("app_admin_config_render",{category:"logo"})) }} -
- -
-

Bannière

- {{ render(path("app_admin_config_render",{category:"header"})) }} -
-
diff --git a/templates/Config/render.html.twig b/templates/Config/render.html.twig index 96e0739..e5d56c4 100755 --- a/templates/Config/render.html.twig +++ b/templates/Config/render.html.twig @@ -1,3 +1,4 @@ +
{% for config in configs|sort((a, b) => a.order <=> b.order) %} @@ -83,3 +84,4 @@ {% endfor %}
+
diff --git a/templates/Include/social.html.twig b/templates/Include/social.html.twig new file mode 100644 index 0000000..215968b --- /dev/null +++ b/templates/Include/social.html.twig @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/templates/Include/style.css.twig b/templates/Include/style.css.twig index f3e0392..02d4d09 100755 --- a/templates/Include/style.css.twig +++ b/templates/Include/style.css.twig @@ -20,4 +20,6 @@ --colorbgbodydark-rgb: {{ app.session.get('colorbgbodydark-rgb')|raw }}; } + + \ No newline at end of file diff --git a/templates/base.html.twig b/templates/base.html.twig index 00921dd..8cb52d7 100755 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -1,10 +1,13 @@ - {% block title %}{{app.session.get("appname")}}{% endblock %} - + + + + + @@ -24,7 +27,7 @@ {% if (useheader is defined and useheader) or (usemenu is defined and usemenu) %}
- {% if useheader is defined and useheader and (app.session.get("fgheader") or not app.user) %} + {% if useheader is defined and useheader and app.session.get("haveheader") and (app.session.get("fgheader") or not app.user) %} {% endif %} - {% if (usemenu is defined and usemenu) or not app.session.get("fgheader") %} + {% if (usemenu is defined and usemenu) or not app.session.get("fgheader") or not app.session.get("haveheader") %} {%set style="display:flex"%} {% else %} {%set style="display:none"%} @@ -88,8 +98,8 @@ - {% if not app.session.get("fgheader") %} - {{app.session.get("appname")}} + {% if not app.session.get("fgheader") or not app.session.get("haveheader") %} + {{app.session.get("appname")}} {% else %} Accueil {% endif %} @@ -114,18 +124,24 @@ {% if is_granted('ROLE_ADMIN') %} {% elseif is_granted('ROLE_MODO') %} - + {% endif %} {% if app.session.get("showannuaire") %} - + {% if is_granted('ROLE_MANAGER') %} + + {% else %} + + {% endif %} {% endif %} {% if appGroupuse %} {% endif %} + {% if app.session.get("haveheader") %} + {% endif %} {% else %} @@ -144,15 +160,30 @@ {% elseif is_granted('ROLE_MODO') %} {{ include('Include/sidebarmodo.html.twig') }} {% endif %} - {%endif%} + {% endif %}
{%if maxsize is defined %}
{%endif%} {% block body %}{% endblock %} + + + {%if maxsize is defined %}
{%endif%} -
+ + + {% if app.session.get("havefooter") and ((useheader is defined and useheader) or (usemenu is defined and usemenu)) %} +
+
+ + {{ include('Include/social.html.twig') }} +
+
+ {% endif %} +