Refactoring and cleanup codebase (50%...)

MVP dashboard users page
This commit is contained in:
2025-03-17 15:30:58 +05:00
parent 20465600b1
commit 9e2560f7c3
32 changed files with 937 additions and 423 deletions
+60 -33
View File
@@ -1,37 +1,64 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Сотрудники</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/users.css') }}">
<script src="{{ url_for('static', filename='js/jquery-3.6.0.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/users.js') }}"></script>
</head>
<body>
<div class="container mt-4">
<div class="row">
<div class="col-md-4">
<ul id="user-list" class="list-group">
<!-- Список сотрудников будет вставлен сюда -->
</ul>
</div>
<div class="col-md-8">
<div id="user-info" class="d-none">
<h3 id="user-name"></h3>
<h5>Подписки на регионы</h5>
<ul id="user-regions" class="list-group">
<!-- Подписки на регионы будут вставлены сюда -->
</ul>
<h5>Действия</h5>
<div id="user-events" class="overflow-auto" style="max-height: 300px;">
<!-- Действия будут вставлены сюда -->
</div>
{% extends 'base.html' %}
{% block content %}
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='css/users.css') }}">
<title>Пользователи</title>
</head>
<div class="container">
<h1>Пользователи</h1>
<!-- Таблица пользователей -->
<table class="table" id="users-table">
<thead>
<tr>
<th>Chat ID</th>
<th>Telegram ID</th>
<th>Email</th>
<th>Подписки</th>
<th>Тип уведомлений</th>
<th>Статус</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
<!-- Данные будут загружаться сюда динамически -->
</tbody>
</table>
<!-- Пагинация -->
<nav>
<ul class="pagination" id="pagination">
<!-- Страницы будут генерироваться динамически -->
</ul>
</nav>
</div>
<!-- Модальное окно -->
<div id="userModal" class="modal fade" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="userModalLabel">Редактирование пользователя</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Chat ID: <span id="userId"></span></p>
<p>Telegram ID: <span id="username"></span></p>
<p>Email: <span id="userEmail"></span></p>
</div>
<div class="modal-footer">
<button id="toggleBlockUser" class="btn btn-warning">Заблокировать</button>
<button id="viewUserEvents" class="btn btn-info">Посмотреть действия</button>
<button id="deleteUser" class="btn btn-danger">Удалить</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
</div>
</div>
</div>
</div>
</body>
</html>
<!-- Подключаем внешний JavaScript файл -->
<script src="{{ url_for('static', filename='js/users.js') }}"></script>
{% endblock %}