aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-04-03 11:57:50 -0400
committerbenal01 <bja4245@rit.edu>2025-04-03 11:57:50 -0400
commitc8b1f6d7eaf71b4b7eeba966c82583a24436ff35 (patch)
tree467054c92bbd3c1644837d61bf8e58f664888abf /ufund-ui
parent6a93ead4f262bf7571192417cc2f6029e9a9e3a8 (diff)
parentfb6d8140830bbb5081056105eaa775f26885da8f (diff)
downloadJellySolutions-c8b1f6d7eaf71b4b7eeba966c82583a24436ff35.tar.gz
JellySolutions-c8b1f6d7eaf71b4b7eeba966c82583a24436ff35.tar.bz2
JellySolutions-c8b1f6d7eaf71b4b7eeba966c82583a24436ff35.zip
Merge branch 'need-image' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b-jellysolutions into need-image
Diffstat (limited to 'ufund-ui')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.html5
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts11
-rw-r--r--ufund-ui/src/app/components/need-page/need-page.component.html4
3 files changed, 13 insertions, 7 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 593aebf..84f80dc 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
@@ -16,7 +16,7 @@
<span class="icon">{{sortMode === 'Ascending' ? 'arrow_upward': 'arrow_downward'}}</span>
</button>
<label>Needs per page: </label>
- <input type ="number" [(ngModel)]="itemsPerPage" (change)="resetVisibleNeeds()" min="1" max="{{searchResults.length}}">
+ <input type ="number" [(ngModel)]="itemsPerPage" (change)="editNeedsPerPage()" min="1" max="{{searchResults.length}}">
</div>
<!--<button (click)="close()">Close</button>-->
</div>
@@ -42,7 +42,8 @@
<div class="prog">
<span id="hover-status-label-{{need.id}}"> </span>
- <span>{{getPrefix(need)}}{{need.current}}/{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%)</span>
+
+ <span>{{need.type.toString() == 'MONETARY' ? '$' : ''}}{{need.current}}/{{need.type.toString() == 'MONETARY' ? '$' : ''}}{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%)</span>
<progress [value]="need.current" [max]="need.maxGoal"></progress>
</div>
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts
index 2ec850e..ae6bc99 100644
--- a/ufund-ui/src/app/components/need-list/need-list.component.ts
+++ b/ufund-ui/src/app/components/need-list/need-list.component.ts
@@ -96,9 +96,14 @@ export class NeedListComponent {
this.updateVisibleNeeds()
}
- editNeedsPerPage(amount: number) {
- this.itemsPerPage = amount;
- this.updateVisibleNeeds();
+ editNeedsPerPage() {
+ if (this.itemsPerPage > this.searchResults.length) {
+ this.itemsPerPage = this.searchResults.length;
+ }
+ if (this.itemsPerPage < 1) {
+ this.itemsPerPage = 1;
+ }
+ this.resetVisibleNeeds();
}
updateVisibleNeeds() {
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.html b/ufund-ui/src/app/components/need-page/need-page.component.html
index cd98c3b..f5f78f6 100644
--- a/ufund-ui/src/app/components/need-page/need-page.component.html
+++ b/ufund-ui/src/app/components/need-page/need-page.component.html
@@ -13,9 +13,9 @@
<span><strong>Target Goal:</strong> {{(need.type === GoalType.MONETARY) ? "$" : ""}}{{need.maxGoal}}</span>
- <span><strong>Amount Currently Collected:</strong> {{need.current}}</span>
+ <span><strong>Amount Currently Collected:</strong> {{need.type.toString() == 'MONETARY' ? '$' : ''}}{{need.current}}</span>
- <span><strong>Location:</strong> {{need.location}}</span>
+ <span><strong>Location:</strong> {{need.location}}</span>
<span><strong>Urgency: </strong>
<span *ngIf="!need.urgent">Not urgent</span>