aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-page
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-03-17 23:12:49 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-03-17 23:12:49 -0400
commit5b6c20479fbb6ed0cabbbc88b42280c5a7dbd22c (patch)
tree16f93b3ce3b40de1e550f3824f60ca3aac632265 /ufund-ui/src/app/components/need-page
parent7a5c5073e9e410b3ccc3ab7902a0d6f558277c7d (diff)
parent2b847078b7af4ade35461b8af52352bc88994be3 (diff)
downloadJellySolutions-5b6c20479fbb6ed0cabbbc88b42280c5a7dbd22c.tar.gz
JellySolutions-5b6c20479fbb6ed0cabbbc88b42280c5a7dbd22c.tar.bz2
JellySolutions-5b6c20479fbb6ed0cabbbc88b42280c5a7dbd22c.zip
Merge branch 'main' into funding_basket
Diffstat (limited to 'ufund-ui/src/app/components/need-page')
-rw-r--r--ufund-ui/src/app/components/need-page/need-page.component.html28
-rw-r--r--ufund-ui/src/app/components/need-page/need-page.component.ts11
2 files changed, 30 insertions, 9 deletions
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 0bc4746..8234ac7 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
@@ -1,7 +1,21 @@
-<h1>Need page</h1>
-<p>id: {{need?.id}}</p>
-<p>name: {{need?.name}}</p>
-<p>filterAttributes: {{need?.filterAttributes}}</p>
-<p>type: {{need?.type}}</p>
-<p>max goal: {{need?.maxGoal}}</p>
-<p>current: {{need?.maxGoal}}</p>
+<h1>Viewing Need: {{need?.name}}</h1>
+<a>internal id: {{need?.id}}</a>
+<div style="display: flex; column-gap: 6px;">
+ <h3>Looking for</h3>
+ <h3><u>{{need?.type}}</u></h3>
+ <h3>Donations.</h3>
+</div>
+<div *ngIf="need?.filterAttributes != null">
+ <p>Tags:</p>
+ <ul style="display: flex; column-gap: 24px;">
+ <li *ngFor="let tag of need?.filterAttributes">
+ <p>{{tag}}</p>
+ </li>
+ </ul>
+</div>
+
+<hr>
+
+<p>Goal: {{need?.maxGoal}}</p>
+<p>Current: {{need?.current}}</p>
+<p>This goal is <strong>{{((need?.current ?? 0)*100) / (need?.maxGoal ?? 0)}}%</strong> complete!</p> \ No newline at end of file
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts
index 15c1e87..597d0e0 100644
--- a/ufund-ui/src/app/components/need-page/need-page.component.ts
+++ b/ufund-ui/src/app/components/need-page/need-page.component.ts
@@ -1,7 +1,8 @@
import {Component, Input} from '@angular/core';
-import {Need} from '../../models/Need';
+import {GoalType, Need} from '../../models/Need';
import {ActivatedRoute} from "@angular/router";
import {CupboardService} from "../../services/cupboard.service";
+import { NgFor } from '@angular/common';
@Component({
selector: 'app-need-page',
@@ -15,10 +16,16 @@ export class NeedPageComponent {
private cupboardService: CupboardService,
) {}
+ public GoalType = GoalType;
+
@Input() need?: Need;
ngOnInit(): void {
const id = Number(this.route.snapshot.paramMap.get('id'));
this.cupboardService.getNeed(id).subscribe(n => this.need = n);
}
-}
+
+ back() {
+ window.history.back();
+ }
+} \ No newline at end of file