From 7f3ed5b70400e7ae88efda7650f8e22aa325da31 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Thu, 28 Jan 2021 15:00:07 -0800 Subject: [PATCH] Update nutrition label styling --- .../views/components/search-view.blade.php | 2 +- resources/views/foods/index.blade.php | 70 ++++++++++++------- resources/views/foods/show.blade.php | 51 +++++++++++++- resources/views/recipes/index.blade.php | 58 +++++++++------ resources/views/recipes/show.blade.php | 52 +++++++++----- 5 files changed, 168 insertions(+), 65 deletions(-) diff --git a/resources/views/components/search-view.blade.php b/resources/views/components/search-view.blade.php index dbcc729..e6aaa53 100644 --- a/resources/views/components/search-view.blade.php +++ b/resources/views/components/search-view.blade.php @@ -5,7 +5,7 @@ autocomplete="off" class="w-full mb-4" @input.debounce.400ms="search($event)" /> -
+
{{ $results }}
diff --git a/resources/views/foods/show.blade.php b/resources/views/foods/show.blade.php index 7405e33..98a6f76 100644 --- a/resources/views/foods/show.blade.php +++ b/resources/views/foods/show.blade.php @@ -21,7 +21,56 @@
- TODO! Show stats, tags, attached recipes, etc. + +

+ {{ $food->name }}@if($food->detail), {{ $food->detail }}@endif +

+ @if($food->brand) +
{{ $food->brand }}
+ @endif +
+
Nutrition Facts
+
+
Serving size
+
+ {{ $food->servingSizeFormatted }} + {{ $food->serving_unit }} + ({{ $food->serving_weight }}g) +
+
+
Amount per serving
+
+
Calories
+
{{ $food->calories }}
+
+
+
+
+
Total Fat
+
{{ $food->fat }}g
+
+
+
+
Cholesterol
+
{{ $food->cholesterol }}g
+
+
+
+
Sodium
+
{{ $food->sodium }}g
+
+
+
+
Total Carbohydrate
+
{{ $food->carbohydrates }}g
+
+
+
+
Protein
+
{{ $food->protein }}g
+
+
+
diff --git a/resources/views/recipes/index.blade.php b/resources/views/recipes/index.blade.php index 0276f00..1362c9a 100644 --- a/resources/views/recipes/index.blade.php +++ b/resources/views/recipes/index.blade.php @@ -18,27 +18,45 @@ diff --git a/resources/views/recipes/show.blade.php b/resources/views/recipes/show.blade.php index 8dc250b..8a8d24d 100644 --- a/resources/views/recipes/show.blade.php +++ b/resources/views/recipes/show.blade.php @@ -47,24 +47,42 @@ @endforeach
-

Nutritional Facts

-
-
Amount per serving
-
Calories
-
{{ $recipe->caloriesPerServing() }}
-
Fat
-
{{ $recipe->fatPerServing() }}g
-
Cholesterol
-
{{ $recipe->cholesterolPerServing() }}g
-
Sodium
-
{{ $recipe->sodiumPerServing() }}g
-
Carbohydrates
-
{{ $recipe->carbohydratesPerServing() }}g
-
Protein
-
{{ $recipe->proteinPerServing() }}g
+
+
Nutrition Facts
+
{{ $recipe->servings }} {{ \Illuminate\Support\Str::plural('serving', $recipe->servings ) }}
+
Amount per serving
+
+
Calories
+
{{ $recipe->caloriesPerServing() }}
+
+
+
+
+
Total Fat
+
{{ $recipe->fatPerServing() }}g
+
+
+
+
Cholesterol
+
{{ $recipe->cholesterolPerServing() }}g
+
+
+
+
Sodium
+
{{ $recipe->sodiumPerServing() }}g
+
+
+
+
Total Carbohydrate
+
{{ $recipe->carbohydratesPerServing() }}g
+
+
+
+
Protein
+
{{ $recipe->proteinPerServing() }}g
+
+
-

Servings

-
{{ $recipe->servings }}

Steps