From 06f714d55ced13dd2fcb1eb55f84fef4bcd7c804 Mon Sep 17 00:00:00 2001 From: Adrien Morais Date: Sun, 20 Oct 2019 18:36:58 +0200 Subject: [PATCH] enh(upgrade): display release notes per section --- www/Themes/Centreon-2/style.css | 28 ++++++++++++++++++++++++++++ www/install/step_upgrade/step3.php | 27 ++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/www/Themes/Centreon-2/style.css b/www/Themes/Centreon-2/style.css index 31be47597a1..7bf1db18f55 100755 --- a/www/Themes/Centreon-2/style.css +++ b/www/Themes/Centreon-2/style.css @@ -2790,3 +2790,31 @@ ul.module_list { white-space: nowrap; margin-right: 10px; } + +#installationContent .accordion { + background-color: #d6d5d5; + color: #444; + cursor: pointer; + padding: 5px; + text-align: left; + border: none; + outline: none; + transition: 0.4s; +} + +#contentwrapper div.section { + padding: 0 10px; +} + +#contentwrapper > div:not(:nth-child(2)) div.section { + display: none; + padding: 0 10px; + background-color: #d6d5d5; + overflow: hidden; +} + +.accordion h1:hover { + background-color: #c3c3c3; + cursor: pointer; +} + diff --git a/www/install/step_upgrade/step3.php b/www/install/step_upgrade/step3.php index 8c558010053..b58a81a60fc 100644 --- a/www/install/step_upgrade/step3.php +++ b/www/install/step_upgrade/step3.php @@ -66,7 +66,32 @@ var step3_t; jQuery(function () { - jQuery('#releasenotes').load('RELEASENOTES.html'); + jQuery('#releasenotes').load('RELEASENOTES.html', function() { + /* add accordion class to all div matching centreon-web-* id */ + jQuery('div[id^="centreon-web-"]').addClass('accordion'); + + var acc = document.getElementsByClassName("accordion"); + var i; + + for (i = 0; i < acc.length; i++) { + acc[i].addEventListener("click", function() { + /* Toggle between adding and removing the "active" class, + to highlight the button that controls the panel */ + this.classList.toggle("active"); + + /* Toggle between hiding and showing the active panel */ + var panels = this.getElementsByClassName("section"); + var j; + for (j = 0; j < panels.length; j++) { + if (panels[j].style.display === "block") { + panels[j].style.display = "none"; + } else { + panels[j].style.display = "block"; + } + } + }); + } + }); jQuery('#next').attr('disabled', 'disabled'); timeout_button(); });