From 36ba52614ce7e29e8432fcedecc6b0b0531a8dee Mon Sep 17 00:00:00 2001 From: ouidade Date: Fri, 18 Feb 2022 11:01:01 +0100 Subject: [PATCH] bouton deposer une ressource hidden --- web/themes/custom/eql/css-compiled/styles.css | 52 ++++++++-------- web/themes/custom/eql/scripts/main.js | 25 -------- .../custom/eql/scss/pages/_basededonnees.scss | 61 ++++++++++--------- .../eql/scss/pages/_basededonnees_autres.scss | 40 ++++++++++++ web/themes/custom/eql/scss/styles.scss | 2 + .../html--ressources--bdd--255.html.twig | 57 +++++++++++++++++ .../html--ressources--bdd--256.html.twig | 57 +++++++++++++++++ 7 files changed, 217 insertions(+), 77 deletions(-) create mode 100644 web/themes/custom/eql/scss/pages/_basededonnees_autres.scss create mode 100644 web/themes/custom/eql/templates/layout/html--ressources--bdd--255.html.twig create mode 100644 web/themes/custom/eql/templates/layout/html--ressources--bdd--256.html.twig diff --git a/web/themes/custom/eql/css-compiled/styles.css b/web/themes/custom/eql/css-compiled/styles.css index 4aa9ba0..098b721 100644 --- a/web/themes/custom/eql/css-compiled/styles.css +++ b/web/themes/custom/eql/css-compiled/styles.css @@ -1548,30 +1548,7 @@ a { background: white; margin-top: 2rem; } .path-ressources.basededonnees .layout-content .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d { - grid-column: 8 / span 9; - margin-top: 4rem; - background-color: #009ee3; - height: fit-content; - width: 60%; - margin-left: 2rem; - grid-row: 2; } - .path-ressources.basededonnees .layout-content .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d .field--name-field-lien { - display: flex; - flex-direction: column; - margin-top: 2rem; - margin-bottom: 2rem; - margin-left: 1.5rem; - margin-right: 1.5rem; - text-align: center; } - .path-ressources.basededonnees .layout-content .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d .field--name-field-lien a { - font-weight: 800; - color: white; - font-size: 1.3rem; } - .path-ressources.basededonnees .layout-content .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d .field--name-field-lien:after { - margin-left: auto; - padding-top: 1rem; - display: block; - content: url("../images/pictos/noun_Arrow_3771902.svg"); } + visibility: hidden; } .path-ressources.basededonnees .layout-content .region-content #block-contenudelapageprincipale .layout--onecol .block-region-content .block-views-blockbase-de-donnees-block-1 { width: 80%; grid-column: 3 / span 8; } @@ -1666,6 +1643,33 @@ a { flex-direction: column; margin: auto; } } +.path-ressources.basededonnees.autres .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d { + visibility: visible !important; + grid-column: 8 / span 9; + margin-top: 4rem; + background-color: #009ee3; + height: fit-content; + width: 60%; + margin-left: 2rem; + grid-row: 2; } + .path-ressources.basededonnees.autres .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d .field--name-field-lien { + display: flex; + flex-direction: column; + margin-top: 2rem; + margin-bottom: 2rem; + margin-left: 1.5rem; + margin-right: 1.5rem; + text-align: center; } + .path-ressources.basededonnees.autres .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d .field--name-field-lien a { + font-weight: 800; + color: white; + font-size: 1.3rem; } + .path-ressources.basededonnees.autres .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d .field--name-field-lien:after { + margin-left: auto; + padding-top: 1rem; + display: block; + content: url("../images/pictos/noun_Arrow_3771902.svg"); } + .page-node-type-ressource .layout__region--top .block-region-top .block-block-content4e5df355-e76c-4e44-bec0-e211d94f2640 { width: 100%; font-family: 'Source Code Pro'; diff --git a/web/themes/custom/eql/scripts/main.js b/web/themes/custom/eql/scripts/main.js index 1919f0c..f979082 100644 --- a/web/themes/custom/eql/scripts/main.js +++ b/web/themes/custom/eql/scripts/main.js @@ -132,31 +132,6 @@ jQuery(function($) { }); -///////////////////////////////////////// -// masquer bouton proposer une ressource pour collection 50 ans - -// jQuery(function($) { -// var path = window.location.href; // because the 'href' property of the DOM element is the absolute path -// console.log(path); - -// $ (function bouton() { - -// if (path.indexOf("/ressources/bdd/29") > -1) { -// (".block-block-content82917d0c-5004-4bfb-af66-ce334782d82d").addClass('.notdisplaid'); -// } -// }); -// }); - - -// jQuery(function($) { -// var path = window.location.href; // because the 'href' property of the DOM element is the absolute path -// console.log(path); -// $(".block-block-content82917d0c-5004-4bfb-af66-ce334782d82d").each(function() { -// if (this.href === path) { -// $(this).parent().closest('.field--name-field-lien').addClass('notdisplaid'); -// } -// }); -// }); diff --git a/web/themes/custom/eql/scss/pages/_basededonnees.scss b/web/themes/custom/eql/scss/pages/_basededonnees.scss index 13c31ee..f694978 100644 --- a/web/themes/custom/eql/scss/pages/_basededonnees.scss +++ b/web/themes/custom/eql/scss/pages/_basededonnees.scss @@ -1,3 +1,4 @@ + .path-ressources.basededonnees{ .layout-content{ width: 100vw; @@ -144,38 +145,42 @@ //button proposer une ressource .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d{ - // display: none; - grid-column: 8 / span 9; - margin-top: 4rem; - background-color: $blue-light; - height: fit-content; - width: 60%; - margin-left: 2rem; - grid-row: 2; + visibility: hidden; + // grid-column: 8 / span 9; + // margin-top: 4rem; + // background-color: $blue-light; + // height: fit-content; + // width: 60%; + // margin-left: 2rem; + // grid-row: 2; + // .display{ + // display: block; + // } - .field--name-field-lien{ - display: flex; - flex-direction: column; - margin-top: 2rem; - margin-bottom: 2rem; - margin-left: 1.5rem; - margin-right: 1.5rem; - text-align: center; - a{ - font-weight: 800; - color: $white; - font-size: 1.3rem; - } - &:after{ - margin-left: auto; - padding-top: 1rem; - display: block; - content:url("../images/pictos/noun_Arrow_3771902.svg") + // .field--name-field-lien{ + // display: flex; + // flex-direction: column; + // margin-top: 2rem; + // margin-bottom: 2rem; + // margin-left: 1.5rem; + // margin-right: 1.5rem; + // text-align: center; + // a{ + // font-weight: 800; + // color: $white; + // font-size: 1.3rem; + // } + // &:after{ + // margin-left: auto; + // padding-top: 1rem; + // display: block; + // content:url("../images/pictos/noun_Arrow_3771902.svg") - } + // } - } + // } + } // grille des ressources .block-views-blockbase-de-donnees-block-1{ diff --git a/web/themes/custom/eql/scss/pages/_basededonnees_autres.scss b/web/themes/custom/eql/scss/pages/_basededonnees_autres.scss new file mode 100644 index 0000000..259b714 --- /dev/null +++ b/web/themes/custom/eql/scss/pages/_basededonnees_autres.scss @@ -0,0 +1,40 @@ + +.path-ressources.basededonnees.autres{ + //button proposer une ressource + .block-block-content82917d0c-5004-4bfb-af66-ce334782d82d{ + visibility: visible !important; + grid-column: 8 / span 9; + margin-top: 4rem; + background-color: $blue-light; + height: fit-content; + width: 60%; + margin-left: 2rem; + grid-row: 2; + + + + .field--name-field-lien{ + display: flex; + flex-direction: column; + margin-top: 2rem; + margin-bottom: 2rem; + margin-left: 1.5rem; + margin-right: 1.5rem; + text-align: center; + a{ + font-weight: 800; + color: $white; + font-size: 1.3rem; + } + &:after{ + margin-left: auto; + padding-top: 1rem; + display: block; + content:url("../images/pictos/noun_Arrow_3771902.svg") + + } + + } + + } +} \ No newline at end of file diff --git a/web/themes/custom/eql/scss/styles.scss b/web/themes/custom/eql/scss/styles.scss index 96678f0..f736de3 100644 --- a/web/themes/custom/eql/scss/styles.scss +++ b/web/themes/custom/eql/scss/styles.scss @@ -30,6 +30,8 @@ @import "pages/_faq"; @import "pages/_mentions-legales"; @import "pages/_basededonnees"; +@import "pages/_basededonnees_autres"; + @import "pages/_ressource"; @import "pages/_offresdeservices"; @import "pages/_offre"; diff --git a/web/themes/custom/eql/templates/layout/html--ressources--bdd--255.html.twig b/web/themes/custom/eql/templates/layout/html--ressources--bdd--255.html.twig new file mode 100644 index 0000000..e679408 --- /dev/null +++ b/web/themes/custom/eql/templates/layout/html--ressources--bdd--255.html.twig @@ -0,0 +1,57 @@ +{# +/** + * @file + * Theme override for the basic structure of a single Drupal page. + * + * Variables: + * - logged_in: A flag indicating if user is logged in. + * - root_path: The root path of the current page (e.g., node, admin, user). + * - node_type: The content type for the current node, if the page is a node. + * - head_title: List of text elements that make up the head_title variable. + * May contain one or more of the following: + * - title: The title of the page. + * - name: The name of the site. + * - slogan: The slogan of the site. + * - page_top: Initial rendered markup. This should be printed before 'page'. + * - page: The rendered page markup. + * - page_bottom: Closing rendered markup. This variable should be printed after + * 'page'. + * - db_offline: A flag indicating if the database is offline. + * - placeholder_token: The token for generating head, css, js and js-bottom + * placeholders. + * + * @see template_preprocess_html() + */ +#} +{% + set body_classes = [ + logged_in ? 'user-logged-in', + not root_path ? 'path-frontpage' : 'path-' ~ root_path|clean_class, + node_type ? 'page-node-type-' ~ node_type|clean_class, + db_offline ? 'db-offline', + 'basededonnees', + 'historiques', + ] +%} + + + + + {{ head_title|safe_join(' | ') }} + + + + + {# + Keyboard navigation/accessibility link to main content section in + page.html.twig. + #} + + {{ page_top }} + {{ page }} + {{ page_bottom }} + + + \ No newline at end of file diff --git a/web/themes/custom/eql/templates/layout/html--ressources--bdd--256.html.twig b/web/themes/custom/eql/templates/layout/html--ressources--bdd--256.html.twig new file mode 100644 index 0000000..c51eb11 --- /dev/null +++ b/web/themes/custom/eql/templates/layout/html--ressources--bdd--256.html.twig @@ -0,0 +1,57 @@ +{# +/** + * @file + * Theme override for the basic structure of a single Drupal page. + * + * Variables: + * - logged_in: A flag indicating if user is logged in. + * - root_path: The root path of the current page (e.g., node, admin, user). + * - node_type: The content type for the current node, if the page is a node. + * - head_title: List of text elements that make up the head_title variable. + * May contain one or more of the following: + * - title: The title of the page. + * - name: The name of the site. + * - slogan: The slogan of the site. + * - page_top: Initial rendered markup. This should be printed before 'page'. + * - page: The rendered page markup. + * - page_bottom: Closing rendered markup. This variable should be printed after + * 'page'. + * - db_offline: A flag indicating if the database is offline. + * - placeholder_token: The token for generating head, css, js and js-bottom + * placeholders. + * + * @see template_preprocess_html() + */ +#} +{% + set body_classes = [ + logged_in ? 'user-logged-in', + not root_path ? 'path-frontpage' : 'path-' ~ root_path|clean_class, + node_type ? 'page-node-type-' ~ node_type|clean_class, + db_offline ? 'db-offline', + 'basededonnees', + 'autres', + ] +%} + + + + + {{ head_title|safe_join(' | ') }} + + + + + {# + Keyboard navigation/accessibility link to main content section in + page.html.twig. + #} + + {{ page_top }} + {{ page }} + {{ page_bottom }} + + + \ No newline at end of file