aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list/need-list.component.html
blob: 9f22633c62ca553127b8d6fd18857e805862d780 (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
<h1>Needs List</h1>
<div id="search-container">
    <form id="search-form" #searchForm="ngForm">
        <label>Search:</label><br>
        <input type="text" name="search" (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>

<li *ngFor="let need of searchResults">
    <a routerLink="/need/{{need.id}}">
        {{need.name}}
    </a>
    <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>
</li>