aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/cupboard/cupboard.component.html
blob: 2cfbe2dc0ef4e0afa3eec757955fcd20f5bcf244 (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
<div id="box">
    <h1> Cupboard </h1>
    <app-need-list (currentNeed) = populateForm($event) #needList></app-need-list>
</div>
<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>
    <app-need-edit [selectedNeed]="selectedNeed" (refreshNeedList)="needList.refresh()"></app-need-edit>
    <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>Image:</label><br>
            <input type="text" name="image" 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>
            <label>Description</label>
            <textarea name="description" [(ngModel)]="selectedNeed.description"></textarea><br>
            <input type="submit" value="Submit">

        </form>
    </div>
    <hr>

</div>