@model Francesco.Recipes.World.Models.BackendModels.Recipe.Recipe
@using Francesco.Recipes.World.Models.BackendModels.Recipe
@{
	ViewData["Title"] = "Create Recipe";
}

<h1>Create Recipe</h1>

<form method="post" enctype="multipart/form-data">
	<div class="form-group">
		<label asp-for="Name"></label>
		<input asp-for="Name" class="form-control" />
		<span asp-validation-for="Name" class="text-danger"></span>
	</div>
	<div class="form-group">
		<label asp-for="Description"></label>
		<textarea asp-for="Description" class="form-control"></textarea>
		<span asp-validation-for="Description" class="text-danger"></span>
	</div>
	<div class="form-group">
		<label asp-for="Difficulty"></label>
		<select asp-for="Difficulty" class="form-control">
			<option value="">Select Difficulty</option>
			@foreach (var difficulty in Enum.GetValues(typeof(Difficulty)))
			{
				<option value="@difficulty">@difficulty</option>
			}
		</select>
		<span asp-validation-for="Difficulty" class="text-danger"></span>
	</div>
	<div class="form-group">
		<label asp-for="Servings"></label>
		<input asp-for="Servings" class="form-control" />
		<span asp-validation-for="Servings" class="text-danger"></span>
	</div>
	<div class="form-group">
		<label asp-for="PreparationTime"></label>
		<input asp-for="PreparationTime" class="form-control" />
		<span asp-validation-for="PreparationTime" class="text-danger"></span>
	</div>
	<div class="form-group">
		<label asp-for="CookingTime"></label>
		<input asp-for="CookingTime" class="form-control" />
		<span asp-validation-for="CookingTime" class="text-danger"></span>
	</div>
	<div class="form-group">
		<label for="photo">Photo</label>
		<input type="file" name="photo" class="form-control" />
	</div>
	<button type="submit" class="btn btn-primary">Create</button>
</form>

@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
}

