aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/components/need-list')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.html3
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts8
2 files changed, 9 insertions, 2 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 ffed91d..406bfa0 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,8 @@
<div class="prog">
<span id="hover-status-label-{{need.id}}"> </span>
- <span>{{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>
</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 7e5c3f4..40af9f5 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
@@ -1,5 +1,5 @@
import {Component, Input, OnChanges, TemplateRef} from '@angular/core';
-import {Need} from '../../models/Need';
+import {GoalType, Need} from '../../models/Need';
@Component({
selector: 'app-need-list',
@@ -25,6 +25,10 @@ export class NeedListComponent implements OnChanges {
this.updateVisibleNeeds()
}
+ getPrefix(need: Need) {
+ return (need.type === GoalType.MONETARY) ? "$" : "";
+ }
+
decrementPage() {
this.currentPage--;
this.updateVisibleNeeds();
@@ -49,5 +53,7 @@ export class NeedListComponent implements OnChanges {
this.totalPages = Math.ceil(this.needs.length / this.itemsPerPage);
this.visibleNeeds = this.needs.slice(this.currentPage * this.itemsPerPage, (this.currentPage + 1) * this.itemsPerPage);
}
+
+ protected readonly GoalType = GoalType;
}