From 7931535dd5bce01f8c470bdac6600f47f9e0c584 Mon Sep 17 00:00:00 2001 From: Sylvain Dangin Date: Fri, 26 Jul 2019 21:40:16 +0200 Subject: [PATCH 01/36] Add file upload from dashboard --- assets/config/nextdom.config.php | 14 +++++++++ .../dashboard/cmd.action.upload.default.html | 13 ++++++++ src/Ajax/CmdAjax.php | 30 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 core/template/dashboard/cmd.action.upload.default.html diff --git a/assets/config/nextdom.config.php b/assets/config/nextdom.config.php index 2920821ea..1069b4116 100644 --- a/assets/config/nextdom.config.php +++ b/assets/config/nextdom.config.php @@ -230,6 +230,7 @@ 'SET_VOLUME' => array('name' => 'Volume', 'family' => 'Multimédia', 'type' => 'Action'), 'CHANNEL' => array('name' => 'Chaine', 'family' => 'Multimédia', 'type' => 'Info'), 'SET_CHANNEL' => array('name' => 'Chaine', 'family' => 'Multimédia', 'type' => 'Action'), + 'UPLOAD' => array('name' => 'Fichier', 'family' => 'Generic', 'type' => 'Action'), 'GENERIC_INFO' => array('name' => ' Générique', 'family' => 'Generic', 'type' => 'Info'), 'GENERIC_ACTION' => array('name' => ' Générique', 'family' => 'Generic', 'type' => 'Action'), 'DONT' => array('name' => 'Ne pas tenir compte de cette commande', 'family' => 'Generic', 'type' => 'All'), @@ -347,6 +348,19 @@ 'icon' => array('visible' => true, 'parentVisible' => true), ), ), + 'upload' => array( + 'name' => 'Fichier', + 'configuration' => array( + 'minValue' => array('visible' => false), + 'maxValue' => array('visible' => false), + 'listValue' => array('visible' => true)), + 'unite' => array('visible' => false), + 'isHistorized' => array('visible' => false), + 'display' => array( + 'invertBinary' => array('visible' => false), + 'icon' => array('visible' => true, 'parentVisible' => true), + ), + ) ), ), ), diff --git a/core/template/dashboard/cmd.action.upload.default.html b/core/template/dashboard/cmd.action.upload.default.html new file mode 100644 index 000000000..f3c05f7ce --- /dev/null +++ b/core/template/dashboard/cmd.action.upload.default.html @@ -0,0 +1,13 @@ +
+ #name_display#
+ + +
diff --git a/src/Ajax/CmdAjax.php b/src/Ajax/CmdAjax.php index 227414bb5..d61886679 100644 --- a/src/Ajax/CmdAjax.php +++ b/src/Ajax/CmdAjax.php @@ -21,6 +21,7 @@ use NextDom\Exceptions\CoreException; use NextDom\Helpers\AjaxHelper; use NextDom\Helpers\AuthentificationHelper; +use NextDom\Helpers\FileSystemHelper; use NextDom\Helpers\NextDomHelper; use NextDom\Helpers\Utils; use NextDom\Managers\CmdManager; @@ -456,4 +457,33 @@ public function setOrder() } AjaxHelper::success(); } + + /** + * Upload file from dashboard + * + * When file is uploaded, the method execute of the cmd is called with the filename in option. + * + * @throws CoreException + */ + public function fileUpload() + { + AuthentificationHelper::isConnectedOrFail(); + + $destDirectory = NEXTDOM_TMP . '/uploads'; + FileSystemHelper::mkdirIfNotExists($destDirectory); + + $filename = Utils::readUploadedFile($_FILES, "upload", $destDirectory, 8, []); + if (!$filename) { + AjaxHelper::error(__('File error')); + } + + $cmdId = Utils::init('cmdId'); + $cmd = CmdManager::byId($cmdId); + if (!is_object($cmd)) { + AjaxHelper::error(__('Command not found : ') . $cmdId); + } + + $cmd->execute(['filename' => $destDirectory . '/' . $filename ]); + AjaxHelper::success(); + } } \ No newline at end of file From 6c55824267c690e64fc5863f0aaee4d1bc4fcb21 Mon Sep 17 00:00:00 2001 From: Sylvain Dangin Date: Sat, 27 Jul 2019 13:26:55 +0200 Subject: [PATCH 02/36] Jeedom_ajax_token back https://github.com/NextDom/nextdom-core/issues/948 --- views/commons/footer.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/commons/footer.html.twig b/views/commons/footer.html.twig index 9cd34f12d..c7c92d760 100755 --- a/views/commons/footer.html.twig +++ b/views/commons/footer.html.twig @@ -41,10 +41,11 @@ var io = null; NEXTDOM_PRODUCT_NAME='{{ PRODUCT_NAME }}'; NEXTDOM_AJAX_TOKEN = '{{ AJAX_TOKEN }}'; + JEEDOM_AJAX_TOKEN = NEXTDOM_AJAX_TOKEN; $.ajaxSetup({ type: "POST", data: { - nextdom_token: '{{ AJAX_TOKEN }}' + nextdom_token: NEXTDOM_AJAX_TOKEN } }); var nextdom_language = '{{ LANGUAGE }}'; From 3a7955b0d6dab9fc44bd636effbb3bb92fe36b7d Mon Sep 17 00:00:00 2001 From: Sylvain Dangin Date: Sun, 28 Jul 2019 21:49:20 +0200 Subject: [PATCH 03/36] Fix variable name --- src/Helpers/LogHelper.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Helpers/LogHelper.php b/src/Helpers/LogHelper.php index 8198da815..9229d5a88 100644 --- a/src/Helpers/LogHelper.php +++ b/src/Helpers/LogHelper.php @@ -84,14 +84,12 @@ public static function addError($targetLog, $message, $logicalId = '') * @param string $message Message to log * @param string $logicalId Logical id linked to this log (optional) * - * @return bool True if log added - * * @throws \Exception */ public static function addInfo($targetLog, $message, $logicalId = '') { $message = $message . '\n' . PHPInformation::getInstance()->getCallingFunctionName(true); - self::add($logTarget, 'error', $message, $logicalId); + self::add($targetLog, 'error', $message, $logicalId); } /** From f35f59e6165711b058d3ab678eedf4cba795e79e Mon Sep 17 00:00:00 2001 From: Cyril Date: Mon, 29 Jul 2019 22:13:58 +0200 Subject: [PATCH 04/36] fix footer --- views/commons/AdminLTE_footer.html.twig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/views/commons/AdminLTE_footer.html.twig b/views/commons/AdminLTE_footer.html.twig index 743b838c9..d936e7180 100644 --- a/views/commons/AdminLTE_footer.html.twig +++ b/views/commons/AdminLTE_footer.html.twig @@ -19,9 +19,10 @@ From 99a9b599fdbad894695662395699c871976646b5 Mon Sep 17 00:00:00 2001 From: Sylvain Dangin Date: Tue, 30 Jul 2019 07:30:59 +0200 Subject: [PATCH 05/36] Remove % from secret characters --- install/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/postinst b/install/postinst index c9fdd6a07..a31713687 100755 --- a/install/postinst +++ b/install/postinst @@ -338,7 +338,7 @@ step_nextdom_configuration() { cp ${WEBSERVER_HOME}/core/config/common.config.sample.php ${WEBSERVER_HOME}/core/config/common.config.php SECRET_KEY=$( Date: Tue, 30 Jul 2019 15:33:25 +0200 Subject: [PATCH 06/36] Fix scenario template Market (#1224) * Fix scenario template Market https://github.com/NextDom/nextdom-core/issues/1209 * fix gif image (png) + input-group missing --- src/Repo/RepoMarketList.php | 2 +- src/mobile/package-lock.json | 47 +++++++++++++++++------- views/modals/scenario.template.html.twig | 8 +++- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/Repo/RepoMarketList.php b/src/Repo/RepoMarketList.php index d6297dd6a..36afee6c2 100644 --- a/src/Repo/RepoMarketList.php +++ b/src/Repo/RepoMarketList.php @@ -380,7 +380,7 @@ function displayWidgetSubtype($_name) $default_image = 'public/img/NextDom_Script_Gray.png'; break; default: - $default_image = 'public/img/NextDom_NoPicture_Gray.gif'; + $default_image = 'public/img/NextDom_NoPicture_Gray.png'; } $urlPath = ConfigManager::byKey('market::address') . '/' . $market->getImg('icon'); echo '
'; diff --git a/src/mobile/package-lock.json b/src/mobile/package-lock.json index aafaa1255..a06db8a17 100644 --- a/src/mobile/package-lock.json +++ b/src/mobile/package-lock.json @@ -2933,7 +2933,8 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true + "dev": true, + "optional": true }, "coa": { "version": "2.0.2", @@ -5244,7 +5245,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -5262,11 +5264,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5279,15 +5283,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5390,7 +5397,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5400,6 +5408,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5412,17 +5421,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5439,6 +5451,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -5511,7 +5524,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -5521,6 +5535,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -5596,7 +5611,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -5626,6 +5642,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5643,6 +5660,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -5681,11 +5699,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -9842,7 +9862,8 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true + "dev": true, + "optional": true }, "rx-lite-aggregates": { "version": "4.0.8", diff --git a/views/modals/scenario.template.html.twig b/views/modals/scenario.template.html.twig index e4ffc4057..d0d36cd0e 100644 --- a/views/modals/scenario.template.html.twig +++ b/views/modals/scenario.template.html.twig @@ -12,11 +12,10 @@ {% endif %} {% endfor %} -
+
-

