diff options
Diffstat (limited to 'ufund-ui/src/app/components/need-list/need-list.component.html')
-rw-r--r-- | ufund-ui/src/app/components/need-list/need-list.component.html | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.html b/ufund-ui/src/app/components/need-list/need-list.component.html index 283cc99..de4be58 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.html +++ b/ufund-ui/src/app/components/need-list/need-list.component.html @@ -1,5 +1,6 @@ <h1>Needs List</h1> -<div style="display: flex;"> +<div id="search-container"> + <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> @@ -7,31 +8,33 @@ <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> + </div> + <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> - <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> + <!--<button (click)="close()">Close</button>--> </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> +<!-- 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}}"> + <button [routerLink]="'/need/' + need.id" (mouseenter) ="changeText(need.id, '(details)')" (mouseleave)="changeText(need.id, '')"> + <p>{{need.name}}<span id="hover-status-label-{{need.id}}"> </span></p> + </button> + + <button (click)="add(need)" *ngIf="isHelper()">Add To Basket</button> + <section *ngIf="isManager()"> + <button (click)="select(need)" id="need-edit-button-{{need.id}}"> + <img class="icon" src="/edit.png" alt="Select"> + </button> + <button (click)="delete(need.id)" *ngIf="isManager()"> + <img class="icon" src="/delete.png" alt="Delete"> + </button> + </section> + </li> +</ul>
\ No newline at end of file |