Skip to content

Commit def3383

Browse files
committed
update
1 parent a8f55d2 commit def3383

7 files changed

Lines changed: 239 additions & 197 deletions

File tree

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
<body>
1717
<app-root></app-root>
1818
<noscript>Please enable JavaScript to continue using this application.</noscript>
19-
<link rel="modulepreload" href="chunk-STRJFKTR.js"><link rel="modulepreload" href="chunk-N57AJHA5.js"><script src="polyfills-S3KRBCMK.js" type="module"></script><script src="scripts-TSGU23AO.js" defer></script><script src="main-BGIZSMV6.js" type="module"></script></body>
19+
<link rel="modulepreload" href="chunk-STRJFKTR.js"><link rel="modulepreload" href="chunk-N57AJHA5.js"><script src="polyfills-S3KRBCMK.js" type="module"></script><script src="scripts-TSGU23AO.js" defer></script><script src="main-XHQE7XYA.js" type="module"></script></body>
2020
</html>
Lines changed: 151 additions & 151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/ngsw.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"configVersion": 1,
3-
"timestamp": 1767620886935,
3+
"timestamp": 1767792835003,
44
"index": "/index.html",
55
"assetGroups": [
66
{
@@ -17,7 +17,7 @@
1717
"/chunk-STRJFKTR.js",
1818
"/favicon.ico",
1919
"/index.html",
20-
"/main-BGIZSMV6.js",
20+
"/main-XHQE7XYA.js",
2121
"/manifest.webmanifest",
2222
"/polyfills-S3KRBCMK.js",
2323
"/scripts-TSGU23AO.js",
@@ -128,8 +128,8 @@
128128
"/chunk-N57AJHA5.js": "0596171feebf974cc1f5eeeef7f1e75616da8bca",
129129
"/chunk-STRJFKTR.js": "a432b82ef02c5031c77c0d1b08272efb06f7c3e4",
130130
"/favicon.ico": "22f6a4a3bcaafafb0254e0f2fa4ceb89e505e8b2",
131-
"/index.html": "0ce02bdd7e2e567823e3bf796edb656410de17fc",
132-
"/main-BGIZSMV6.js": "5b6a6b38427ec840a1522e7ee963c1fe4b9c3079",
131+
"/index.html": "52be8adff8808e1ef2e3404c3061b34ea2b4bf56",
132+
"/main-XHQE7XYA.js": "512e0a70b022556604022c73a6e408cefae4ae93",
133133
"/manifest.webmanifest": "0f6d8f1c753e9f503daf4cd303ebecc6b0b0a04b",
134134
"/polyfills-S3KRBCMK.js": "666124c1a3df4ed7eb66e54da096791013fab792",
135135
"/scripts-TSGU23AO.js": "e172440274ca0257fbf1b7e414f5bd41b03b202f",

src/app/accounts/accounts/accounts.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
.input-group {
4747
.input-group-text {
48-
background-color: #f8f9fa;
48+
background-color: var(--app-bg-secondary);
4949
border-right: 0;
5050
}
5151

src/app/accounts/accounts/accounts.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { AccountsService } from '../accounts.service';
44
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
55
import { Observable, Subject } from 'rxjs';
66
import { takeUntil, finalize } from 'rxjs/operators';
7+
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
8+
import { CollectionSessionsViewerModalComponent } from '../../components/collection-sessions-viewer-modal/collection-sessions-viewer-modal.component';
79

810
// Interfaces for type safety
911
interface CurtainLink {
@@ -78,7 +80,8 @@ export class AccountsComponent implements OnInit, OnDestroy {
7880
constructor(
7981
private readonly web: WebService,
8082
public readonly accounts: AccountsService,
81-
private readonly fb: FormBuilder
83+
private readonly fb: FormBuilder,
84+
private modal: NgbModal
8285
) {
8386
this.initializeForm();
8487
this.initializeUserData();
@@ -623,6 +626,7 @@ export class AccountsComponent implements OnInit, OnDestroy {
623626
}
624627

625628
viewCollectionSessions(collection: any): void {
626-
console.log('Viewing sessions for collection:', collection);
629+
const modalRef = this.modal.open(CollectionSessionsViewerModalComponent, { size: 'lg', scrollable: true });
630+
modalRef.componentInstance.collectionId = collection.id;
627631
}
628632
}

src/app/components/collection-management-modal/collection-management-modal.component.html

Lines changed: 66 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ <h6 class="mb-0">Your Collections</h6>
2828
<i class="bi bi-plus-circle me-1"></i>New Collection
2929
</button>
3030
</div>
31+
32+
<div class="btn-group w-100 mb-3" role="group" aria-label="Collection filter">
33+
<input type="radio" class="btn-check" name="filterMode" id="filterAll" autocomplete="off" [checked]="filterMode === 'all'" (change)="setFilterMode('all')">
34+
<label class="btn btn-outline-primary" for="filterAll">All Collections</label>
35+
36+
<input type="radio" class="btn-check" name="filterMode" id="filterContaining" autocomplete="off" [checked]="filterMode === 'containing'" (change)="setFilterMode('containing')">
37+
<label class="btn btn-outline-primary" for="filterContaining">In Collection</label>
38+
</div>
39+
3140
<div class="input-group">
3241
<span class="input-group-text"><i class="bi bi-search"></i></span>
3342
<input
@@ -42,47 +51,67 @@ <h6 class="mb-0">Your Collections</h6>
4251
</div>
4352

4453
@if (collections.length > 0) {
45-
<div class="list-group">
46-
@for (collection of collections; track collection.id) {
47-
<div class="list-group-item">
48-
<div class="d-flex justify-content-between align-items-start">
49-
<div class="flex-grow-1">
50-
<h6 class="mb-1">{{collection.name}}</h6>
51-
@if (collection.description) {
52-
<p class="mb-1 text-muted small">{{collection.description}}</p>
53-
}
54-
<div class="d-flex align-items-center gap-2 mt-2">
54+
<div class="table-responsive">
55+
<table class="table table-hover align-middle">
56+
<thead>
57+
<tr>
58+
<th scope="col">Name</th>
59+
<th scope="col">Description</th>
60+
<th scope="col" style="width: 120px;">Sessions</th>
61+
<th scope="col" style="width: 180px;">Last Updated</th>
62+
<th scope="col" style="width: 120px;">Actions</th>
63+
</tr>
64+
</thead>
65+
<tbody>
66+
@for (collection of collections; track collection.id) {
67+
<tr>
68+
<td>
69+
<strong>{{collection.name}}</strong>
70+
@if (isSessionInCollection(collection)) {
71+
<div class="mt-1">
72+
<span class="badge bg-success">
73+
<i class="bi bi-check-circle me-1"></i>In Collection
74+
</span>
75+
</div>
76+
}
77+
</td>
78+
<td>
79+
@if (collection.description) {
80+
<span class="text-muted">{{collection.description}}</span>
81+
} @else {
82+
<span class="text-muted fst-italic">No description</span>
83+
}
84+
</td>
85+
<td>
5586
<span class="badge bg-info text-dark">
56-
<i class="bi bi-collection me-1"></i>{{collection.curtain_count}} Sessions
87+
<i class="bi bi-collection me-1"></i>{{collection.curtain_count}}
5788
</span>
58-
@if (isSessionInCollection(collection)) {
59-
<span class="badge bg-success">
60-
<i class="bi bi-check-circle me-1"></i>In Collection
89+
</td>
90+
<td>
91+
<div class="text-muted small">
92+
<i class="bi bi-calendar3 me-1"></i>{{collection.updated | date:'short'}}
93+
</div>
94+
</td>
95+
<td>
96+
@if (isOwner(collection)) {
97+
<button
98+
class="btn btn-sm w-100"
99+
[ngClass]="isSessionInCollection(collection) ? 'btn-outline-danger' : 'btn-outline-primary'"
100+
(click)="toggleCollection(collection)"
101+
[disabled]="isLoading">
102+
<i class="bi" [ngClass]="isSessionInCollection(collection) ? 'bi-dash-circle' : 'bi-plus-circle'"></i>
103+
{{isSessionInCollection(collection) ? 'Remove' : 'Add'}}
104+
</button>
105+
} @else {
106+
<span class="badge bg-secondary w-100">
107+
<i class="bi bi-eye me-1"></i>View Only
61108
</span>
62109
}
63-
</div>
64-
</div>
65-
@if (isOwner(collection)) {
66-
<div class="ms-3">
67-
<button
68-
class="btn btn-sm"
69-
[ngClass]="isSessionInCollection(collection) ? 'btn-outline-danger' : 'btn-outline-primary'"
70-
(click)="toggleCollection(collection)"
71-
[disabled]="isLoading">
72-
<i class="bi" [ngClass]="isSessionInCollection(collection) ? 'bi-dash-circle' : 'bi-plus-circle'"></i>
73-
{{isSessionInCollection(collection) ? 'Remove' : 'Add'}}
74-
</button>
75-
</div>
76-
} @else {
77-
<div class="ms-3">
78-
<span class="badge bg-secondary">
79-
<i class="bi bi-eye me-1"></i>View Only
80-
</span>
81-
</div>
82-
}
83-
</div>
84-
</div>
85-
}
110+
</td>
111+
</tr>
112+
}
113+
</tbody>
114+
</table>
86115
</div>
87116
} @else {
88117
<div class="text-center py-5">

src/app/components/collection-management-modal/collection-management-modal.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class CollectionManagementModalComponent implements OnInit {
2727
collections: Collection[] = [];
2828
isLoading: boolean = false;
2929
searchQuery: string = '';
30+
filterMode: 'all' | 'containing' = 'all';
3031

3132
constructor(
3233
public activeModal: NgbActiveModal,
@@ -40,7 +41,8 @@ export class CollectionManagementModalComponent implements OnInit {
4041
async loadCollections(): Promise<void> {
4142
try {
4243
this.isLoading = true;
43-
const response = await this.accounts.getCollections(1, 10, this.searchQuery, true, this.linkId);
44+
const linkId = this.filterMode === 'containing' ? this.linkId : undefined;
45+
const response = await this.accounts.getCollections(1, 10, this.searchQuery, true, linkId);
4446
this.collections = response.results || [];
4547
} catch (error) {
4648
console.error('Failed to load collections:', error);
@@ -49,6 +51,13 @@ export class CollectionManagementModalComponent implements OnInit {
4951
}
5052
}
5153

54+
setFilterMode(mode: 'all' | 'containing'): void {
55+
if (this.filterMode !== mode) {
56+
this.filterMode = mode;
57+
this.loadCollections();
58+
}
59+
}
60+
5261
searchCollections(): void {
5362
this.loadCollections();
5463
}

0 commit comments

Comments
 (0)