{{ 'Template' }}
@@ -43,6 +42,7 @@ + diff --git a/src/mobile/src/components/Cmds/PowerInfoCmd.vue b/src/mobile/src/components/Cmds/PowerInfoCmd.vue index bbc13d98f..28df81da4 100644 --- a/src/mobile/src/components/Cmds/PowerInfoCmd.vue +++ b/src/mobile/src/components/Cmds/PowerInfoCmd.vue @@ -19,10 +19,12 @@ along with NextDom Software. If not, see . @Authors/Contributors: Sylvaner, Byackee, cyrilphoenix71, ColonelMoutarde, edgd1er, slobberbone, Astral0, DanoneKiD --> diff --git a/src/mobile/src/components/RoomWidget.vue b/src/mobile/src/components/RoomWidget.vue index d4bf76d8e..7d856e507 100644 --- a/src/mobile/src/components/RoomWidget.vue +++ b/src/mobile/src/components/RoomWidget.vue @@ -64,7 +64,7 @@ export default { * Extract room icon class from HTML tag */ roomIcon: function() { - return Utils.extractIcon(this.room.icon, "fas fa-times"); + return Utils.extractIcon(this.room.icon, "fas fa-tag"); } } }; diff --git a/src/mobile/src/components/Widgets/CameraWidget.vue b/src/mobile/src/components/Widgets/CameraWidget.vue index 20ada16ed..6e5cf75df 100644 --- a/src/mobile/src/components/Widgets/CameraWidget.vue +++ b/src/mobile/src/components/Widgets/CameraWidget.vue @@ -111,8 +111,10 @@ export default { diff --git a/src/mobile/src/libs/NextdomCmdTemplates.js b/src/mobile/src/libs/NextdomCmdTemplates.js index 9d6f25155..d39556c00 100644 --- a/src/mobile/src/libs/NextdomCmdTemplates.js +++ b/src/mobile/src/libs/NextdomCmdTemplates.js @@ -24,19 +24,21 @@ import DefaultActionCmd from "@/components/Cmds/DefaultActionCmd.vue"; import DontCmd from "@/components/Cmds/DontCmd.vue"; import ActionLinkedCmd from "@/components/Cmds/ActionLinkedCmd.vue"; import BatteryStateCmd from "@/components/Cmds/BatteryStateCmd.vue"; -import IconStateCmd from "@/components/Cmds/IconStateCmd.vue"; -import PlugStateCmd from "@/components/Cmds/PlugStateCmd.vue"; +import ColorPickerCmd from "@/components/Cmds/ColorPickerCmd.vue"; +import ConsumptionInfoCmd from "@/components/Cmds/ConsumptionInfoCmd.vue"; import DoorStateCmd from "@/components/Cmds/DoorStateCmd.vue"; +import IconStateCmd from "@/components/Cmds/IconStateCmd.vue"; +import HumidityInfoCmd from "@/components/Cmds/HumidityInfoCmd.vue"; import LightStateCmd from "@/components/Cmds/LightStateCmd.vue"; -import SliderCmd from "@/components/Cmds/SliderCmd.vue"; -import ColorPickerCmd from "@/components/Cmds/ColorPickerCmd.vue"; import LineStateCmd from "@/components/Cmds/LineStateCmd.vue"; import LockStateCmd from "@/components/Cmds/LockStateCmd.vue"; -import PresenceStateCmd from "@/components/Cmds/PresenceStateCmd.vue"; -import ConsumptionInfoCmd from "@/components/Cmds/ConsumptionInfoCmd.vue"; +import PlugStateCmd from "@/components/Cmds/PlugStateCmd.vue"; import PowerInfoCmd from "@/components/Cmds/PowerInfoCmd.vue"; +import PresenceStateCmd from "@/components/Cmds/PresenceStateCmd.vue"; import RefreshCmd from "@/components/Cmds/RefreshCmd.vue"; import SabotageInfoCmd from "@/components/Cmds/SabotageInfoCmd.vue"; +import SliderCmd from "@/components/Cmds/SliderCmd.vue"; +import TemperatureInfoCmd from "@/components/Cmds/TemperatureInfoCmd.vue"; import TextStateCmd from "@/components/Cmds/TextStateCmd.vue"; import WindowStateCmd from "@/components/Cmds/WindowStateCmd.vue"; @@ -50,18 +52,20 @@ export default { ActionLinkedCmd, BatteryStateCmd, ColorPickerCmd, - IconStateCmd, - PlugStateCmd, + ConsumptionInfoCmd, DoorStateCmd, + IconStateCmd, + HumidityInfoCmd, LightStateCmd, LineStateCmd, LockStateCmd, + PlugStateCmd, + PowerInfoCmd, PresenceStateCmd, SliderCmd, - ConsumptionInfoCmd, - PowerInfoCmd, RefreshCmd, SabotageInfoCmd, + TemperatureInfoCmd, TextStateCmd, WindowStateCmd }, @@ -186,7 +190,7 @@ export default { }, CONSUMPTION: { component: "ConsumptionInfoCmd", - icon: false, + icon: true, button: false }, ENERGY_STATE: { @@ -210,8 +214,8 @@ export default { button: false }, HUMIDITY: { - component: "DefaultInfoCmd", - icon: false, + component: "HumidityInfoCmd", + icon: true, button: false }, LIGHT_STATE: { @@ -246,7 +250,7 @@ export default { }, POWER: { component: "PowerInfoCmd", - icon: false, + icon: true, button: false }, PRESENCE: { @@ -260,8 +264,8 @@ export default { button: false }, TEMPERATURE: { - component: "DefaultInfoCmd", - icon: false, + component: "TemperatureInfoCmd", + icon: true, button: false }, OPENING_WINDOW: { diff --git a/src/mobile/src/libs/Store.js b/src/mobile/src/libs/Store.js index 908a36408..cfb2f01fb 100644 --- a/src/mobile/src/libs/Store.js +++ b/src/mobile/src/libs/Store.js @@ -62,16 +62,19 @@ export const store = new Vuex.Store({ * @param {Array} cmd Command object */ setCmdComponentData(state, cmd) { + if (cmd.id == 1205 || cmd.id == 1206) { + console.log(cmd); + } let componentData = undefined; - // Test for commands with template + // Test generic type try { - componentData = - CmdTemplates["cmds"][cmd.type][cmd.subType][cmd.template]; + componentData = CmdTemplates["cmdsWithoutTemplate"][cmd.genericType]; } catch {} - // Test generic type + // Test for commands with template if (componentData === undefined) { try { - componentData = CmdTemplates["cmdsWithoutTemplate"][cmd.genericType]; + componentData = + CmdTemplates["cmds"][cmd.type][cmd.subType][cmd.template]; } catch {} } // Specials cases From 0d3ce48785c9ee133dd5896b2427aaaa22aa1016 Mon Sep 17 00:00:00 2001 From: Sylvain Dangin Date: Fri, 26 Jul 2019 11:12:28 +0200 Subject: [PATCH 11/36] Fix rescue mode --- src/Helpers/PrepareView.php | 2 +- translations/en_US.yml | 9 +++++++++ translations/fr_FR.yml | 9 +++++++++ views/commons/menu_rescue.html.twig | 4 ++-- views/layouts/base_rescue.html.twig | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Helpers/PrepareView.php b/src/Helpers/PrepareView.php index 438ff4777..ffdecbd3a 100755 --- a/src/Helpers/PrepareView.php +++ b/src/Helpers/PrepareView.php @@ -725,12 +725,12 @@ public function showRescueMode() $render = Render::getInstance(); $pageData['CSS'] = $render->getCssHtmlTag('/public/css/nextdom.css'); $pageData['JS_VARS'] = [ - 'userProfils' => UserManager::getStoredUser()->getOptions(), 'user_id' => UserManager::getStoredUser()->getId(), 'user_isAdmin' => AuthentificationHelper::isConnectedAsAdmin(), 'user_login' => UserManager::getStoredUser()->getLogin(), 'serverTZoffsetMin' => Utils::getTZoffsetMin()]; $pageData['JS_VARS_RAW'] = [ + 'userProfils' => Utils::getArrayToJQueryJson(UserManager::getStoredUser()->getOptions()), 'serverDatetime' => Utils::getMicrotime() ]; $pageData['JS'] = ''; diff --git a/translations/en_US.yml b/translations/en_US.yml index f0cb0c953..462c43340 100644 --- a/translations/en_US.yml +++ b/translations/en_US.yml @@ -231,6 +231,15 @@ plugin: security: security automation-protocol: Automation Protocol +menu_rescue: + system: System + database: Database + editor: Editor + personalization: Personalization + backup: Backup + task_engine: Task engine + logs: Logs + welcome: title: Welcome to %productName% congrats: Congratulations diff --git a/translations/fr_FR.yml b/translations/fr_FR.yml index 60df74a19..897f978e0 100644 --- a/translations/fr_FR.yml +++ b/translations/fr_FR.yml @@ -227,6 +227,15 @@ plugin: security: Sécurité automation-protocol: Protocole domotique +menu_rescue: + system: Système + database: Base de données + editor: Editeur + personalization: Personalisation + backup: Sauvegarde + task_engine: Moteur de tâches + logs: Journaux + welcome: title: Bienvenue dans %productName% congrats: Félicitations diff --git a/views/commons/menu_rescue.html.twig b/views/commons/menu_rescue.html.twig index 283a63baa..f48ca1f9d 100644 --- a/views/commons/menu_rescue.html.twig +++ b/views/commons/menu_rescue.html.twig @@ -55,11 +55,11 @@
  • {{ 'menu_rescue.editor' | trans }}
  • {{ 'menu_rescue.personalization' | trans }}
  • -
  • {{ 'menu_rescue.safeguard' | trans }} +
  • {{ 'menu_rescue.backup' | trans }}
  • {{ 'menu_rescue.task_engine' | trans }}
  • -
  • {{ 'common.log' | trans }}
  • +
  • {{ 'menu_rescue.logs' | trans }}
  • diff --git a/views/layouts/base_rescue.html.twig b/views/layouts/base_rescue.html.twig index 592eaf216..54b20d401 100644 --- a/views/layouts/base_rescue.html.twig +++ b/views/layouts/base_rescue.html.twig @@ -5,7 +5,7 @@
    {{ CONTENT | raw }}
    - + {% if JS_END_POOL is defined %} {% for jsFile in JS_END_POOL %} From d32ca5b946cfcee811df9c5b0c0f2d8db2d7d7b8 Mon Sep 17 00:00:00 2001 From: Cyril Date: Fri, 26 Jul 2019 14:06:09 +0200 Subject: [PATCH 12/36] Fix logo --- views/commons/menu_rescue.html.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/views/commons/menu_rescue.html.twig b/views/commons/menu_rescue.html.twig index f48ca1f9d..e5613d07a 100644 --- a/views/commons/menu_rescue.html.twig +++ b/views/commons/menu_rescue.html.twig @@ -37,7 +37,7 @@
    - From 26e138ddd66a7ca588ce1bb6d4223972ed9dd047 Mon Sep 17 00:00:00 2001 From: Cyril Date: Fri, 26 Jul 2019 14:28:06 +0200 Subject: [PATCH 13/36] fix action-bar in rescue + logo link --- assets/css/containers/_actionbars.scss | 1 + assets/js/desktop/gui.js | 75 ++++++++++++++------------ views/commons/menu_rescue.html.twig | 2 +- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/assets/css/containers/_actionbars.scss b/assets/css/containers/_actionbars.scss index d85c61f43..1ad8203ce 100644 --- a/assets/css/containers/_actionbars.scss +++ b/assets/css/containers/_actionbars.scss @@ -21,6 +21,7 @@ /* AdminLTE-Ajout */ .action-bar { + min-height: 50px; padding: 6px 8px; align-items: center; display: flex; diff --git a/assets/js/desktop/gui.js b/assets/js/desktop/gui.js index 3965105d4..3275ee16e 100644 --- a/assets/js/desktop/gui.js +++ b/assets/js/desktop/gui.js @@ -230,41 +230,50 @@ window.onscroll = function () { alertHeaderHeight = $('.alert-header').height(); alertHeaderMargin = 15; } - if ($('*').hasClass("content-header")) { - var scrollLimit = 14 + alertHeaderHeight; - $(".content-header").each(function() { - var container = $(this).parent(); - if (!container.hasClass("ui-dialog-content") && !container.parent().hasClass("ui-dialog-content")) { - $(this).css("padding-right", paddingSideClose); - if (init || container.css("display")!="none") { - if (container.css("display")=="none") { - container.show(); - headerHeight = container.children('.content-header').height(); - container.hide(); - } else { - headerHeight = container.children('.content-header').height(); + var fullUrl = document.location.toString(); + if (fullUrl.indexOf('rescue') === -1) { + if ($('*').hasClass("content-header")) { + var scrollLimit = 14 + alertHeaderHeight; + $(".content-header").each(function() { + var container = $(this).parent(); + if (!container.hasClass("ui-dialog-content") && !container.parent().hasClass("ui-dialog-content")) { + $(this).css("padding-right", paddingSideClose); + if (init || container.css("display")!="none") { + if (container.css("display")=="none") { + container.show(); + headerHeight = container.children('.content-header').height(); + container.hide(); + } else { + headerHeight = container.children('.content-header').height(); + } + var scrollValue = document.documentElement.scrollTop; + if (scrollValue > scrollLimit) { + container.children(".content-header").css("top", headerSize - 15); + container.children("#dashboard-content").css("padding-top", headerHeight + 15); + container.children(".content").css("padding-top", headerHeight + 30); + container.children(".content-header").children("div").removeClass('scroll-shadow').addClass('fixed-shadow'); + } else { + container.children(".content-header").css("top", headerSize - scrollValue + alertHeaderHeight + alertHeaderMargin); + container.children("#dashboard-content").css("padding-top",headerHeight + 15 - alertHeaderMargin); + container.children(".content").css("padding-top", headerHeight + 30 - alertHeaderMargin); + container.children(".content-header").children("div").removeClass('fixed-shadow').addClass('scroll-shadow'); + } + container.children(".content-header").show(); } - var scrollValue = document.documentElement.scrollTop; - if (scrollValue > scrollLimit) { - container.children(".content-header").css("top", headerSize - 15); - container.children("#dashboard-content").css("padding-top", headerHeight + 15); - container.children(".content").css("padding-top", headerHeight + 30); - container.children(".content-header").children("div").removeClass('scroll-shadow').addClass('fixed-shadow'); - } else { - container.children(".content-header").css("top", headerSize - scrollValue + alertHeaderHeight + alertHeaderMargin); - container.children("#dashboard-content").css("padding-top",headerHeight + 15 - alertHeaderMargin); - container.children(".content").css("padding-top", headerHeight + 30 - alertHeaderMargin); - container.children(".content-header").children("div").removeClass('fixed-shadow').addClass('scroll-shadow'); - } - container.children(".content-header").show(); } - } - }); - $("#dashboard-header").css("padding-right", paddingSideClose); - } else { - $("#dashboard-content").css("padding-top", 15); - $(".content").css("padding-top", 15); - } + }); + $("#dashboard-header").css("padding-right", paddingSideClose); + } else { + $("#dashboard-content").css("padding-top", 15); + $(".content").css("padding-top", 15); + } + } else { + $(".content-header").css("padding-right", 15); + $(".content-header").css("top", 50); + $(".content").css("padding-top", 30); + // Hide back button + $(".content-header").find(".fa-chevron-left").parent().hide(); + } } /** diff --git a/views/commons/menu_rescue.html.twig b/views/commons/menu_rescue.html.twig index e5613d07a..7743dc962 100644 --- a/views/commons/menu_rescue.html.twig +++ b/views/commons/menu_rescue.html.twig @@ -36,7 +36,7 @@