Adds Underwriter's carousel and admin features
This commit is contained in:
@@ -37,6 +37,11 @@
|
||||
[class.active]="activeTab() === 'station'"
|
||||
(click)="activeTab.set('station')"
|
||||
>Station</button>
|
||||
<button
|
||||
class="tab-btn"
|
||||
[class.active]="activeTab() === 'underwriters'"
|
||||
(click)="activeTab.set('underwriters')"
|
||||
>Underwriters</button>
|
||||
</div>
|
||||
|
||||
<!-- Shows Tab -->
|
||||
@@ -299,6 +304,54 @@
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
<!-- Underwriters Tab -->
|
||||
@if (activeTab() === 'underwriters') {
|
||||
@if (underwriters$ | async; as underwriters) {
|
||||
<div class="tab-content">
|
||||
<div class="tab-toolbar">
|
||||
<h2>Underwriters ({{ underwriters.length }})</h2>
|
||||
<button class="btn btn-add" (click)="openUnderwriterForm()">+ Add Underwriter</button>
|
||||
</div>
|
||||
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Website</th>
|
||||
<th>Order</th>
|
||||
<th>Active</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (uw of underwriters; track uw.id) {
|
||||
<tr>
|
||||
<td>{{ uw.name }}</td>
|
||||
<td class="description-cell">{{ uw.description }}</td>
|
||||
<td>
|
||||
@if (uw.website_url) {
|
||||
<a [href]="uw.website_url" target="_blank" rel="noopener">{{ uw.website_url }}</a>
|
||||
} @else {
|
||||
—
|
||||
}
|
||||
</td>
|
||||
<td>{{ uw.display_order }}</td>
|
||||
<td>{{ uw.active ? 'Yes' : 'No' }}</td>
|
||||
<td class="actions">
|
||||
<button class="btn-icon btn-edit" (click)="editUnderwriter(uw)">Edit</button>
|
||||
<button class="btn-icon btn-delete" (click)="deleteUnderwriter(uw.id)">Delete</button>
|
||||
</td>
|
||||
</tr>
|
||||
} @empty {
|
||||
<tr><td colspan="6" class="empty-row">No underwriters yet. Click "Add Underwriter" to create one.</td></tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
<!-- Form modals -->
|
||||
@@ -320,4 +373,7 @@
|
||||
@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>
|
||||
Reference in New Issue
Block a user