feat: мультироль
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 9s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 2m6s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 26s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s

This commit is contained in:
2026-05-11 21:29:16 +03:00
parent 3b0bbfc858
commit 6824d7ce7d
29 changed files with 1350 additions and 95 deletions
+6 -16
View File
@@ -21,13 +21,6 @@ const roleLabels: Record<string, string> = {
const unreadCount = computed(() => userStore.unreadCount())
function switchRole() {
auth.switchRole()
if (auth.user?.role === 'teacher') router.push('/teacher')
else if (auth.user?.role === 'admin') router.push('/admin')
else router.push('/')
}
function openProfile() {
router.push('/profile')
}
@@ -47,9 +40,9 @@ function openProfile() {
<div class="topbar-right">
<CoinChip v-if="auth.user" :amount="auth.user.coins" />
<button class="role-btn" @click="switchRole" v-if="auth.user">
{{ roleLabels[auth.user.role] }}
</button>
<span class="role-chip" v-if="auth.user">
{{ roleLabels[auth.user.activeRole] }}
</span>
<button class="notif-btn" @click="$router.push('/notifications')">
<AppIcon icon="bell" :size="18" />
@@ -115,19 +108,16 @@ function openProfile() {
gap: 12px;
flex-shrink: 0;
}
.role-btn {
.role-chip {
background: rgba(34,197,94,0.12);
border: 1px solid rgba(34,197,94,0.3);
border-radius: var(--radius-sm);
padding: 5px 10px;
font-size: 12px;
font-weight: 600;
color: var(--color-primary-dark);
cursor: pointer;
transition: all 0.2s;
color: var(--color-primary-dark);
white-space: nowrap;
}
.role-btn:hover { background: rgba(34,197,94,0.2); }
.notif-btn {
position: relative;
background: none;
@@ -173,6 +163,6 @@ function openProfile() {
.topbar-center { display: none; }
.brand-name { display: none; }
.avatar-name { display: none; }
.role-btn { display: none; }
.role-chip { display: none; }
}
</style>