summaryrefslogtreecommitdiff
path: root/recipeBuddy/src/app/add-recipe/add-recipe.component.html
blob: a8a3e5fc9323f33a7db6f4db83f53d9b3ea27565 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<form [formGroup]="recipeForm" class="form" (ngSubmit)="onSubmit()">
<h2>Add Recipe</h2>
	<mat-form-field class="full-width">
		<input matInput placeholder="Name" type="text"
			formControlName="recipeName" required>
	</mat-form-field>
	<mat-form-field class="full-width">
		<textarea matInput placeholder="Description"
		formControlName="desc"> TEST </textarea>
	</mat-form-field>
	<mat-form-field class="full-width">
		<input matInput placeholder="Servings" type=text formControlName="servingSize">
	</mat-form-field>
	<mat-form-field class="full-width">
		<input matInput placeholder="Cooking Time" type="text" formControlName="cookTime">
	</mat-form-field>
	<mat-form-field class="full-width" floatLabel="options.value.floatLabel">
    <mat-label>Keywords/Tags</mat-label>
		<input matInput placeholder="Separate with a comma" type="text" formControlName="tags">
	</mat-form-field>
	<mat-form-field class="full-width" floatLabel="options.value.floatLabel">
		<mat-label>Photos (URLS)</mat-label>
		<input matInput placeholder="Separate with a comma" type="text" formControlName="photos">
	</mat-form-field>

	<div formArrayName="ingredients">
		<h3>Ingredients</h3>
		<div *ngFor="let address of ingredients.controls; let i=index">
			<div [formGroupName]="i">
				<h4>Ingredient {{ i + 1 }}</h4>
				<div class="full-width">
				<mat-form-field class="quarter-width">
					<input matInput placeholder="Name" type="text"
					formControlName="ingrName">
				</mat-form-field>
				<mat-form-field class="quarter-width">
					<input matInput placeholder="Amount" type="text"
					formControlName="amount">
				</mat-form-field>
				<mat-form-field class="quarter-width">
					<input matInput placeholder="Units" type="text"
					formControlName="units">
				</mat-form-field>
				<button matSuffix mat-mini-fab (click)="rmIngredient(i)"
					type="button" style="margin-left: 10px">
					<mat-icon>remove</mat-icon>
				</button>
				</div>
			</div>
		</div>
		<div style="text-align: center">
		<button mat-mini-fab (click)="addIngredient()"
		type="button">
			<mat-icon>add</mat-icon>
		</button>
		</div>
	</div>

	<div formArrayName="steps">
		<h3>Steps</h3>
		<div *ngFor="let address of steps.controls; let i=index">
			<div [formGroupName]="i">
				<h4>Step {{ i + 1 }}</h4>
				<div class="ful-width">
				<mat-form-field class="half-width">
					<textarea matInput placeholder="Instructions" type="text" formControlName="instruct">
					</textarea>
				</mat-form-field>
				<mat-form-field class="quarter-width">
					<mat-label>Timer</mat-label>
					<input matInput placeholder="hh:mm" type="text"
					formControlName="timer">
				</mat-form-field>
				<button matSuffix mat-mini-fab (click)="rmStep(i)"
					type="button" style="margin-left: 10px">
					<mat-icon>remove</mat-icon>
				</button>
				</div>
			</div>
		</div>
		<div style="text-align: center">
			<button mat-mini-fab (click)="addStep()" matSuffix type="button">
				<mat-icon>add</mat-icon>
			</button>
		</div>
	</div>
	<button mat-flat-button color="primary" type="submit"
	[disabled]="!recipeForm.valid">Submit</button>
</form>