@@ -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 ">
0 commit comments