Compare commits
4 Commits
1b0a6c86ff
...
personal-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05fcf86e32 | ||
| 8df736ae36 | |||
| 24caa148e1 | |||
|
|
03eaf6ab13 |
@@ -32,6 +32,7 @@ public class GroupController {
|
|||||||
.map(g -> new GroupResponse(
|
.map(g -> new GroupResponse(
|
||||||
g.getId(),
|
g.getId(),
|
||||||
g.getName(),
|
g.getName(),
|
||||||
|
g.getGroupSize(),
|
||||||
g.getEducationForm().getId(),
|
g.getEducationForm().getId(),
|
||||||
g.getEducationForm().getName()))
|
g.getEducationForm().getName()))
|
||||||
.toList();
|
.toList();
|
||||||
@@ -45,6 +46,9 @@ public class GroupController {
|
|||||||
if (groupRepository.findByName(request.getName().trim()).isPresent()) {
|
if (groupRepository.findByName(request.getName().trim()).isPresent()) {
|
||||||
return ResponseEntity.badRequest().body(Map.of("message", "Группа с таким названием уже существует"));
|
return ResponseEntity.badRequest().body(Map.of("message", "Группа с таким названием уже существует"));
|
||||||
}
|
}
|
||||||
|
if (request.getGroupSize() == null) {
|
||||||
|
return ResponseEntity.badRequest().body(Map.of("message", "Численность группы обязательна"));
|
||||||
|
}
|
||||||
if (request.getEducationFormId() == null) {
|
if (request.getEducationFormId() == null) {
|
||||||
return ResponseEntity.badRequest().body(Map.of("message", "Форма обучения обязательна"));
|
return ResponseEntity.badRequest().body(Map.of("message", "Форма обучения обязательна"));
|
||||||
}
|
}
|
||||||
@@ -56,12 +60,14 @@ public class GroupController {
|
|||||||
|
|
||||||
StudentGroup group = new StudentGroup();
|
StudentGroup group = new StudentGroup();
|
||||||
group.setName(request.getName().trim());
|
group.setName(request.getName().trim());
|
||||||
|
group.setGroupSize(request.getGroupSize());
|
||||||
group.setEducationForm(efOpt.get());
|
group.setEducationForm(efOpt.get());
|
||||||
groupRepository.save(group);
|
groupRepository.save(group);
|
||||||
|
|
||||||
return ResponseEntity.ok(new GroupResponse(
|
return ResponseEntity.ok(new GroupResponse(
|
||||||
group.getId(),
|
group.getId(),
|
||||||
group.getName(),
|
group.getName(),
|
||||||
|
group.getGroupSize(),
|
||||||
group.getEducationForm().getId(),
|
group.getEducationForm().getId(),
|
||||||
group.getEducationForm().getName()));
|
group.getEducationForm().getName()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.magistr.app.dto;
|
|||||||
public class CreateGroupRequest {
|
public class CreateGroupRequest {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
private Long groupSize;
|
||||||
private Long educationFormId;
|
private Long educationFormId;
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -13,6 +14,14 @@ public class CreateGroupRequest {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getGroupSize() {
|
||||||
|
return groupSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupSize(Long groupSize) {
|
||||||
|
this.groupSize = groupSize;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getEducationFormId() {
|
public Long getEducationFormId() {
|
||||||
return educationFormId;
|
return educationFormId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ public class GroupResponse {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
|
private Long groupSize;
|
||||||
private Long educationFormId;
|
private Long educationFormId;
|
||||||
private String educationFormName;
|
private String educationFormName;
|
||||||
|
|
||||||
public GroupResponse(Long id, String name, Long educationFormId, String educationFormName) {
|
public GroupResponse(Long id, String name, Long groupSize, Long educationFormId, String educationFormName) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.groupSize = groupSize;
|
||||||
this.educationFormId = educationFormId;
|
this.educationFormId = educationFormId;
|
||||||
this.educationFormName = educationFormName;
|
this.educationFormName = educationFormName;
|
||||||
}
|
}
|
||||||
@@ -22,6 +24,10 @@ public class GroupResponse {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getGroupSize() {
|
||||||
|
return groupSize;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getEducationFormId() {
|
public Long getEducationFormId() {
|
||||||
return educationFormId;
|
return educationFormId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public class StudentGroup {
|
|||||||
@Column(unique = true, nullable = false, length = 100)
|
@Column(unique = true, nullable = false, length = 100)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "group_size", nullable = false)
|
||||||
|
private Long groupSize;
|
||||||
|
|
||||||
@ManyToOne(optional = false)
|
@ManyToOne(optional = false)
|
||||||
@JoinColumn(name = "education_form_id", nullable = false)
|
@JoinColumn(name = "education_form_id", nullable = false)
|
||||||
private EducationForm educationForm;
|
private EducationForm educationForm;
|
||||||
@@ -36,6 +39,14 @@ public class StudentGroup {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getGroupSize() {
|
||||||
|
return groupSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupSize(Long groupSize) {
|
||||||
|
this.groupSize = groupSize;
|
||||||
|
}
|
||||||
|
|
||||||
public EducationForm getEducationForm() {
|
public EducationForm getEducationForm() {
|
||||||
return educationForm;
|
return educationForm;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,14 +43,16 @@ ON CONFLICT (name) DO NOTHING;
|
|||||||
CREATE TABLE IF NOT EXISTS student_groups (
|
CREATE TABLE IF NOT EXISTS student_groups (
|
||||||
id BIGSERIAL PRIMARY KEY,
|
id BIGSERIAL PRIMARY KEY,
|
||||||
name VARCHAR(100) UNIQUE NOT NULL,
|
name VARCHAR(100) UNIQUE NOT NULL,
|
||||||
|
group_size BIGINT NOT NULL,
|
||||||
education_form_id BIGINT NOT NULL REFERENCES education_forms(id),
|
education_form_id BIGINT NOT NULL REFERENCES education_forms(id),
|
||||||
course INT CHECK (course BETWEEN 1 AND 6),
|
course INT CHECK (course BETWEEN 1 AND 6),
|
||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Тестовая базовая группа для работы
|
-- Тестовая базовая группа для работы
|
||||||
INSERT INTO student_groups (name, education_form_id, course)
|
INSERT INTO student_groups (name, group_size, education_form_id, course)
|
||||||
VALUES ('ИВТ-21-1', 1, 3)
|
VALUES ('ИВТ-21-1', 25, 1, 3),
|
||||||
|
('ИБ-41м', 15, 2, 2)
|
||||||
ON CONFLICT (name) DO NOTHING;
|
ON CONFLICT (name) DO NOTHING;
|
||||||
|
|
||||||
-- ==========================================
|
-- ==========================================
|
||||||
|
|||||||
@@ -754,108 +754,3 @@ tbody tr:hover {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ===== Modal ===== */
|
|
||||||
.modal-overlay {
|
|
||||||
display: none;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
backdrop-filter: blur(4px);
|
|
||||||
z-index: 1000;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity var(--transition);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-overlay.open {
|
|
||||||
display: flex;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-content {
|
|
||||||
background: var(--bg-primary);
|
|
||||||
border: 1px solid var(--bg-card-border);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
padding: 2rem;
|
|
||||||
width: 90%;
|
|
||||||
max-width: 500px;
|
|
||||||
position: relative;
|
|
||||||
transform: scale(0.95);
|
|
||||||
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
||||||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-overlay.open .modal-content {
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-close {
|
|
||||||
position: absolute;
|
|
||||||
top: 1rem;
|
|
||||||
right: 1rem;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
font-size: 1.5rem;
|
|
||||||
color: var(--text-secondary);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: color var(--transition);
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-close:hover {
|
|
||||||
color: var(--error);
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-add-lesson {
|
|
||||||
padding: 0.35rem 0.7rem;
|
|
||||||
background: rgba(16, 185, 129, 0.1);
|
|
||||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
color: var(--success);
|
|
||||||
font-family: inherit;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background var(--transition), transform var(--transition);
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-add-lesson:hover {
|
|
||||||
background: rgba(16, 185, 129, 0.2);
|
|
||||||
transform: scale(1.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Кнопки-переключатели для недели */
|
|
||||||
.btn-checkbox {
|
|
||||||
display: inline-block;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-checkbox input {
|
|
||||||
position: absolute;
|
|
||||||
opacity: 0;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.checkbox-btn {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0.5rem 1rem;
|
|
||||||
background: var(--bg-secondary);
|
|
||||||
border: 1px solid var(--bg-card-border);
|
|
||||||
border-radius: var(--radius-sm);
|
|
||||||
color: var(--text-primary);
|
|
||||||
transition: all var(--transition);
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-checkbox input:checked+.checkbox-btn {
|
|
||||||
background: var(--success, #10b981);
|
|
||||||
/* используем success или зелёный */
|
|
||||||
border-color: var(--success, #10b981);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
418
frontend/admin/css/modals.css
Normal file
418
frontend/admin/css/modals.css
Normal file
@@ -0,0 +1,418 @@
|
|||||||
|
/* ===== Modal (общие стили) ===== */
|
||||||
|
.modal-overlay {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
/* bottom: 0; */
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
backdrop-filter: blur(4px);
|
||||||
|
|
||||||
|
z-index: 1000;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-overlay.open {
|
||||||
|
display: flex;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background: var(--bg-primary);
|
||||||
|
border: 1px solid var(--bg-card-border);
|
||||||
|
border-radius: var(--radius-md);
|
||||||
|
padding: 2rem;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
top: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
transform: scale(0.95);
|
||||||
|
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||||
|
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-overlay.open .modal-content {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-close {
|
||||||
|
position: absolute;
|
||||||
|
top: 1rem;
|
||||||
|
right: 1rem;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-close:hover {
|
||||||
|
color: var(--error);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Кнопки ===== */
|
||||||
|
.btn-add-lesson {
|
||||||
|
padding: 0.35rem 0.7rem;
|
||||||
|
background: rgba(16, 185, 129, 0.1);
|
||||||
|
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
color: var(--success);
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background var(--transition), transform var(--transition);
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-add-lesson:hover {
|
||||||
|
background: rgba(16, 185, 129, 0.2);
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-view-lessons {
|
||||||
|
padding: 0.35rem 0.7rem;
|
||||||
|
background: rgba(99, 102, 241, 0.1);
|
||||||
|
border: 1px solid rgba(99, 102, 241, 0.2);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
color: var(--accent);
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all var(--transition);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-view-lessons:hover {
|
||||||
|
background: rgba(99, 102, 241, 0.2);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Кнопки-переключатели (неделя) ===== */
|
||||||
|
.btn-checkbox {
|
||||||
|
display: inline-block;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-checkbox input {
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox-btn {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--bg-card-border);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
color: var(--text-primary);
|
||||||
|
transition: all var(--transition);
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-checkbox input:checked + .checkbox-btn {
|
||||||
|
background: var(--success, #10b981);
|
||||||
|
border-color: var(--success, #10b981);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===========================================================
|
||||||
|
===== 2-е модальное окно (View Lessons) — ОСНОВНЫЕ ПРАВКИ =====
|
||||||
|
Требования:
|
||||||
|
- слева
|
||||||
|
- ~30% ширины
|
||||||
|
- сверху начинается СРАЗУ под 1-й модалкой
|
||||||
|
- высота = весь остаток до низа экрана
|
||||||
|
- визуально "ниже" 1-й модалки (и по z-index тоже ниже)
|
||||||
|
=========================================================== */
|
||||||
|
|
||||||
|
#modal-view-lessons.modal-overlay {
|
||||||
|
background: transparent !important;
|
||||||
|
backdrop-filter: none !important;
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 999; /* ниже чем 1-е (1000) */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* В открытом состоянии: прижать влево и опустить вниз на высоту "шапки" */
|
||||||
|
#modal-view-lessons.modal-overlay.open {
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
|
||||||
|
/* ключевое: высота 1-й модалки приходит из JS через --add-lesson-height */
|
||||||
|
padding-top: var(--add-lesson-height, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Панель 2-й модалки */
|
||||||
|
#modal-view-lessons .view-lessons-modal {
|
||||||
|
width: 30vw !important;
|
||||||
|
max-width: 30vw !important;
|
||||||
|
min-width: 320px;
|
||||||
|
|
||||||
|
pointer-events: auto;
|
||||||
|
|
||||||
|
background: var(--bg-primary);
|
||||||
|
border: 1px solid var(--bg-card-border);
|
||||||
|
border-radius: var(--radius-md);
|
||||||
|
padding: 2rem;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
|
||||||
|
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
/* отключаем "пружинку" от .modal-content */
|
||||||
|
transform: none;
|
||||||
|
|
||||||
|
/* ключевое: занимает остаток по высоте */
|
||||||
|
height: calc(100vh - var(--add-lesson-height, 0px));
|
||||||
|
max-height: calc(100vh - var(--add-lesson-height, 0px));
|
||||||
|
|
||||||
|
/* чтобы скролл был внутри, а не у всей модалки */
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Header во 2-й модалке */
|
||||||
|
#modal-veiw-lessons .modal-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
padding-right: 2rem;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-view-lessons .modal-header h2 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.3rem;
|
||||||
|
color: var(--text-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Контейнер занятий: растягивается и скроллится */
|
||||||
|
#modal-view-lessons .lessons-container {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
/* перебиваем старое ограничение */
|
||||||
|
max-height: none;
|
||||||
|
|
||||||
|
padding-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Карточки занятий ===== */
|
||||||
|
.lesson-card {
|
||||||
|
background: var(--bg-card);
|
||||||
|
border: 1px solid var(--bg-card-border);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
padding: 1.2rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-card:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
|
||||||
|
border-color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 0.8rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
border-bottom: 1px dashed var(--bg-card-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-group {
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--accent);
|
||||||
|
font-size: 1rem;
|
||||||
|
background: rgba(99, 102, 241, 0.1);
|
||||||
|
padding: 0.3rem 0.8rem;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-time {
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-time::before {
|
||||||
|
content: "🕒";
|
||||||
|
font-size: 0.9rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-card-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-subject {
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 1.1rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-subject::before {
|
||||||
|
content: "📚";
|
||||||
|
font-size: 1rem;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-details {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.8rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-detail-item {
|
||||||
|
background: var(--bg-input);
|
||||||
|
padding: 0.3rem 0.8rem;
|
||||||
|
border-radius: 15px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
border: 1px solid var(--bg-card-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* День недели как разделитель */
|
||||||
|
.lesson-day-divider {
|
||||||
|
margin: 1.5rem 0 1rem 0;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--accent);
|
||||||
|
font-size: 1.1rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
border-bottom: 2px solid var(--accent-glow);
|
||||||
|
padding-bottom: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-day-divider:first-of-type {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Загрузка/пусто */
|
||||||
|
.loading-lessons,
|
||||||
|
.no-lessons {
|
||||||
|
text-align: center;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
padding: 3rem;
|
||||||
|
font-size: 1rem;
|
||||||
|
background: var(--bg-card);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Светлая тема */
|
||||||
|
[data-theme="light"] .lesson-card {
|
||||||
|
background: #fff;
|
||||||
|
border-color: rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-theme="light"] .lesson-group {
|
||||||
|
background: rgba(99, 102, 241, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Адаптивность ===== */
|
||||||
|
@media (max-width: 1200px) {
|
||||||
|
#modal-view-lessons .view-lessons-modal {
|
||||||
|
width: 40vw !important;
|
||||||
|
max-width: 40vw !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
/* На мобилке делаем поведение более "обычным" */
|
||||||
|
#modal-view-lessons.modal-overlay.open {
|
||||||
|
padding-top: 1rem;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-view-lessons .view-lessons-modal {
|
||||||
|
width: 90vw !important;
|
||||||
|
max-width: 90vw !important;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
/* чтобы занимало почти весь экран */
|
||||||
|
height: calc(100vh - 2rem);
|
||||||
|
max-height: calc(100vh - 2rem);
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson-card-header {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== Скролл во 2-й модалке ===== */
|
||||||
|
#modal-view-lessons .lessons-container {
|
||||||
|
scrollbar-width: thin; /* Firefox */
|
||||||
|
scrollbar-color: rgba(99, 102, 241, 0.55) rgba(255, 255, 255, 0.06); /* thumb track */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* WebKit (Chrome/Edge/Safari) */
|
||||||
|
#modal-view-lessons .lessons-container::-webkit-scrollbar {
|
||||||
|
width: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-view-lessons .lessons-container::-webkit-scrollbar-track {
|
||||||
|
background: rgba(255, 255, 255, 0.06);
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-view-lessons .lessons-container::-webkit-scrollbar-thumb {
|
||||||
|
background: rgba(99, 102, 241, 0.55); /* под accent */
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 2px solid rgba(0, 0, 0, 0); /* чтобы выглядел “тоньше” */
|
||||||
|
background-clip: padding-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-view-lessons .lessons-container::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: rgba(99, 102, 241, 0.75);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Общий блюр/затемнение за модалками */
|
||||||
|
#modal-backdrop{
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0,0,0,0.55);
|
||||||
|
backdrop-filter: blur(6px);
|
||||||
|
-webkit-backdrop-filter: blur(6px);
|
||||||
|
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
transition: opacity var(--transition);
|
||||||
|
z-index: 998; /* ниже модалок: 999 и 1000 */
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-backdrop.open{
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
<link rel="stylesheet" href="css/layout.css">
|
<link rel="stylesheet" href="css/layout.css">
|
||||||
<link rel="stylesheet" href="css/components.css">
|
<link rel="stylesheet" href="css/components.css">
|
||||||
|
<link rel="stylesheet" href="css/modals.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export async function initGroups() {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>${g.id}</td>
|
<td>${g.id}</td>
|
||||||
<td>${escapeHtml(g.name)}</td>
|
<td>${escapeHtml(g.name)}</td>
|
||||||
|
<td>${escapeHtml(g.groupSize)}</td>
|
||||||
<td><span class="badge badge-ef">${escapeHtml(g.educationFormName)}</span></td>
|
<td><span class="badge badge-ef">${escapeHtml(g.educationFormName)}</span></td>
|
||||||
<td><button class="btn-delete" data-id="${g.id}">Удалить</button></td>
|
<td><button class="btn-delete" data-id="${g.id}">Удалить</button></td>
|
||||||
</tr>`).join('');
|
</tr>`).join('');
|
||||||
@@ -77,13 +78,15 @@ export async function initGroups() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
hideAlert('create-group-alert');
|
hideAlert('create-group-alert');
|
||||||
const name = document.getElementById('new-group-name').value.trim();
|
const name = document.getElementById('new-group-name').value.trim();
|
||||||
|
const groupSize = document.getElementById('new-group-size').value;
|
||||||
const educationFormId = newGroupEfSelect.value;
|
const educationFormId = newGroupEfSelect.value;
|
||||||
|
|
||||||
if (!name) { showAlert('create-group-alert', 'Введите название группы', 'error'); return; }
|
if (!name) { showAlert('create-group-alert', 'Введите название группы', 'error'); return; }
|
||||||
|
if (!groupSize) { showAlert('create-group-alert', 'Введите размер группы', 'error'); return; }
|
||||||
if (!educationFormId) { showAlert('create-group-alert', 'Выберите форму обучения', 'error'); return; }
|
if (!educationFormId) { showAlert('create-group-alert', 'Выберите форму обучения', 'error'); return; }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await api.post('/api/groups', { name, educationFormId: Number(educationFormId) });
|
const data = await api.post('/api/groups', { name, groupSize, educationFormId: Number(educationFormId) });
|
||||||
showAlert('create-group-alert', `Группа "${escapeHtml(data.name)}" создана`, 'success');
|
showAlert('create-group-alert', `Группа "${escapeHtml(data.name)}" создана`, 'success');
|
||||||
createGroupForm.reset();
|
createGroupForm.reset();
|
||||||
loadGroups();
|
loadGroups();
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ const ROLE_BADGE = { ADMIN: 'badge-admin', TEACHER: 'badge-teacher', STUDENT: 'b
|
|||||||
export async function initUsers() {
|
export async function initUsers() {
|
||||||
const usersTbody = document.getElementById('users-tbody');
|
const usersTbody = document.getElementById('users-tbody');
|
||||||
const createForm = document.getElementById('create-form');
|
const createForm = document.getElementById('create-form');
|
||||||
|
const modalBackdrop = document.getElementById('modal-backdrop');
|
||||||
|
|
||||||
// Элементы модального окна добавления занятия
|
// ===== 1-е модальное окно: Добавить занятие =====
|
||||||
const modalAddLesson = document.getElementById('modal-add-lesson');
|
const modalAddLesson = document.getElementById('modal-add-lesson');
|
||||||
const modalAddLessonClose = document.getElementById('modal-add-lesson-close');
|
const modalAddLessonClose = document.getElementById('modal-add-lesson-close');
|
||||||
const addLessonForm = document.getElementById('add-lesson-form');
|
const addLessonForm = document.getElementById('add-lesson-form');
|
||||||
|
|
||||||
const lessonGroupSelect = document.getElementById('lesson-group');
|
const lessonGroupSelect = document.getElementById('lesson-group');
|
||||||
const lessonDisciplineSelect = document.getElementById('lesson-discipline');
|
const lessonDisciplineSelect = document.getElementById('lesson-discipline');
|
||||||
const lessonClassroomSelect = document.getElementById('lesson-classroom');
|
const lessonClassroomSelect = document.getElementById('lesson-classroom');
|
||||||
@@ -22,15 +24,21 @@ export async function initUsers() {
|
|||||||
const lessonDaySelect = document.getElementById('lesson-day');
|
const lessonDaySelect = document.getElementById('lesson-day');
|
||||||
const weekUpper = document.getElementById('week-upper');
|
const weekUpper = document.getElementById('week-upper');
|
||||||
const weekLower = document.getElementById('week-lower');
|
const weekLower = document.getElementById('week-lower');
|
||||||
// NEW: получаем элемент выбора времени
|
|
||||||
const lessonTimeSelect = document.getElementById('lesson-time');
|
const lessonTimeSelect = document.getElementById('lesson-time');
|
||||||
|
|
||||||
// Переменные для хранения загруженных данных
|
// ===== 2-е модальное окно: Просмотр занятий =====
|
||||||
|
const modalViewLessons = document.getElementById('modal-view-lessons');
|
||||||
|
const modalViewLessonsClose = document.getElementById('modal-view-lessons-close');
|
||||||
|
const lessonsContainer = document.getElementById('lessons-container');
|
||||||
|
const modalTeacherName = document.getElementById('modal-teacher-name');
|
||||||
|
|
||||||
|
let currentLessonsTeacherId = null;
|
||||||
|
let currentLessonsTeacherName = '';
|
||||||
|
// ===== Данные =====
|
||||||
let groups = [];
|
let groups = [];
|
||||||
let subjects = [];
|
let subjects = [];
|
||||||
let classrooms = [];
|
let classrooms = [];
|
||||||
|
|
||||||
// NEW: массивы с временными слотами
|
|
||||||
const weekdaysTimes = [
|
const weekdaysTimes = [
|
||||||
"8:00-9:30",
|
"8:00-9:30",
|
||||||
"9:40-11:10",
|
"9:40-11:10",
|
||||||
@@ -48,7 +56,39 @@ export async function initUsers() {
|
|||||||
"13:20-14:50"
|
"13:20-14:50"
|
||||||
];
|
];
|
||||||
|
|
||||||
// Загрузка групп с сервера
|
// =========================================================
|
||||||
|
// СИНХРОНИЗАЦИЯ ВЫСОТЫ 1-й МОДАЛКИ -> CSS переменная
|
||||||
|
// =========================================================
|
||||||
|
const addLessonContent = document.querySelector('#modal-add-lesson .modal-content');
|
||||||
|
|
||||||
|
function setAddLessonHeightVar(px) {
|
||||||
|
const h = Math.max(0, Math.ceil(px || 0));
|
||||||
|
document.documentElement.style.setProperty('--add-lesson-height', `${h}px`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncAddLessonHeight() {
|
||||||
|
if (!addLessonContent) return;
|
||||||
|
|
||||||
|
if (!modalAddLesson?.classList.contains('open')) {
|
||||||
|
// если первая модалка закрыта — "шапки" нет
|
||||||
|
setAddLessonHeightVar(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setAddLessonHeightVar(addLessonContent.getBoundingClientRect().height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Авто-обновление при любом изменении размеров первой модалки
|
||||||
|
if (addLessonContent && 'ResizeObserver' in window) {
|
||||||
|
const ro = new ResizeObserver(() => syncAddLessonHeight());
|
||||||
|
ro.observe(addLessonContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('resize', () => syncAddLessonHeight());
|
||||||
|
|
||||||
|
// =========================================================
|
||||||
|
// Загрузка справочников
|
||||||
|
// =========================================================
|
||||||
async function loadGroups() {
|
async function loadGroups() {
|
||||||
try {
|
try {
|
||||||
groups = await api.get('/api/groups');
|
groups = await api.get('/api/groups');
|
||||||
@@ -58,7 +98,6 @@ export async function initUsers() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Загрузка дисциплин
|
|
||||||
async function loadSubjects() {
|
async function loadSubjects() {
|
||||||
try {
|
try {
|
||||||
subjects = await api.get('/api/subjects');
|
subjects = await api.get('/api/subjects');
|
||||||
@@ -77,24 +116,59 @@ export async function initUsers() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Заполнение select группами
|
|
||||||
function renderGroupOptions() {
|
function renderGroupOptions() {
|
||||||
lessonGroupSelect.innerHTML = '<option value="">Выберите группу</option>' +
|
if (!groups || groups.length === 0) {
|
||||||
groups.map(g => `<option value="${g.id}">${escapeHtml(g.name)}</option>`).join('');
|
lessonGroupSelect.innerHTML = '<option value="">Нет доступных групп</option>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lessonGroupSelect.innerHTML =
|
||||||
|
'<option value="">Выберите группу</option>' +
|
||||||
|
groups.map(g => {
|
||||||
|
let optionText = escapeHtml(g.name);
|
||||||
|
if (g.groupSize) optionText += ` (численность: ${g.groupSize} чел.)`;
|
||||||
|
return `<option value="${g.id}">${optionText}</option>`;
|
||||||
|
}).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Заполнение select дисциплинами
|
|
||||||
function renderSubjectOptions() {
|
function renderSubjectOptions() {
|
||||||
lessonDisciplineSelect.innerHTML = '<option value="">Выберите дисциплину</option>' +
|
lessonDisciplineSelect.innerHTML =
|
||||||
|
'<option value="">Выберите дисциплину</option>' +
|
||||||
subjects.map(s => `<option value="${s.id}">${escapeHtml(s.name)}</option>`).join('');
|
subjects.map(s => `<option value="${s.id}">${escapeHtml(s.name)}</option>`).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderClassroomsOptions() {
|
function renderClassroomsOptions() {
|
||||||
lessonClassroomSelect.innerHTML = '<option value="">Выберите аудиторию</option>' +
|
if (!classrooms || classrooms.length === 0) {
|
||||||
classrooms.map(c => `<option value="${c.id}">${escapeHtml(c.name)}</option>`).join('');
|
lessonClassroomSelect.innerHTML = '<option value="">Нет доступных аудиторий</option>';
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEW: функция обновления списка времени в зависимости от дня
|
const selectedGroupId = lessonGroupSelect.value;
|
||||||
|
const selectedGroup = groups?.find(g => g.id == selectedGroupId);
|
||||||
|
const groupSize = selectedGroup?.groupSize || 0;
|
||||||
|
|
||||||
|
lessonClassroomSelect.innerHTML =
|
||||||
|
'<option value="">Выберите аудиторию</option>' +
|
||||||
|
classrooms.map(c => {
|
||||||
|
let optionText = escapeHtml(c.name);
|
||||||
|
|
||||||
|
if (c.capacity) optionText += ` (вместимость: ${c.capacity} чел.)`;
|
||||||
|
|
||||||
|
if (c.isAvailable === false) {
|
||||||
|
optionText += ` ❌ Занята`;
|
||||||
|
} else if (selectedGroupId && groupSize > 0 && c.capacity && groupSize > c.capacity) {
|
||||||
|
optionText += ` ⚠️ Недостаточно места`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<option value="${c.id}">${optionText}</option>`;
|
||||||
|
}).join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
lessonGroupSelect.addEventListener('change', function () {
|
||||||
|
renderClassroomsOptions();
|
||||||
|
requestAnimationFrame(() => syncAddLessonHeight());
|
||||||
|
});
|
||||||
|
|
||||||
function updateTimeOptions(dayValue) {
|
function updateTimeOptions(dayValue) {
|
||||||
let times = [];
|
let times = [];
|
||||||
if (dayValue === "Суббота") {
|
if (dayValue === "Суббота") {
|
||||||
@@ -107,17 +181,23 @@ export async function initUsers() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lessonTimeSelect.innerHTML = '<option value="">Выберите время</option>' +
|
lessonTimeSelect.innerHTML =
|
||||||
|
'<option value="">Выберите время</option>' +
|
||||||
times.map(t => `<option value="${t}">${t}</option>`).join('');
|
times.map(t => `<option value="${t}">${t}</option>`).join('');
|
||||||
lessonTimeSelect.disabled = false;
|
lessonTimeSelect.disabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// =========================================================
|
||||||
|
// Пользователи
|
||||||
|
// =========================================================
|
||||||
async function loadUsers() {
|
async function loadUsers() {
|
||||||
try {
|
try {
|
||||||
const users = await api.get('/api/users');
|
const users = await api.get('/api/users');
|
||||||
renderUsers(users);
|
renderUsers(users);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
usersTbody.innerHTML = '<tr><td colspan="4" class="loading-row">Ошибка загрузки: ' + escapeHtml(e.message) + '</td></tr>';
|
usersTbody.innerHTML =
|
||||||
|
'<tr><td colspan="4" class="loading-row">Ошибка загрузки: ' +
|
||||||
|
escapeHtml(e.message) + '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,40 +206,72 @@ export async function initUsers() {
|
|||||||
usersTbody.innerHTML = '<tr><td colspan="4" class="loading-row">Нет пользователей</td></tr>';
|
usersTbody.innerHTML = '<tr><td colspan="4" class="loading-row">Нет пользователей</td></tr>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
usersTbody.innerHTML = users.map(u => `
|
usersTbody.innerHTML = users.map(u => `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${u.id}</td>
|
<td>${u.id}</td>
|
||||||
<td>${escapeHtml(u.username)}</td>
|
<td>${escapeHtml(u.username)}</td>
|
||||||
<td><span class="badge ${ROLE_BADGE[u.role] || ''}">${ROLE_LABELS[u.role] || escapeHtml(u.role)}</span></td>
|
<td><span class="badge ${ROLE_BADGE[u.role] || ''}">${ROLE_LABELS[u.role] || escapeHtml(u.role)}</span></td>
|
||||||
<td><button class="btn-delete" data-id="${u.id}">Удалить</button></td>
|
<td>
|
||||||
<td><button class="btn-add-lesson" data-id="${u.id}">Добавить занятие</button></td>
|
<button class="btn-delete" data-id="${u.id}">Удалить</button>
|
||||||
</tr>`).join('');
|
</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn-add-lesson" data-id="${u.id}" data-name="${escapeHtml(u.username)}">Добавить занятие</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
`).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Сброс формы модального окна
|
function updateBackdrop() {
|
||||||
|
if(!modalBackdrop) return;
|
||||||
|
const anyOpen =
|
||||||
|
modalAddLesson?.classList.contains('open') ||
|
||||||
|
modalViewLessons?.classList.contains('open');
|
||||||
|
|
||||||
|
modalBackdrop.classList.toggle('open', anyOpen);
|
||||||
|
}
|
||||||
|
// Клик мимо модалок закроет их, если не надо, то закомментить этот код
|
||||||
|
modalBackdrop?.addEventListener('click', () => {
|
||||||
|
if (modalAddLesson?.classList.contains('open')) {
|
||||||
|
modalAddLesson.classList.remove('open');
|
||||||
|
resetLessonForm();
|
||||||
|
syncAddLessonHeight();
|
||||||
|
}
|
||||||
|
if (modalViewLessons?.classList.contains('open')) {
|
||||||
|
closeViewLessonsModal();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =========================================================
|
||||||
|
// 1-я модалка: добавление занятия
|
||||||
|
// =========================================================
|
||||||
function resetLessonForm() {
|
function resetLessonForm() {
|
||||||
addLessonForm.reset();
|
addLessonForm.reset();
|
||||||
lessonUserId.value = '';
|
lessonUserId.value = '';
|
||||||
|
|
||||||
if (weekUpper) weekUpper.checked = false;
|
if (weekUpper) weekUpper.checked = false;
|
||||||
if (weekLower) weekLower.checked = false;
|
if (weekLower) weekLower.checked = false;
|
||||||
// NEW: сбрасываем селект времени
|
|
||||||
if (lessonOfflineFormat) lessonOfflineFormat.checked = true;
|
if (lessonOfflineFormat) lessonOfflineFormat.checked = true;
|
||||||
if (lessonOnlineFormat) lessonOnlineFormat.checked = false;
|
if (lessonOnlineFormat) lessonOnlineFormat.checked = false;
|
||||||
|
|
||||||
lessonTimeSelect.innerHTML = '<option value="">Сначала выберите день</option>';
|
lessonTimeSelect.innerHTML = '<option value="">Сначала выберите день</option>';
|
||||||
lessonTimeSelect.disabled = true;
|
lessonTimeSelect.disabled = true;
|
||||||
|
|
||||||
hideAlert('add-lesson-alert');
|
hideAlert('add-lesson-alert');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Открытие модалки с установкой userId
|
|
||||||
function openAddLessonModal(userId) {
|
function openAddLessonModal(userId) {
|
||||||
lessonUserId.value = userId;
|
lessonUserId.value = userId;
|
||||||
// NEW: сбрасываем выбранный день и время
|
|
||||||
lessonDaySelect.value = '';
|
lessonDaySelect.value = '';
|
||||||
updateTimeOptions('');
|
updateTimeOptions('');
|
||||||
|
|
||||||
modalAddLesson.classList.add('open');
|
modalAddLesson.classList.add('open');
|
||||||
|
updateBackdrop();
|
||||||
|
requestAnimationFrame(() => syncAddLessonHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Обработчик отправки формы добавления занятия
|
|
||||||
addLessonForm.addEventListener('submit', async (e) => {
|
addLessonForm.addEventListener('submit', async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
hideAlert('add-lesson-alert');
|
hideAlert('add-lesson-alert');
|
||||||
@@ -170,48 +282,26 @@ export async function initUsers() {
|
|||||||
const classroomId = lessonClassroomSelect.value;
|
const classroomId = lessonClassroomSelect.value;
|
||||||
const lessonType = lessonTypeSelect.value;
|
const lessonType = lessonTypeSelect.value;
|
||||||
const dayOfWeek = lessonDaySelect.value;
|
const dayOfWeek = lessonDaySelect.value;
|
||||||
const timeSlot = lessonTimeSelect.value; // NEW: получаем выбранное время
|
const timeSlot = lessonTimeSelect.value;
|
||||||
|
|
||||||
const lessonFormat = document.querySelector('input[name="lessonFormat"]:checked')?.value;
|
const lessonFormat = document.querySelector('input[name="lessonFormat"]:checked')?.value;
|
||||||
|
|
||||||
// Проверка обязательных полей
|
if (!groupId) { showAlert('add-lesson-alert', 'Выберите группу', 'error'); requestAnimationFrame(() => syncAddLessonHeight()); return; }
|
||||||
if (!groupId) {
|
if (!subjectId) { showAlert('add-lesson-alert', 'Выберите дисциплину', 'error'); requestAnimationFrame(() => syncAddLessonHeight()); return; }
|
||||||
showAlert('add-lesson-alert', 'Выберите группу', 'error');
|
if (!classroomId) { showAlert('add-lesson-alert', 'Выберите аудиторию', 'error'); requestAnimationFrame(() => syncAddLessonHeight()); return; }
|
||||||
return;
|
if (!dayOfWeek) { showAlert('add-lesson-alert', 'Выберите день недели', 'error'); requestAnimationFrame(() => syncAddLessonHeight()); return; }
|
||||||
}
|
if (!timeSlot) { showAlert('add-lesson-alert', 'Выберите время', 'error'); requestAnimationFrame(() => syncAddLessonHeight()); return; }
|
||||||
if (!subjectId) {
|
|
||||||
showAlert('add-lesson-alert', 'Выберите дисциплину', 'error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!classroomId) {
|
|
||||||
showAlert('add-lesson-alert', 'Выберите аудиторию', 'error')
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!dayOfWeek) {
|
|
||||||
showAlert('add-lesson-alert', 'Выберите день недели', 'error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// NEW: проверка времени
|
|
||||||
if (!timeSlot) {
|
|
||||||
showAlert('add-lesson-alert', 'Выберите время', 'error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Определяем выбранный тип недели
|
|
||||||
const weekUpperChecked = weekUpper?.checked || false;
|
const weekUpperChecked = weekUpper?.checked || false;
|
||||||
const weekLowerChecked = weekLower?.checked || false;
|
const weekLowerChecked = weekLower?.checked || false;
|
||||||
|
|
||||||
let weekType = null;
|
let weekType = null;
|
||||||
if (weekUpperChecked && weekLowerChecked) {
|
if (weekUpperChecked && weekLowerChecked) weekType = 'Обе';
|
||||||
weekType = 'Обе';
|
else if (weekUpperChecked) weekType = 'Верхняя';
|
||||||
} else if (weekUpperChecked) {
|
else if (weekLowerChecked) weekType = 'Нижняя';
|
||||||
weekType = 'Верхняя';
|
|
||||||
} else if (weekLowerChecked) {
|
|
||||||
weekType = 'Нижняя';
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Отправляем данные на сервер
|
await api.post('/api/users/lessons/create', {
|
||||||
const response = await api.post('/api/users/lessons/create', {
|
|
||||||
teacherId: parseInt(userId),
|
teacherId: parseInt(userId),
|
||||||
groupId: parseInt(groupId),
|
groupId: parseInt(groupId),
|
||||||
subjectId: parseInt(subjectId),
|
subjectId: parseInt(subjectId),
|
||||||
@@ -220,37 +310,212 @@ export async function initUsers() {
|
|||||||
lessonFormat: lessonFormat,
|
lessonFormat: lessonFormat,
|
||||||
day: dayOfWeek,
|
day: dayOfWeek,
|
||||||
week: weekType,
|
week: weekType,
|
||||||
time: timeSlot // передаём время
|
time: timeSlot
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (modalViewLessons?.classList.contains('open') && currentLessonsTeacherId == userId) {
|
||||||
|
await loadTeacherLessons(currentLessonsTeacherId, currentLessonsTeacherName);
|
||||||
|
}
|
||||||
|
|
||||||
showAlert('add-lesson-alert', 'Занятие добавлено', 'success');
|
showAlert('add-lesson-alert', 'Занятие добавлено', 'success');
|
||||||
|
|
||||||
|
lessonGroupSelect.value = '';
|
||||||
|
lessonDisciplineSelect.value = '';
|
||||||
|
lessonClassroomSelect.value = '';
|
||||||
|
lessonTypeSelect.value = '';
|
||||||
|
lessonDaySelect.value = '';
|
||||||
|
lessonTimeSelect.value = '';
|
||||||
|
lessonTimeSelect.disabled = true;
|
||||||
|
|
||||||
|
weekUpper.checked = false;
|
||||||
|
weekLower.checked = false;
|
||||||
|
document.querySelector('input[name="lessonFormat"][value="Очно"]').checked = true;
|
||||||
|
|
||||||
|
requestAnimationFrame(() => syncAddLessonHeight());
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
modalAddLesson.classList.remove('open');
|
hideAlert('add-lesson-alert');
|
||||||
resetLessonForm();
|
syncAddLessonHeight();
|
||||||
}, 1500);
|
}, 3000);
|
||||||
} catch (e) {
|
} catch (err) {
|
||||||
showAlert('add-lesson-alert', e.message || 'Ошибка добавления занятия', 'error');
|
showAlert('add-lesson-alert', err.message || 'Ошибка добавления занятия', 'error');
|
||||||
|
requestAnimationFrame(() => syncAddLessonHeight());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
lessonDaySelect.addEventListener('change', function () {
|
||||||
|
updateTimeOptions(this.value);
|
||||||
|
requestAnimationFrame(() => syncAddLessonHeight());
|
||||||
|
});
|
||||||
|
|
||||||
|
if (modalAddLessonClose) {
|
||||||
|
modalAddLessonClose.addEventListener('click', () => {
|
||||||
|
modalAddLesson.classList.remove('open');
|
||||||
|
resetLessonForm();
|
||||||
|
syncAddLessonHeight();
|
||||||
|
updateBackdrop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modalAddLesson) {
|
||||||
|
modalAddLesson.addEventListener('click', (e) => {
|
||||||
|
if (e.target === modalAddLesson) {
|
||||||
|
modalAddLesson.classList.remove('open');
|
||||||
|
resetLessonForm();
|
||||||
|
syncAddLessonHeight();
|
||||||
|
updateBackdrop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// =========================================================
|
||||||
|
// Создание пользователя
|
||||||
|
// =========================================================
|
||||||
createForm.addEventListener('submit', async (e) => {
|
createForm.addEventListener('submit', async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
hideAlert('create-alert');
|
hideAlert('create-alert');
|
||||||
|
|
||||||
const username = document.getElementById('new-username').value.trim();
|
const username = document.getElementById('new-username').value.trim();
|
||||||
const password = document.getElementById('new-password').value;
|
const password = document.getElementById('new-password').value;
|
||||||
const role = document.getElementById('new-role').value;
|
const role = document.getElementById('new-role').value;
|
||||||
if (!username || !password) { showAlert('create-alert', 'Заполните все поля', 'error'); return; }
|
|
||||||
|
if (!username || !password) {
|
||||||
|
showAlert('create-alert', 'Заполните все поля', 'error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await api.post('/api/users', { username, password, role });
|
const data = await api.post('/api/users', { username, password, role });
|
||||||
showAlert('create-alert', `Пользователь "${escapeHtml(data.username)}" создан`, 'success');
|
showAlert('create-alert', `Пользователь "${escapeHtml(data.username)}" создан`, 'success');
|
||||||
createForm.reset();
|
createForm.reset();
|
||||||
loadUsers();
|
loadUsers();
|
||||||
} catch (e) {
|
} catch (err) {
|
||||||
showAlert('create-alert', e.message || 'Ошибка соединения', 'error');
|
showAlert('create-alert', err.message || 'Ошибка соединения', 'error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Обработчик кликов по таблице
|
// =========================================================
|
||||||
|
// Инициализация
|
||||||
|
// =========================================================
|
||||||
|
await Promise.all([loadUsers(), loadGroups(), loadSubjects(), loadClassrooms()]);
|
||||||
|
|
||||||
|
// =========================================================
|
||||||
|
// 2-я модалка: просмотр занятий
|
||||||
|
// =========================================================
|
||||||
|
async function loadTeacherLessons(teacherId, teacherName) {
|
||||||
|
try {
|
||||||
|
lessonsContainer.innerHTML = '<div class="loading-lessons">Загрузка занятий...</div>';
|
||||||
|
|
||||||
|
modalTeacherName.textContent = teacherName
|
||||||
|
? `Занятия преподавателя: ${teacherName}`
|
||||||
|
: 'Занятия преподавателя';
|
||||||
|
|
||||||
|
const lessons = await api.get(`/api/users/lessons/${teacherId}`);
|
||||||
|
|
||||||
|
if (!lessons || lessons.length === 0) {
|
||||||
|
lessonsContainer.innerHTML = '<div class="no-lessons">У преподавателя пока нет занятий</div>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const daysOrder = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'];
|
||||||
|
const lessonsByDay = {};
|
||||||
|
|
||||||
|
lessons.forEach(lesson => {
|
||||||
|
if (!lessonsByDay[lesson.day]) lessonsByDay[lesson.day] = [];
|
||||||
|
lessonsByDay[lesson.day].push(lesson);
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.keys(lessonsByDay).forEach(day => {
|
||||||
|
lessonsByDay[day].sort((a, b) => a.time.localeCompare(b.time));
|
||||||
|
});
|
||||||
|
|
||||||
|
let html = '';
|
||||||
|
|
||||||
|
daysOrder.forEach(day => {
|
||||||
|
if (!lessonsByDay[day]) return;
|
||||||
|
|
||||||
|
html += `<div class="lesson-day-divider">${day}</div>`;
|
||||||
|
|
||||||
|
lessonsByDay[day].forEach(lesson => {
|
||||||
|
html += `
|
||||||
|
<div class="lesson-card">
|
||||||
|
<div class="lesson-card-header">
|
||||||
|
<span class="lesson-group">${escapeHtml(lesson.groupName)}</span>
|
||||||
|
<span class="lesson-time">${escapeHtml(lesson.time)}</span>
|
||||||
|
</div>
|
||||||
|
<div class="lesson-card-body">
|
||||||
|
<div class="lesson-subject">${escapeHtml(lesson.subjectName)}</div>
|
||||||
|
<div class="lesson-details">
|
||||||
|
<span class="lesson-detail-item">${escapeHtml(lesson.typeLesson)}</span>
|
||||||
|
<span class="lesson-detail-item">${escapeHtml(lesson.lessonFormat)}</span>
|
||||||
|
<span class="lesson-detail-item">${escapeHtml(lesson.week)}</span>
|
||||||
|
<span class="lesson-detail-item">${escapeHtml(lesson.classroomName)}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
lessonsContainer.innerHTML = html;
|
||||||
|
} catch (e) {
|
||||||
|
lessonsContainer.innerHTML = `<div class="no-lessons">Ошибка загрузки: ${escapeHtml(e.message)}</div>`;
|
||||||
|
console.error('Ошибка загрузки занятий:', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openViewLessonsModal(teacherId, teacherName) {
|
||||||
|
currentLessonsTeacherId = teacherId;
|
||||||
|
currentLessonsTeacherName = teacherName || '';
|
||||||
|
|
||||||
|
loadTeacherLessons(teacherId, teacherName);
|
||||||
|
|
||||||
|
requestAnimationFrame(() => syncAddLessonHeight());
|
||||||
|
|
||||||
|
modalViewLessons.classList.add('open');
|
||||||
|
updateBackdrop();
|
||||||
|
// document.body.style.overflow = 'hidden';
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeViewLessonsModal() {
|
||||||
|
modalViewLessons.classList.remove('open');
|
||||||
|
updateBackdrop();
|
||||||
|
// document.body.style.overflow = '';
|
||||||
|
|
||||||
|
currentLessonsTeacherId = null;
|
||||||
|
currentLessonsTeacherName = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modalViewLessonsClose) {
|
||||||
|
modalViewLessonsClose.addEventListener('click', closeViewLessonsModal);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modalViewLessons) {
|
||||||
|
modalViewLessons.addEventListener('click', (e) => {
|
||||||
|
if (e.target === modalViewLessons) closeViewLessonsModal();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('keydown', (e) => {
|
||||||
|
if (e.key !== 'Escape') return;
|
||||||
|
|
||||||
|
if (modalAddLesson?.classList.contains('open')) {
|
||||||
|
modalAddLesson.classList.remove('open');
|
||||||
|
resetLessonForm();
|
||||||
|
syncAddLessonHeight();
|
||||||
|
updateBackdrop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modalViewLessons?.classList.contains('open')) {
|
||||||
|
closeViewLessonsModal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// =========================================================
|
||||||
|
// ЕДИНЫЙ обработчик кликов по таблице (ВАЖНО: без дубля)
|
||||||
|
// =========================================================
|
||||||
usersTbody.addEventListener('click', async (e) => {
|
usersTbody.addEventListener('click', async (e) => {
|
||||||
const deleteBtn = e.target.closest('.btn-delete');
|
const deleteBtn = e.target.closest('.btn-delete');
|
||||||
if (deleteBtn) {
|
if (deleteBtn) {
|
||||||
@@ -258,8 +523,8 @@ export async function initUsers() {
|
|||||||
try {
|
try {
|
||||||
await api.delete('/api/users/' + deleteBtn.dataset.id);
|
await api.delete('/api/users/' + deleteBtn.dataset.id);
|
||||||
loadUsers();
|
loadUsers();
|
||||||
} catch (e) {
|
} catch (err) {
|
||||||
alert(e.message || 'Ошибка удаления');
|
alert(err.message || 'Ошибка удаления');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -267,35 +532,23 @@ export async function initUsers() {
|
|||||||
const addLessonBtn = e.target.closest('.btn-add-lesson');
|
const addLessonBtn = e.target.closest('.btn-add-lesson');
|
||||||
if (addLessonBtn) {
|
if (addLessonBtn) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (modalAddLesson) {
|
|
||||||
openAddLessonModal(addLessonBtn.dataset.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// NEW: обработчик изменения дня недели для обновления списка времени
|
const teacherId = addLessonBtn.dataset.id;
|
||||||
lessonDaySelect.addEventListener('change', function() {
|
const teacherName = addLessonBtn.dataset.name;
|
||||||
updateTimeOptions(this.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Закрытие модалки по крестику
|
openAddLessonModal(teacherId);
|
||||||
if (modalAddLessonClose) {
|
openViewLessonsModal(teacherId, teacherName);
|
||||||
modalAddLessonClose.addEventListener('click', () => {
|
|
||||||
modalAddLesson.classList.remove('open');
|
return;
|
||||||
resetLessonForm();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Закрытие по клику на overlay
|
const viewLessonsBtn = e.target.closest('.btn-view-lessons');
|
||||||
if (modalAddLesson) {
|
if (viewLessonsBtn) {
|
||||||
modalAddLesson.addEventListener('click', (e) => {
|
e.preventDefault();
|
||||||
if (e.target === modalAddLesson) {
|
const teacherId = viewLessonsBtn.dataset.id;
|
||||||
modalAddLesson.classList.remove('open');
|
const teacherName = viewLessonsBtn.dataset.name;
|
||||||
resetLessonForm();
|
openViewLessonsModal(teacherId, teacherName);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// Загружаем все данные при инициализации
|
|
||||||
await Promise.all([loadUsers(), loadGroups(), loadSubjects(), loadClassrooms()]);
|
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,10 @@
|
|||||||
<label for="new-group-name">Название группы</label>
|
<label for="new-group-name">Название группы</label>
|
||||||
<input type="text" id="new-group-name" placeholder="ИВТ-21-1" required>
|
<input type="text" id="new-group-name" placeholder="ИВТ-21-1" required>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="new-group-size">Численность группы</label>
|
||||||
|
<input type="text" id="new-group-size" placeholder="20" required>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="new-group-ef">Форма обучения</label>
|
<label for="new-group-ef">Форма обучения</label>
|
||||||
<select id="new-group-ef">
|
<select id="new-group-ef">
|
||||||
@@ -35,6 +39,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Название</th>
|
<th>Название</th>
|
||||||
|
<th>Численность (чел.)</th>
|
||||||
<th>Форма обучения</th>
|
<th>Форма обучения</th>
|
||||||
<th>Действия</th>
|
<th>Действия</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -54,29 +54,35 @@
|
|||||||
<form id="add-lesson-form">
|
<form id="add-lesson-form">
|
||||||
<input type="hidden" id="lesson-user-id">
|
<input type="hidden" id="lesson-user-id">
|
||||||
|
|
||||||
<div class="form-group" style="margin-top: 1rem;">
|
<!-- Один общий ряд для всех элементов -->
|
||||||
|
<div class="form-row" style="align-items: flex-end; gap: 1rem; flex-wrap: wrap; width: 100%; justify-content: space-between;">
|
||||||
|
|
||||||
|
<!-- Группа -->
|
||||||
|
<div class="form-group" style="flex: 0 1 auto; max-width: 190px">
|
||||||
<label for="lesson-group">Группа</label>
|
<label for="lesson-group">Группа</label>
|
||||||
<select id="lesson-group" required>
|
<select id="lesson-group" required>
|
||||||
<option value="">Выберите группу</option>
|
<option value="">Выберите группу</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="margin-top: 1rem;">
|
<!-- Дисциплина -->
|
||||||
|
<div class="form-group" style="flex: 0 1 auto; max-width: 220px">
|
||||||
<label for="lesson-discipline">Дисциплина</label>
|
<label for="lesson-discipline">Дисциплина</label>
|
||||||
<select id="lesson-discipline" required>
|
<select id="lesson-discipline" required>
|
||||||
<option value="">Выберите дисциплину</option>
|
<option value="">Выберите дисциплину</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="margin-top: 1rem;">
|
<!-- Аудитория -->
|
||||||
|
<div class="form-group" style="flex: 0 1 auto; max-width: 215px">
|
||||||
<label for="lesson-classroom">Аудитория</label>
|
<label for="lesson-classroom">Аудитория</label>
|
||||||
<select id="lesson-classroom" required>
|
<select id="lesson-classroom" required>
|
||||||
<option value="">Выберите аудиторию</option>
|
<option value="">Выберите аудиторию</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row" style="margin-top: 1rem;">
|
<!-- День недели -->
|
||||||
<div class="form-group" style="flex: 1;">
|
<div class="form-group" style="flex: 0 1 auto; max-width: 170px">
|
||||||
<label for="lesson-day">День недели</label>
|
<label for="lesson-day">День недели</label>
|
||||||
<select id="lesson-day" required>
|
<select id="lesson-day" required>
|
||||||
<option value="">Выберите день</option>
|
<option value="">Выберите день</option>
|
||||||
@@ -88,9 +94,11 @@
|
|||||||
<option value="Суббота">Суббота</option>
|
<option value="Суббота">Суббота</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" style="flex: 1;">
|
|
||||||
|
<!-- Тип недели (ВЕРТИКАЛЬНО) -->
|
||||||
|
<div class="form-group" style="flex: 0 1 auto; max-width: 192px">
|
||||||
<label>Неделя</label>
|
<label>Неделя</label>
|
||||||
<div style="display: flex; gap: 0.5rem;">
|
<div style="display: flex; gap: 0.2rem;">
|
||||||
<label class="btn-checkbox">
|
<label class="btn-checkbox">
|
||||||
<input type="checkbox" name="weekType" value="Верхняя" id="week-upper">
|
<input type="checkbox" name="weekType" value="Верхняя" id="week-upper">
|
||||||
<span class="checkbox-btn">Верхняя</span>
|
<span class="checkbox-btn">Верхняя</span>
|
||||||
@@ -101,21 +109,22 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-row" style="margin-top: 1rem;">
|
<!-- Тип занятия -->
|
||||||
<div class="form-group" style="flex: 1;">
|
<div class="form-group" style="flex: 0 1 auto; max-width: 160px">
|
||||||
<label for="lesson-type">Тип занятия</label>
|
<label for="lesson-type">Тип занятия</label>
|
||||||
<select id="lesson-type" required>
|
<select id="lesson-type" required>
|
||||||
<option value="">Выберите тип занятия</option>
|
<option value="">Выберите тип</option>
|
||||||
<option value="Практическая работа">Практическая работа</option>
|
<option value="Практическая работа">Практическая</option>
|
||||||
<option value="Лекция">Лекция</option>
|
<option value="Лекция">Лекция</option>
|
||||||
<option value="Лабораторная работа">Лабораторная работа</option>
|
<option value="Лабораторная работа">Лабораторная</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" style="flex: 1;">
|
|
||||||
|
<!-- Формат занятия (ВЕРТИКАЛЬНО) -->
|
||||||
|
<div class="form-group" style="flex: 0 1 auto; max-width: 170px">
|
||||||
<label>Формат занятия</label>
|
<label>Формат занятия</label>
|
||||||
<div style="display: flex; gap: 0.5rem;">
|
<div style="display: flex; gap: 0.2rem;">
|
||||||
<label class="btn-checkbox">
|
<label class="btn-checkbox">
|
||||||
<input type="radio" name="lessonFormat" value="Очно" id="format-offline" checked>
|
<input type="radio" name="lessonFormat" value="Очно" id="format-offline" checked>
|
||||||
<span class="checkbox-btn">Очно</span>
|
<span class="checkbox-btn">Очно</span>
|
||||||
@@ -126,17 +135,38 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group" style="margin-top: 1rem;">
|
<!-- Время занятия -->
|
||||||
|
<div class="form-group" style="flex: 0 0 auto; max-width: 235px">
|
||||||
<label for="lesson-time">Время занятия</label>
|
<label for="lesson-time">Время занятия</label>
|
||||||
<select id="lesson-time" required disabled>
|
<select id="lesson-time" required disabled>
|
||||||
<option value="">Сначала выберите день</option>
|
<option value="">Сначала выберите день</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="btn-primary" style="width: 100%; margin-top: 1rem;">Сохранить</button>
|
<!-- Кнопка Сохранить (в том же ряду) -->
|
||||||
<div class="form-alert" id="add-lesson-alert" role="alert"></div>
|
<div class="form-group" style="flex: 0 0 auto;">
|
||||||
|
<button type="submit" class="btn-primary" style="white-space: nowrap;">Сохранить</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div> <!-- Закрытие form-row -->
|
||||||
|
|
||||||
|
<div class="form-alert" id="add-lesson-alert" role="alert" style="margin-top: 1rem;"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- View Teacher Lessons Modal -->
|
||||||
|
<div class="modal-overlay" id="modal-view-lessons">
|
||||||
|
<div class="modal-content view-lessons-modal">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h2 id="modal-teacher-name">Занятия преподавателя</h2>
|
||||||
|
<button class="modal-close" id="modal-view-lessons-close">×</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="lessons-container" id="lessons-container">
|
||||||
|
<!-- Фильтры по дням (добавим позже) -->
|
||||||
|
<div class="loading-lessons">Загрузка занятий...</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="modal-backdrop"></div>
|
||||||
Reference in New Issue
Block a user