From e6cb605573b511955b5045349e08930a28c3d222 Mon Sep 17 00:00:00 2001 From: daichi_otani Date: Tue, 19 Sep 2023 01:23:13 +0900 Subject: [PATCH] =?UTF-8?q?feat:=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= =?UTF-8?q?=E3=83=A2=E3=83=BC=E3=83=89=E6=9C=89=E5=8A=B9=E6=99=82=E3=81=AB?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E3=81=99=E3=82=8B=E6=A9=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/template/default/assets/css/style.css | 29 +++++++++++++++++++ .../EventListener/TwigInitializeListener.php | 2 ++ src/Eccube/Resource/locale/messages.en.yaml | 2 ++ src/Eccube/Resource/locale/messages.ja.yaml | 3 ++ .../template/admin/default_frame.twig | 1 + .../template/admin/notice_debug_mode.twig | 8 +++++ .../template/default/default_frame.twig | 8 +++++ 7 files changed, 53 insertions(+) create mode 100644 src/Eccube/Resource/template/admin/notice_debug_mode.twig diff --git a/html/template/default/assets/css/style.css b/html/template/default/assets/css/style.css index 539264e6ed4..c1c00de79ea 100755 --- a/html/template/default/assets/css/style.css +++ b/html/template/default/assets/css/style.css @@ -10471,6 +10471,35 @@ Styleguide 11.2.7 .ec-maintenanceAlert + * { margin-top: 50px; } + +/* devモードの追加 */ +.ec-debugModeAlert { + background: steelblue; + height: 50px; + position: fixed; + top: 0; + width: 100%; + color: white; + z-index: 9999; + display: flex; + font-weight: bold; +} +.ec-debugModeAlert > * { + margin: auto; +} +.ec-debugModeAlert .ec-debugModeAlert__icon { + display: inline-block; + margin-right: 1rem; + width: 20px; + height: 20px; + color: #fff; + fill: #fff; + vertical-align: top; +} +.ec-debugModeAlert + * { + margin-top: 50px; +} + /** メディアクエリ SP フォーストで記述する。 diff --git a/src/Eccube/EventListener/TwigInitializeListener.php b/src/Eccube/EventListener/TwigInitializeListener.php index 6d057b9aeb2..a4ab5493f82 100644 --- a/src/Eccube/EventListener/TwigInitializeListener.php +++ b/src/Eccube/EventListener/TwigInitializeListener.php @@ -235,6 +235,7 @@ public function setFrontVariables(RequestEvent $event) $this->twig->addGlobal('Page', $Page); $this->twig->addGlobal('title', $Page->getName()); $this->twig->addGlobal('isMaintenance', $this->systemService->isMaintenanceMode()); + $this->twig->addGlobal('isDebugMode', env('APP_DEBUG')); } public function setAdminGlobals(RequestEvent $event) @@ -253,6 +254,7 @@ public function setAdminGlobals(RequestEvent $event) $eccubeNav = $this->getDisplayEccubeNav($eccubeNav, $AuthorityRoles, $baseUrl); } $this->twig->addGlobal('eccubeNav', $eccubeNav); + $this->twig->addGlobal('isDebugMode', env('APP_DEBUG')); } /** diff --git a/src/Eccube/Resource/locale/messages.en.yaml b/src/Eccube/Resource/locale/messages.en.yaml index b43ac56e698..74938c7e5f4 100644 --- a/src/Eccube/Resource/locale/messages.en.yaml +++ b/src/Eccube/Resource/locale/messages.en.yaml @@ -392,6 +392,7 @@ front.shopping.payment_method_unselected: Please select the payment method. front.shopping.not_available_payment_method: The payment method you have selected is not available. front.shopping.payment_method_not_fount: Sorry, you have no payment options. If you have selected multiple delivery methods, you can only select the same payment option for them all. front.under_maintenance: The site is currently under maintenance. +front.under_debug_mode: The site is currently under debug mode. #==================================================================================== # Admin Console @@ -503,6 +504,7 @@ admin.common.move_to_confirm_move_only: Move admin.common.move_to_confirm_save_and_move: Save & Move admin.common.admin_url_warning: 'Please set the Admin Console URL that is hard to guess for security. You can set it at "Security".' admin.common.restrict_file_upload_info: 'If this feature is used infrequently, disabling it while not in use provides additional security. You can disable this feature by setting the environment variable ECCUBE_RESTRICT_FILE_UPLOAD to 1.' +admin.common.notice_debug_mode: The site is currently under debug mode. # Labels related to entity diff --git a/src/Eccube/Resource/locale/messages.ja.yaml b/src/Eccube/Resource/locale/messages.ja.yaml index ab805f6454d..cd75e4e916d 100644 --- a/src/Eccube/Resource/locale/messages.ja.yaml +++ b/src/Eccube/Resource/locale/messages.ja.yaml @@ -392,6 +392,8 @@ front.shopping.payment_method_unselected: お支払い方法を選択してく front.shopping.not_available_payment_method: 選択したお支払い方法はご利用できません。 front.shopping.payment_method_not_fount: 選択できるお支払い方法がありません。配送方法が異なる場合は同じ配送方法を選んでください。 front.under_maintenance: メンテナンスモードが有効になっています。 +front.under_debug_mode: デバッグモードが有効になっています。 + #==================================================================================== # 管理画面 @@ -503,6 +505,7 @@ admin.common.move_to_confirm_move_only: 保存せずに移動 admin.common.move_to_confirm_save_and_move: 保存して移動 admin.common.admin_url_warning: '管理画面URLは、セキュリティのため推測されにくいものを設定してください。「セキュリティ管理」から設定できます。' admin.common.restrict_file_upload_info: 'この機能の利用頻度が低い場合、使用しない間は無効化することでセキュリティを更に向上させることができます。環境変数 ECCUBE_RESTRICT_FILE_UPLOAD を 1 に設定することで機能を無効化することが可能です。' +admin.common.notice_debug_mode: 'デバッグモードが有効になっています。' # エンティティに関連するラベル diff --git a/src/Eccube/Resource/template/admin/default_frame.twig b/src/Eccube/Resource/template/admin/default_frame.twig index 57a99f01a11..0fcc24d7442 100644 --- a/src/Eccube/Resource/template/admin/default_frame.twig +++ b/src/Eccube/Resource/template/admin/default_frame.twig @@ -64,6 +64,7 @@ file that was distributed with this source code. {{ include('@admin/alert.twig') }} + {{ include('@admin/notice_debug_mode.twig') }} {% block main %}{% endblock %} diff --git a/src/Eccube/Resource/template/admin/notice_debug_mode.twig b/src/Eccube/Resource/template/admin/notice_debug_mode.twig new file mode 100644 index 00000000000..45b3aaf77e9 --- /dev/null +++ b/src/Eccube/Resource/template/admin/notice_debug_mode.twig @@ -0,0 +1,8 @@ +{% if isDebugMode %} + +{% endif %} \ No newline at end of file diff --git a/src/Eccube/Resource/template/default/default_frame.twig b/src/Eccube/Resource/template/default/default_frame.twig index e1278a0a695..6c9578c4756 100644 --- a/src/Eccube/Resource/template/default/default_frame.twig +++ b/src/Eccube/Resource/template/default/default_frame.twig @@ -68,6 +68,14 @@ file that was distributed with this source code. {% endif %} +{% if isDebugMode %} +
+
+
+ {{ 'front.under_debug_mode'|trans }} +
+
+{% endif %}
{# Layout: HEADER #}