diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2025-03-30 20:36:19 -0400 | 
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2025-03-30 20:36:19 -0400 | 
| commit | 2c2957da48b62d16ce24addcc46d0d0ed66f7a9d (patch) | |
| tree | 209e3fa65cd61dfd6785178ae438b919d69f0de7 /ufund-ui/src/app/components/cupboard/cupboard.component.html | |
| parent | 6bfbf7fa3b5b14b04f99f2dd6c33d336f6f081f6 (diff) | |
| parent | b29f29eca643648381bfb62a4b90ad29e17f48a7 (diff) | |
| download | JellySolutions-2c2957da48b62d16ce24addcc46d0d0ed66f7a9d.tar.gz JellySolutions-2c2957da48b62d16ce24addcc46d0d0ed66f7a9d.tar.bz2 JellySolutions-2c2957da48b62d16ce24addcc46d0d0ed66f7a9d.zip  | |
Merge branch 'list-and-cupboard-component-refactor' into css
# Conflicts:
#	ufund-api/data/cupboard.json
#	ufund-ui/src/app/components/cupboard/cupboard.component.css
#	ufund-ui/src/app/components/need-list/need-list.component.css
#	ufund-ui/src/app/components/need-page/need-page.component.html
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.html')
| -rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.html | 96 | 
1 files changed, 51 insertions, 45 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html index 0d64475..bc5ac1c 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.html +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html @@ -1,50 +1,56 @@ -<h1> Cupboard </h1> -<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> +    <h1> Cupboard </h1> +    <app-need-list (currentNeed) = populateForm($event) #needList></app-need-list>  </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> -    <span *ngIf="statusText">‼️{{statusText | async}}</span> +<div *ngIf="isManager()" > +    <h2 > Admin View </h2> +    <div id="menu"> +        <button [ngClass]="selectedForm === 'create' ? 'selected-tab' : 'tab'" (click)="selectForm('create')">Create new Need</button> +        <button [ngClass]="selectedForm === 'update' ? 'selected-tab' : 'tab'" (click)="selectForm('update')">Update existing Need</button> +    </div> +    <div id="create-form" *ngIf="selectedForm === 'create'"> +        <h1> Create Need </h1> +        <form #cupboardForm="ngForm" (ngSubmit)="submit(cupboardForm.value)"> +            <label>Name:</label><br> +            <input type="text" name="name" ngModel><br> +            <label>Location:</label><br> +            <input type="text" name="location" 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="checkbox" name="urgent" value="false" ngModel> +            <label>Urgent</label><br> +            <input type="submit" value="Submit"> +             +        </form> +        <span *ngIf="statusText">{{statusText | async}}</span> -</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"> +    </div> +    <div id="update-form" *ngIf="selectedForm === 'update'"> +        <h1> Update Need </h1> +        <label>Needs:</label><br> +        <form #updateForm="ngForm" (ngSubmit)="update(updateForm.value)"> +            <input type="text" name="name" [(ngModel)]="selectedNeed.name"><br> +            <input type="text" name="location" [(ngModel)]="selectedNeed.location"><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="checkbox" name="urgent" [(ngModel)]="selectedNeed.urgent"> +            <label>Urgent</label> <br> +            <input type="submit" value="Submit"> +            +        </form> +        <span *ngIf="statusText">{{statusText | async}}</span> -            <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> -    <span *ngIf="statusText">{{statusText | async}}</span> +    </div> +    <hr>  </div> -<hr> -<app-need-list #needList></app-need-list>  | 
