Project 'cooperatic/kohinos-tav' was moved to 'agplv3/kohinos-tav'. Please update any links and bookmarks that may still have the old path.
Commit 7e05daf3 by Damien Moulard

Merge branch '4288-et-4233-menu-dependants-de-l-environnement' into 'develop'

use js to hide or show depending on env meta tag

See merge request cooperatic/kohinos-tav!21
parents 501e57af c0773fb5
......@@ -69,4 +69,27 @@ $(document).ready(function() {
}
});
});
// Hide or display Cotisation or Profils de Cotisation submenu depending on TAV env
const tav_env = document.getElementsByName('is-tav-env')[0].getAttribute('content');
let linksToCotisationAdherent = $('a[href="/admin/cotisation_adherent/list"]');
for(let i = 0 ; i < linksToCotisationAdherent.length ; i++) {
if(linksToCotisationAdherent[i].innerText === "Cotisation") {
linksToCotisationAdherent[i].parentNode.style.display = (tav_env === "1") ? "none" : "";
}
}
let linksToCotisationPresta = $('a[href="/admin/cotisation_prestataire/list"]');
for(let i = 0 ; i < linksToCotisationPresta.length ; i++) {
if(linksToCotisationPresta[i].innerText === "Cotisation") {
linksToCotisationPresta[i].parentNode.style.display = (tav_env === "1") ? "none" : "";
}
}
let linksToProfilDeCotisation = $('a[href="/admin/profilcotisation/list"]');
for(let i = 0 ; i < linksToProfilDeCotisation.length ; i++) {
if(linksToProfilDeCotisation[i].innerText === "Profils De Cotisation") {
linksToProfilDeCotisation[i].parentNode.style.display = (tav_env === "1") ? "" : "none";
}
}
});
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,7 +12,7 @@
"admin": {
"js": [
"/build/runtime.6ad5c9da.js",
"/build/admin.8a6adf4b.js"
"/build/admin.b35f5723.js"
],
"css": [
"/build/admin.5dc0eea7.css"
......
......@@ -2,7 +2,7 @@
"build/app.css": "/build/app.8f9aaf53.css",
"build/app.js": "/build/app.fe8f482e.js",
"build/admin.css": "/build/admin.5dc0eea7.css",
"build/admin.js": "/build/admin.8a6adf4b.js",
"build/admin.js": "/build/admin.b35f5723.js",
"build/runtime.js": "/build/runtime.6ad5c9da.js",
"build/images/fa-solid-900.svg": "/build/images/fa-solid-900.a838c42a.svg",
"build/images/fa-brands-400.svg": "/build/images/fa-brands-400.05d20183.svg",
......
......@@ -26,6 +26,7 @@ Modified for MLC from Sonata package.
<html {% block html_attributes %}class="no-js"{% endblock %}>
<head>
<title>{{title|default('Kohinos') }}</title>
<meta name="is-tav-env" content="{{ tav_env }}" />
<meta name="description" content="{{ description|default('Kohinos : Outil de gestion de monnaie locale complémentaire') }}" />
<meta name="keywords" content="{{ keywords|default('Kohinos, mlc, mlcc, monnaie locale, monnaies locales') }}" />
......
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