Backend: - /api/admin/users: GET list, POST create, PUT update, DELETE - Admin users can be added with email, display name, and password - Self-deletion and last-admin deletion are blocked - Admin role auto-assigned on creation Frontend: - AdminUsersTabComponent: list + add/delete admin users - AdminUserService: HTTP client for admin user CRUD - AdminUser interface - 'Admins' tab added to admin dashboard Tests: - 10 new tests for admin user management endpoints - 140 total tests pass (130 original + 10 new)
106 lines
4.0 KiB
HTML
106 lines
4.0 KiB
HTML
<section class="admin-page">
|
|
<div class="container">
|
|
<div class="admin-header">
|
|
<h1>Admin Dashboard</h1>
|
|
<p>Manage shows, events, history, team, and community content</p>
|
|
</div>
|
|
|
|
<!-- Tabs -->
|
|
<div class="admin-tabs">
|
|
<button class="tab-btn" [class.active]="activeTab() === 'shows'" (click)="activeTab.set('shows')">Shows</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'events'" (click)="activeTab.set('events')">Events</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'history'" (click)="activeTab.set('history')">History</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'team'" (click)="activeTab.set('team')">Team</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'community'" (click)="activeTab.set('community')">Community</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'station'" (click)="activeTab.set('station')">Station</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'theme'" (click)="activeTab.set('theme')">Theme</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'underwriters'" (click)="activeTab.set('underwriters')">Underwriters</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'mobile-builds'" (click)="activeTab.set('mobile-builds')">Mobile Builds</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'stats'" (click)="activeTab.set('stats')">Stats</button>
|
|
<button class="tab-btn" [class.active]="activeTab() === 'admins'" (click)="activeTab.set('admins')">Admins</button>
|
|
</div>
|
|
|
|
<!-- Tab content -->
|
|
@if (activeTab() === 'shows') {
|
|
<app-admin-shows-tab
|
|
(openForm)="openShowForm()"
|
|
(editItem)="editShow($event)" />
|
|
}
|
|
|
|
@if (activeTab() === 'events') {
|
|
<app-admin-events-tab
|
|
(openForm)="openEventForm()"
|
|
(editItem)="editEvent($event)" />
|
|
}
|
|
|
|
@if (activeTab() === 'history') {
|
|
<app-admin-history-tab
|
|
(openForm)="openHistoryForm()"
|
|
(editItem)="editHistory($event)" />
|
|
}
|
|
|
|
@if (activeTab() === 'team') {
|
|
<app-admin-team-tab
|
|
(openForm)="openTeamForm()"
|
|
(editItem)="editTeam($event)" />
|
|
}
|
|
|
|
@if (activeTab() === 'community') {
|
|
<app-admin-community-tab
|
|
(openForm)="openCommunityForm()"
|
|
(editItem)="editCommunity($event)" />
|
|
}
|
|
|
|
@if (activeTab() === 'station') {
|
|
<app-admin-station-tab (openForm)="openStationForm()" />
|
|
}
|
|
|
|
@if (activeTab() === 'theme') {
|
|
<app-admin-theme-tab />
|
|
}
|
|
|
|
@if (activeTab() === 'underwriters') {
|
|
<app-admin-underwriters-tab
|
|
(openForm)="openUnderwriterForm()"
|
|
(editItem)="editUnderwriter($event)" />
|
|
}
|
|
|
|
@if (activeTab() === 'mobile-builds') {
|
|
<app-admin-mobile-builds-tab />
|
|
}
|
|
|
|
@if (activeTab() === 'stats') {
|
|
<div class="tab-content">
|
|
<app-admin-stats-dashboard />
|
|
</div>
|
|
}
|
|
|
|
@if (activeTab() === 'admins') {
|
|
<app-admin-users-tab />
|
|
}
|
|
</div>
|
|
|
|
<!-- Form modals -->
|
|
@if (showShowForm) {
|
|
<app-admin-show-form [editItem]="editingShow" (saved)="onShowSaved()" (closed)="onShowClosed()" />
|
|
}
|
|
@if (showEventForm) {
|
|
<app-admin-event-form [editItem]="editingEvent" (saved)="onEventSaved()" (closed)="onEventClosed()" />
|
|
}
|
|
@if (showStationForm) {
|
|
<app-admin-station-form [editItem]="stationConfig" (saved)="onStationSaved()" (closed)="onStationClosed()" />
|
|
}
|
|
@if (showHistoryForm) {
|
|
<app-admin-history-form [editItem]="editingHistory" (saved)="onHistorySaved()" (closed)="onHistoryClosed()" />
|
|
}
|
|
@if (showTeamForm) {
|
|
<app-admin-team-form [editItem]="editingTeam" (saved)="onTeamSaved()" (closed)="onTeamClosed()" />
|
|
}
|
|
@if (showCommunityForm) {
|
|
<app-admin-community-form [editItem]="editingCommunity" (saved)="onCommunitySaved()" (closed)="onCommunityClosed()" />
|
|
}
|
|
@if (showUnderwriterForm) {
|
|
<app-admin-underwriter-form [editItem]="editingUnderwriter" (saved)="onUnderwriterSaved()" (closed)="onUnderwriterClosed()" />
|
|
}
|
|
</section>
|