aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list/need-list.component.html
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-03-21 10:13:27 -0400
committerGitHub <noreply@github.com>2025-03-21 10:13:27 -0400
commita401cfe17108fcd38cd2ccf15e2d3f0e49606d9e (patch)
treef735df43a8e2cbae1fc5ec2842b19ddb6a94910c /ufund-ui/src/app/components/need-list/need-list.component.html
parent35d7c971ed47718d4dc5738edb09d62cd780dac4 (diff)
parentd386b35bf24444240b0d670674c3e75ea5d8b3ce (diff)
downloadJellySolutions-a401cfe17108fcd38cd2ccf15e2d3f0e49606d9e.tar.gz
JellySolutions-a401cfe17108fcd38cd2ccf15e2d3f0e49606d9e.tar.bz2
JellySolutions-a401cfe17108fcd38cd2ccf15e2d3f0e49606d9e.zip
Merge pull request #16 from RIT-SWEN-261-02/need-component-refactor
Need component refactor
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.html30
1 files changed, 13 insertions, 17 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 36c12d0..9f22633 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,28 +1,24 @@
<h1>Needs List</h1>
-<input id="search-button" type="button" value="Search" (click)="open()">
-<div id="search-form">
- <form #searchForm="ngForm">
+<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="button" value="Clear" (click)="searchForm.reset()"> <br>
+ <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">
+<!-- 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()">Delete</button>
+ <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>