aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/cupboard/cupboard.component.html
blob: 4577844bb5113c190172aaaf264320f9555c46f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<div>
    <h1> Cupboard </h1>
    <app-need-list #needList></app-need-list>
</div>
<div *ngIf="isManager()" >
    <h2 > Admin View </h2>
    <div id="menu">
        <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>
        <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">
    
                <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>