blob: 283cc99b4c894c0878a70fbab1f6b210cecb671f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
<h1>Needs List</h1>
<div style="display: flex;">
<h3>Sort by:</h3>
<table style="margin-left: 10px; display: flex; column-gap: 24px;">
<tr><h3><button (click)="changeSortAlgo('sortByName',searchForm.value)">Name(A-Z)</button></h3></tr>
<tr><h3><button (click)="changeSortAlgo('sortByNameReverse',searchForm.value)">Name(Z-A)</button></h3></tr>
<tr><h3><button (click)="changeSortAlgo('sortByMaxGoal',searchForm.value)">Max Goal(Descending)</button></h3></tr>
<tr><h3><button (click)="changeSortAlgo('sortByMinGoal',searchForm.value)">Max Goal(Ascending)</button></h3></tr>
</table>
</div>
<input id="search-button" type="button" value="Search" (click)="open()">
<div id="search-form">
<form #searchForm="ngForm">
<label>Search:</label><br>
<input type="text" name="search" (input)="search(searchForm.value)" ngModel>
<input type="button" value="Clear" (click)="searchForm.reset()"> <br>
</form>
<button (click)="close()">Close</button>
<div>
<h2 id="search-status">Search Results:</h2>
<div *ngFor="let need of searchResults">
<a routerLink="/need/{{need.id}}">
{{need.name}}
</a>
<button (click)="delete(need.id)" *ngIf="isManager()">Delete</button>
<!-- <button (click)="add(need)" *ngIf="isHelper()">Add To Basket</button> -->
</div>
</div>
</div>
<li *ngFor="let need of needs">
<a routerLink="/need/{{need.id}}">
{{need.name}}
</a>
<button (click)="delete(need.id)" *ngIf="isManager()">Delete</button>
<button (click)="add(need)" *ngIf="isHelper()">Add To Basket</button>
</li>
|