diff options
author | benal01 <bja4245@rit.edu> | 2025-03-17 21:55:57 -0400 |
---|---|---|
committer | benal01 <bja4245@rit.edu> | 2025-03-17 21:55:57 -0400 |
commit | 3f8a523dbbfcbfed875adc383d91ef6143b651cb (patch) | |
tree | 5b05c242f7468832d36f888ad8e4fa554887de5b /ufund-ui/src/app/components/cupboard/cupboard.component.html | |
parent | 13c0042f9c6e130a061cbb448cff6bcd9e8ab5e6 (diff) | |
parent | d1b7b81cbedc673cf6f52ac5745438f95083b78e (diff) | |
download | JellySolutions-3f8a523dbbfcbfed875adc383d91ef6143b651cb.tar.gz JellySolutions-3f8a523dbbfcbfed875adc383d91ef6143b651cb.tar.bz2 JellySolutions-3f8a523dbbfcbfed875adc383d91ef6143b651cb.zip |
Merge branch 'main' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b-jellysolutions
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.html')
-rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.html | 63 |
1 files changed, 47 insertions, 16 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html index ad8e60c..65545e8 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.html +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html @@ -1,17 +1,48 @@ <h1> Cupboard </h1> -<form> - <label for="name">Name:</label><br> - <input #name type="text" name="name"><br> - <label for="id">Id:</label><br> - <input #id type="number" name="id"><br> - <label for="max-goal">Max Goal:</label><br> - <input #maxgoal type="number" name="max-goal"><br> - <label>Type</label><br> - <input id="monetary" type="radio" name="type" value="MONETARY"> - <label for="monetary">Monetary</label><br> - <input #physical type="radio" name="type" value="PHYSICAL"> - <label for="physical">Physical</label><br> -</form> -<button (click)="submit(name.value, id.valueAsNumber, maxgoal.valueAsNumber, physical.value)">Submit</button> - -<app-need-list></app-need-list> +<h2 *ngIf="isManager()" > Admin View </h2> +<div id="menu" *ngIf="isManager()"> + <button (click)="opencreate()">Create new Need</button> + <button (click)="openupdate()">Update existing Need</button> +</div> +<div id="create-form"> + <h1> Create a new need </h1> + <form #cupboardForm="ngForm" (ngSubmit)="submit(cupboardForm.value)"> + <label>Name:</label><br> + <input type="text" name="name" ngModel><br> + <label>Max Goal:</label><br> + <input type="number" name="maxGoal" ngModel><br> + <label>Type</label><br> + <input type="radio" name="type" value="MONETARY" ngModel> + <label>Monetary</label><br> + <input type="radio" name="type" value="PHYSICAL" ngModel> + <label>Physical</label><br> + <input type="submit" value="Submit"> + </form> + <button (click)="back()">Close</button> + +</div> +<div id="update-form"> + <h1> Update a need </h1> + <label>Needs:</label><br> + <form #updateForm="ngForm" (ngSubmit)="update(updateForm.value)"> + <div *ngFor="let need of needs"> + + <input type="radio" name="id" [value]=need.id [(ngModel)]="selectedNeedId" (change)="populateForm(need)"> + <label name="template">{{need.name}}</label><br> + </div> + <label>Name:</label><br> + <input type="text" name="name" [(ngModel)]="selectedNeed.name"><br> + <label>Max Goal:</label><br> + <input type="number" name="maxGoal" [(ngModel)]="selectedNeed.maxGoal"><br> + <label>Type</label><br> + <input type="radio" name="type" value="MONETARY" [(ngModel)]="selectedNeed.type"> + <label>Monetary</label><br> + <input type="radio" name="type" value="PHYSICAL" [(ngModel)]="selectedNeed.type"> + <label>Physical</label><br> + <input type="submit" value="Submit"> + </form> + <button (click)="back()">Close</button> + +</div> +<hr> +<app-need-list></app-need-list>
\ No newline at end of file |