aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/cupboard/cupboard.component.html
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-04-03 19:48:54 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-04-03 19:48:54 -0400
commitad651c44ce2515d497c8e5214147c69126e25903 (patch)
tree3696cd84c1a1c3f105b09c1426ba13df4940f9a0 /ufund-ui/src/app/components/cupboard/cupboard.component.html
parent3cb145756351abd152acbcb5cabbf223fddf22bb (diff)
downloadJellySolutions-ad651c44ce2515d497c8e5214147c69126e25903.tar.gz
JellySolutions-ad651c44ce2515d497c8e5214147c69126e25903.tar.bz2
JellySolutions-ad651c44ce2515d497c8e5214147c69126e25903.zip
abstraction working with search and sort
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.html')
-rw-r--r--ufund-ui/src/app/components/cupboard/cupboard.component.html16
1 files changed, 8 insertions, 8 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html
index bdc8a0e..969b232 100644
--- a/ufund-ui/src/app/components/cupboard/cupboard.component.html
+++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html
@@ -14,23 +14,23 @@
<div id="sortArea">
<label for="sort">Sort by: </label>
<select id='sort' [(ngModel)] = "currentSortAlgo" class="wide-input" (change)="search(searchForm.value)" [value]="currentSortAlgo">
- <option *ngFor="let algorithm of Object.values(SortingAlgoArrays)" value="{{algorithm}}">
- {{algorithm.display[sortMode === 'Ascending' ? 0 : 1]}}
+ <option *ngFor="let algorithm of Object.keys(SortingAlgorithms)" [value]="algorithm">
+ {{SortingAlgorithms[algorithm].display[sortMode === 'Ascending' ? 0 : 1]}}
</option>
</select>
- <button (click)="changeSortMode(searchForm.value)">
+ <button (click)="toggleSortMode(searchForm.value)">
<span class="icon">{{sortMode === 'Ascending' ? 'arrow_upward': 'arrow_downward'}}</span>
</button>
<label>Needs per page: </label>
-<!-- <input type ="number" [(ngModel)]="itemsPerPage" min="1" max="{{searchResults.length}}">-->
+ <input type ="number" [(ngModel)]="itemsPerPage" min="1" max="{{searchResults.length}}">
</div>
<!--<button (click)="close()">Close</button>-->
</div>
- <h2 *ngIf="(searchResults | async)?.length < needs.length && (searchResults | async)?.length != 0"> Search Results({{needs.length - (searchResults | async)?.length}} needs filtered): </h2>
- <h2 *ngIf="(searchResults | async)?.length == needs.length"> All Needs </h2>
- <h2 *ngIf="(searchResults | async)?.length == 0"> No Results Found </h2>
+ <h2 *ngIf="searchResults.length < needs.length && searchResults.length != 0"> Search Results({{needs.length - searchResults.length}} needs filtered): </h2>
+ <h2 *ngIf="searchResults.length == needs.length"> All Needs </h2>
+ <h2 *ngIf="searchResults.length == 0"> No Results Found </h2>
- <app-need-list [needs]="searchResults" #needList></app-need-list>
+ <app-need-list *ngIf="searchResults.length > 0" [needs]="searchResults" [itemsPerPage]="itemsPerPage" #needList></app-need-list>
</div>
<!--<ng-template [ngIf]="isManager()" >-->