blob: fc2daa585cb0addc647557627270ffc7b9ead390 (
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
|
<h1>Needs List</h1>
<div id="search-container">
<form id="search-form" #searchForm="ngForm">
<input type="text" name="search" placeholder="Search in {{needs.length}} needs..." (input)="search(searchForm.value)" ngModel>
<input type="reset" value="Clear" (click)="search(null)"> <br>
</form>
<!--<button (click)="close()">Close</button>-->
</div>
<!-- display for when results are present and filtered-->
<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>
<ul>
<li *ngFor="let need of searchResults" id="need-button-{{need.id}}" (mouseenter) ="changeText(need.id, need.name + '(Click to view)')" (mouseleave)="changeText(need.id, need.name)" >
<button [routerLink]="'/need/' + need.id">
<p id="need-label-{{need.id}}">{{need.name}}</p>
<button (click)="delete(need.id)" *ngIf="isManager()">
<img class="icon" src="/delete.png" alt="Delete">
</button>
<button (click)="add(need)" *ngIf="isHelper()">Add To Basket</button>
</button>
</li>
</ul>
|