2025-03-11 23:50:50 +03:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="ru">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>Анонимные опросы</title>
|
2025-03-12 00:09:36 +03:00
|
|
|
|
<!-- Добавляем проверку на различные пути -->
|
|
|
|
|
<script>
|
|
|
|
|
// Определяем путь к статическим файлам с учетом prod и dev окружений
|
|
|
|
|
function getStaticPath() {
|
|
|
|
|
const pathname = window.location.pathname;
|
|
|
|
|
if (pathname.includes('/ms/questioneer')) {
|
|
|
|
|
// Для продакшна
|
|
|
|
|
return '/ms/questioneer/static';
|
|
|
|
|
} else {
|
|
|
|
|
// Для локальной разработки
|
|
|
|
|
// Если путь заканчивается на слеш или на /questioneer, добавляем /static
|
|
|
|
|
if (pathname.endsWith('/') || pathname.endsWith('/questioneer')) {
|
2025-03-12 00:37:32 +03:00
|
|
|
|
return pathname + '/static';
|
2025-03-12 00:09:36 +03:00
|
|
|
|
} else {
|
|
|
|
|
return pathname + '/static';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Динамически добавляем CSS
|
|
|
|
|
const cssLink = document.createElement('link');
|
|
|
|
|
cssLink.rel = 'stylesheet';
|
|
|
|
|
cssLink.href = getStaticPath() + '/css/style.css';
|
|
|
|
|
document.head.appendChild(cssLink);
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!-- Добавляем jQuery -->
|
|
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
// Динамически добавляем скрипты
|
|
|
|
|
const scriptPaths = [
|
|
|
|
|
'/js/common.js',
|
|
|
|
|
'/js/index.js'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const staticPath = getStaticPath();
|
|
|
|
|
scriptPaths.forEach(path => {
|
|
|
|
|
const script = document.createElement('script');
|
|
|
|
|
script.src = staticPath + path;
|
|
|
|
|
document.body.appendChild(script);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2025-03-11 23:50:50 +03:00
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<!-- Навигационная шапка -->
|
|
|
|
|
<header class="nav-header">
|
|
|
|
|
<div class="nav-container">
|
2025-03-12 09:12:09 +03:00
|
|
|
|
<a href="javascript:;" id="nav-home-link" class="nav-logo">Анонимные опросы</a>
|
2025-03-11 23:50:50 +03:00
|
|
|
|
<nav class="nav-menu">
|
2025-03-12 09:12:09 +03:00
|
|
|
|
<a href="javascript:;" id="nav-main-link" class="nav-link active">Главная</a>
|
|
|
|
|
<a href="javascript:;" id="nav-create-link" class="nav-link">Создать опрос</a>
|
2025-03-11 23:50:50 +03:00
|
|
|
|
</nav>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
|
<h1>Сервис анонимных опросов</h1>
|
|
|
|
|
|
|
|
|
|
<div class="main-buttons">
|
2025-03-12 09:12:09 +03:00
|
|
|
|
<a href="javascript:;" id="create-button" class="btn">Создать новый опрос</a>
|
2025-03-11 23:50:50 +03:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="questionnaires-list">
|
|
|
|
|
<h2>Ваши опросы</h2>
|
|
|
|
|
<div id="questionnaires-container">
|
|
|
|
|
<p>Загрузка опросов...</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-03-12 09:12:09 +03:00
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// Добавляем корректные пути к ссылкам после загрузки страницы
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
// Определяем базовый путь с учетом /ms в продакшен-версии
|
|
|
|
|
const isMsPath = window.location.pathname.includes('/ms/questioneer');
|
|
|
|
|
const basePath = isMsPath ? '/ms/questioneer' : '/questioneer';
|
|
|
|
|
|
|
|
|
|
// Устанавливаем правильные ссылки
|
|
|
|
|
document.getElementById('nav-home-link').href = basePath;
|
|
|
|
|
document.getElementById('nav-main-link').href = basePath;
|
|
|
|
|
document.getElementById('nav-create-link').href = basePath + '/create';
|
|
|
|
|
document.getElementById('create-button').href = basePath + '/create';
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2025-03-11 23:50:50 +03:00
|
|
|
|
</body>
|
|
|
|
|
</html>
|