feat: добавил ограничение записи на лекции
Backend CI / build-and-test (push) Failing after 32s
Frontend CI / build-and-check (push) Failing after 5m5s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 1m28s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 19s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Has been skipped

This commit is contained in:
serega404 committed 2026-05-21 19:34:08 +03:00
1 parent 32b8bdfd24
commit 2e7ce6c2e8
21 files changed
+569 -23

No files matched your search

@@ -17,6 +17,11 @@ const isCoinDialogOpen = ref(false)
const profileMenuRef = ref<HTMLElement | null>(null)
const unreadCount = computed(() => userStore.unreadCount())
const enrollmentSlotText = computed(() => {
if (auth.user?.activeRole !== 'student') return ''
if (typeof auth.user.enrollmentSlotLimit !== 'number') return ''
return `${auth.user.activeEnrollments ?? 0}/${auth.user.enrollmentSlotLimit}`
})
const roleLabels: Record<UserRole, string> = {
student: 'Студент',
teacher: 'Преподаватель',
@@ -85,6 +90,7 @@ function handleDocumentPointerDown(event: PointerEvent) {
onMounted(() => {
document.addEventListener('pointerdown', handleDocumentPointerDown)
if (auth.user?.roles.includes('student')) void userStore.fetchStats().catch(() => undefined)
})
onBeforeUnmount(() => {
@@ -115,6 +121,11 @@ onBeforeUnmount(() => {
<span class="level-value">{{ auth.user.level }}</span>
</div>
<div v-if="enrollmentSlotText" class="slot-chip" title="Занятые слоты записи / доступные слоты">
<AppIcon class="slot-icon" icon="calendar" :size="15" />
<span class="slot-value">{{ enrollmentSlotText }}</span>
</div>
<button class="notif-btn" type="button" aria-label="Уведомления" @click="$router.push('/notifications')">
<AppIcon icon="bell" :size="18" />
<span class="notif-dot" v-if="auth.user && unreadCount > 0">
@@ -277,6 +288,26 @@ onBeforeUnmount(() => {
font-size: 14px;
font-weight: 800;
}
.slot-chip {
display: inline-flex;
align-items: center;
gap: 6px;
height: 28px;
padding: 0 10px;
border: 1px solid var(--color-primary-a20);
border-radius: 20px;
background: var(--color-primary-a10);
color: var(--color-success-text);
cursor: default;
white-space: nowrap;
}
.slot-icon {
color: var(--color-primary);
}
.slot-value {
font-size: 13px;
font-weight: 800;
}
.notif-btn {
position: relative;
display: inline-flex;