beta 2.3
This commit is contained in:
@@ -28,6 +28,7 @@ def updateUsersBirthdate() -> bool:
|
|||||||
continue
|
continue
|
||||||
userDict = {
|
userDict = {
|
||||||
"id": int(user["id"]),
|
"id": int(user["id"]),
|
||||||
|
"enabled": user["status"] == "active",
|
||||||
"name": f"{user['surname']} {user['name']} {user['secondName']}",
|
"name": f"{user['surname']} {user['name']} {user['secondName']}",
|
||||||
"short_name": f"{user['surname']} {user['name'][:1]}. {user['secondName'][:1]}.",
|
"short_name": f"{user['surname']} {user['name'][:1]}. {user['secondName'][:1]}.",
|
||||||
"sex": user["sex"],
|
"sex": user["sex"],
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
/* Таблица сотрудников */
|
/* Таблица сотрудников */
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
max-height: 600px;
|
max-height: 800px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ function renderUsersTable() {
|
|||||||
`;
|
`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
document.getElementById('usersCount').textContent = usersData.length;
|
||||||
|
|
||||||
// Сортируем по дате рождения (месяц и день)
|
// Сортируем по дате рождения (месяц и день)
|
||||||
usersData.sort((a, b) => {
|
usersData.sort((a, b) => {
|
||||||
@@ -85,7 +86,8 @@ function renderUsersTable() {
|
|||||||
const fullDate = birthdate.toLocaleDateString('ru-RU');
|
const fullDate = birthdate.toLocaleDateString('ru-RU');
|
||||||
|
|
||||||
// Форматируем месяц и день (двузначные)
|
// Форматируем месяц и день (двузначные)
|
||||||
const monthStr = month.toString().padStart(2, '0');
|
const monthNames = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'];
|
||||||
|
const monthStr = monthNames[month - 1];
|
||||||
const dayStr = day.toString().padStart(2, '0');
|
const dayStr = day.toString().padStart(2, '0');
|
||||||
|
|
||||||
// Определяем пол
|
// Определяем пол
|
||||||
@@ -119,7 +121,7 @@ function renderUsersTable() {
|
|||||||
<tr class="${isSelected}" onclick="selectUser(${user.id})" data-user-id="${user.id}">
|
<tr class="${isSelected}" onclick="selectUser(${user.id})" data-user-id="${user.id}">
|
||||||
<td>
|
<td>
|
||||||
<div class="birthdate-cell">
|
<div class="birthdate-cell">
|
||||||
<span class="month-day">${monthStr}.${dayStr}</span>
|
<span class="month-day">${dayStr} ${monthStr}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -132,10 +134,7 @@ function renderUsersTable() {
|
|||||||
</td>
|
</td>
|
||||||
<td>${sexBadge}</td>
|
<td>${sexBadge}</td>
|
||||||
<td>${specialtiesHtml}</td>
|
<td>${specialtiesHtml}</td>
|
||||||
<td class="text-center">${enabledStatus}</td>
|
<td class="text-center">${enabledStatus} ${dataStatus}</td>
|
||||||
<td class="text-center">
|
|
||||||
<div class="icon-group">${dataStatus}</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<div class="col-lg-7">
|
<div class="col-lg-7">
|
||||||
<div class="card h-100">
|
<div class="card h-100">
|
||||||
<div class="card-header d-flex justify-content-between align-items-center">
|
<div class="card-header d-flex justify-content-between align-items-center">
|
||||||
<h5 class="mb-0"><i class="bi bi-people-fill me-2"></i>Сотрудники</h5>
|
<h5 class="mb-0"><i class="bi bi-people-fill me-2"></i>Сотрудники (<span id="usersCount">0</span>)</h5>
|
||||||
<button type="button" class="btn btn-sm btn-outline-primary" onclick="refreshUsersList()">
|
<button type="button" class="btn btn-sm btn-outline-primary" onclick="refreshUsersList()">
|
||||||
<i class="bi bi-arrow-clockwise me-1"></i>Обновить список
|
<i class="bi bi-arrow-clockwise me-1"></i>Обновить список
|
||||||
</button>
|
</button>
|
||||||
@@ -41,7 +41,6 @@
|
|||||||
<th>Пол</th>
|
<th>Пол</th>
|
||||||
<th>Специальности</th>
|
<th>Специальности</th>
|
||||||
<th width="100" class="text-center">Статус</th>
|
<th width="100" class="text-center">Статус</th>
|
||||||
<th width="80" class="text-center">Данные</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="usersTableBody">
|
<tbody id="usersTableBody">
|
||||||
@@ -61,13 +60,13 @@
|
|||||||
<div class="row g-2">
|
<div class="row g-2">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<button type="button" class="btn btn-sm btn-outline-success w-100" onclick="enableAllUsers()">
|
<button type="button" class="btn btn-sm btn-outline-success w-100" onclick="enableAllUsers()">
|
||||||
<i class="bi bi-check-circle me-1"></i>Включить всех
|
<i class="bi bi-check-circle me-1"></i>Поздравлять всех
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<button type="button" class="btn btn-sm btn-outline-secondary w-100"
|
<button type="button" class="btn btn-sm btn-outline-secondary w-100"
|
||||||
onclick="disableAllUsers()">
|
onclick="disableAllUsers()">
|
||||||
<i class="bi bi-x-circle me-1"></i>Отключить всех
|
<i class="bi bi-x-circle me-1"></i>Не поздравлять никого
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user