From f91f821f86d0473e728175df00794267011427d5 Mon Sep 17 00:00:00 2001 From: Primakov Alexandr Alexandrovich Date: Wed, 12 Mar 2025 09:12:09 +0300 Subject: [PATCH] fix navigation elements --- server/routers/questioneer/public/admin.html | 20 ++++++++++++--- server/routers/questioneer/public/create.html | 25 +++++++++++++++++++ server/routers/questioneer/public/edit.html | 25 +++++++++++++++++++ server/routers/questioneer/public/index.html | 23 ++++++++++++++--- server/routers/questioneer/public/poll.html | 19 ++++++++++++++ .../questioneer/public/static/js/admin.js | 15 ++++++++++- 6 files changed, 119 insertions(+), 8 deletions(-) diff --git a/server/routers/questioneer/public/admin.html b/server/routers/questioneer/public/admin.html index 57aa8de..8905b49 100644 --- a/server/routers/questioneer/public/admin.html +++ b/server/routers/questioneer/public/admin.html @@ -50,10 +50,10 @@ @@ -99,5 +99,19 @@ + + \ No newline at end of file diff --git a/server/routers/questioneer/public/create.html b/server/routers/questioneer/public/create.html index 51942ab..41e49d2 100644 --- a/server/routers/questioneer/public/create.html +++ b/server/routers/questioneer/public/create.html @@ -46,6 +46,17 @@ + + +

Создание нового опроса

@@ -158,5 +169,19 @@
+ + \ No newline at end of file diff --git a/server/routers/questioneer/public/edit.html b/server/routers/questioneer/public/edit.html index 77b92b3..02c9485 100644 --- a/server/routers/questioneer/public/edit.html +++ b/server/routers/questioneer/public/edit.html @@ -47,6 +47,17 @@ + + +

Редактирование опроса

@@ -175,5 +186,19 @@
+ + \ No newline at end of file diff --git a/server/routers/questioneer/public/index.html b/server/routers/questioneer/public/index.html index 481e578..db72bec 100644 --- a/server/routers/questioneer/public/index.html +++ b/server/routers/questioneer/public/index.html @@ -53,10 +53,10 @@ @@ -65,7 +65,7 @@

Сервис анонимных опросов

- Создать новый опрос + Создать новый опрос
@@ -75,5 +75,20 @@
+ + \ No newline at end of file diff --git a/server/routers/questioneer/public/poll.html b/server/routers/questioneer/public/poll.html index 8d9807a..dc2f0ee 100644 --- a/server/routers/questioneer/public/poll.html +++ b/server/routers/questioneer/public/poll.html @@ -46,6 +46,13 @@ + + +
Загрузка опроса...
@@ -74,5 +81,17 @@
+ + \ No newline at end of file diff --git a/server/routers/questioneer/public/static/js/admin.js b/server/routers/questioneer/public/static/js/admin.js index 7d09522..ba55dc9 100644 --- a/server/routers/questioneer/public/static/js/admin.js +++ b/server/routers/questioneer/public/static/js/admin.js @@ -431,7 +431,20 @@ $(document).ready(function() { success: function(result) { if (result.success) { showAlert('Опрос успешно удален', 'Удаление опроса', function() { - window.location.href = window.location.pathname.split('/admin')[0]; + // Получаем базовый путь с учетом /ms в продакшен-версии + const isMsPath = window.location.pathname.includes('/ms/questioneer'); + let basePath; + + if (isMsPath) { + // Для продакшна: используем /ms/questioneer + basePath = '/ms/questioneer'; + } else { + // Для локальной разработки: используем текущий путь + basePath = window.location.pathname.split('/admin')[0]; + } + + // Перенаправляем на главную страницу + window.location.href = basePath; }, true); } else { showAlert(`Ошибка при удалении опроса: ${result.error}`, 'Ошибка');