Fix indentation

This commit is contained in:
Christopher C. Wells 2021-04-17 05:19:31 -07:00
parent 5accf0e0ed
commit 9360997bee
1 changed files with 119 additions and 119 deletions

View File

@ -5,140 +5,140 @@
<h1 class="font-semibold text-xl text-gray-800 leading-tight">{{ $title }}</h1> <h1 class="font-semibold text-xl text-gray-800 leading-tight">{{ $title }}</h1>
</x-slot> </x-slot>
<form method="POST" action="{{ ($food->exists ? route('foods.update', $food) : route('foods.store')) }}"> <form method="POST" action="{{ ($food->exists ? route('foods.update', $food) : route('foods.store')) }}">
@if ($food->exists)@method('put')@endif @if ($food->exists)@method('put')@endif
@csrf @csrf
<div class="flex flex-col space-y-4"> <div class="flex flex-col space-y-4">
<div class="flex flex-col space-y-4 md:flex-row md:space-x-4 md:space-y-0"> <div class="flex flex-col space-y-4 md:flex-row md:space-x-4 md:space-y-0">
<!-- Name --> <!-- Name -->
<div class="flex-auto"> <div class="flex-auto">
<x-inputs.label for="name" value="Name"/> <x-inputs.label for="name" value="Name"/>
<x-inputs.input name="name" <x-inputs.input name="name"
type="text" type="text"
class="block mt-1 w-full" class="block mt-1 w-full"
autocapitalize="none" autocapitalize="none"
:value="old('name', $food->name)" :value="old('name', $food->name)"
required/> required/>
</div> </div>
<!-- Detail --> <!-- Detail -->
<div class="flex-auto"> <div class="flex-auto">
<x-inputs.label for="detail" value="Detail"/> <x-inputs.label for="detail" value="Detail"/>
<x-inputs.input name="detail" <x-inputs.input name="detail"
type="text" type="text"
class="block mt-1 w-full" class="block mt-1 w-full"
autocapitalize="none" autocapitalize="none"
:value="old('detail', $food->detail)"/> :value="old('detail', $food->detail)"/>
</div> </div>
<!-- Brand --> <!-- Brand -->
<div class="flex-auto"> <div class="flex-auto">
<x-inputs.label for="brand" value="Brand"/> <x-inputs.label for="brand" value="Brand"/>
<x-inputs.input name="brand" <x-inputs.input name="brand"
type="text" type="text"
class="block mt-1 w-full" class="block mt-1 w-full"
:value="old('brand', $food->brand)"/> :value="old('brand', $food->brand)"/>
</div> </div>
</div> </div>
<div class="flex flex-col space-y-4 sm:flex-row sm:space-x-4 sm:space-y-0"> <div class="flex flex-col space-y-4 sm:flex-row sm:space-x-4 sm:space-y-0">
<!-- Serving size --> <!-- Serving size -->
<div> <div>
<x-inputs.label for="serving_size" value="Serving size"/> <x-inputs.label for="serving_size" value="Serving size"/>
<x-inputs.input name="serving_size" <x-inputs.input name="serving_size"
type="text" type="text"
class="block mt-1 w-full" class="block mt-1 w-full"
size="10" size="10"
:value="old('serving_size', $food->serving_size_formatted)" :value="old('serving_size', $food->serving_size_formatted)"
required/> required/>
</div> </div>
<!-- Serving unit --> <!-- Serving unit -->
<div> <div>
<x-inputs.label for="serving_unit" value="Serving unit"/> <x-inputs.label for="serving_unit" value="Serving unit"/>
<x-inputs.select name="serving_unit" <x-inputs.select name="serving_unit"
class="block mt-1 w-full" class="block mt-1 w-full"
:options="$serving_units" :options="$serving_units"
:selectedValue="old('serving_unit', $food->serving_unit)"> :selectedValue="old('serving_unit', $food->serving_unit)">
<option value=""></option> <option value=""></option>
</x-inputs.select> </x-inputs.select>
</div> </div>
<!-- Serving unit name --> <!-- Serving unit name -->
<div> <div>
<x-inputs.label for="serving_unit_name" value="Serving unit name"/> <x-inputs.label for="serving_unit_name" value="Serving unit name"/>
<x-inputs.input name="serving_unit_name" <x-inputs.input name="serving_unit_name"
type="text" type="text"
autocapitalize="none" autocapitalize="none"
class="block mt-1 w-full" class="block mt-1 w-full"
placeholder="e.g. clove, egg" placeholder="e.g. clove, egg"
size="10" size="10"
:value="old('serving_unit_name', $food->serving_unit_name)"/> :value="old('serving_unit_name', $food->serving_unit_name)"/>
</div> </div>
<!-- Serving weight --> <!-- Serving weight -->
<div> <div>
<x-inputs.label for="serving_weight" value="Serving weight (g)"/> <x-inputs.label for="serving_weight" value="Serving weight (g)"/>
<x-inputs.input name="serving_weight" <x-inputs.input name="serving_weight"
type="number" type="number"
step="any" step="any"
class="block mt-1 w-full" class="block mt-1 w-full"
size="10" size="10"
:value="old('serving_weight', $food->serving_weight)" :value="old('serving_weight', $food->serving_weight)"
required/> required/>
</div> </div>
</div> </div>
<div class="flex flex-col space-y-4 md:flex-row md:space-y-0"> <div class="flex flex-col space-y-4 md:flex-row md:space-y-0">
@foreach (\App\Support\Nutrients::all()->sortBy('weight') as $nutrient) @foreach (\App\Support\Nutrients::all()->sortBy('weight') as $nutrient)
<!-- {{ ucfirst($nutrient['value']) }} --> <!-- {{ ucfirst($nutrient['value']) }} -->
<div class="flex-auto"> <div class="flex-auto">
<x-inputs.label for="{{ $nutrient['value'] }}" <x-inputs.label for="{{ $nutrient['value'] }}"
:value="ucfirst($nutrient['value']) . ($nutrient['unit'] ? ' (' . $nutrient['unit'] . ')' : '')"/> :value="ucfirst($nutrient['value']) . ($nutrient['unit'] ? ' (' . $nutrient['unit'] . ')' : '')"/>
<x-inputs.input name="{{ $nutrient['value'] }}" <x-inputs.input name="{{ $nutrient['value'] }}"
type="number" type="number"
step="any" step="any"
class="block w-full mt-1 md:w-5/6" class="block w-full mt-1 md:w-5/6"
:value="old($nutrient['value'], $food->{$nutrient['value']})"/> :value="old($nutrient['value'], $food->{$nutrient['value']})"/>
</div>
@endforeach
</div>
<!-- Tags -->
<x-tagger :defaultTags="$food_tags"/>
<!-- Source -->
<div class="flex-auto">
<x-inputs.label for="source" value="Source" />
<x-inputs.input name="source"
type="text"
class="block mt-1 w-full"
inputmode="url"
:value="old('source', $food->source)" />
</div>
<!-- Notes -->
<div>
<x-inputs.label for="description" value="Description" />
<x-inputs.textarea name="notes"
class="block mt-1 w-full"
:value="old('notes', $food->notes)" />
</div>
</div> </div>
@endforeach
</div>
<div class="flex items-center justify-end mt-4"> <!-- Tags -->
<x-inputs.button class="ml-3"> <x-tagger :defaultTags="$food_tags"/>
{{ ($food->exists ? 'Save' : 'Add') }}
</x-inputs.button> <!-- Source -->
</div> <div class="flex-auto">
</form> <x-inputs.label for="source" value="Source" />
<x-inputs.input name="source"
type="text"
class="block mt-1 w-full"
inputmode="url"
:value="old('source', $food->source)" />
</div>
<!-- Notes -->
<div>
<x-inputs.label for="description" value="Description" />
<x-inputs.textarea name="notes"
class="block mt-1 w-full"
:value="old('notes', $food->notes)" />
</div>
</div>
<div class="flex items-center justify-end mt-4">
<x-inputs.button class="ml-3">
{{ ($food->exists ? 'Save' : 'Add') }}
</x-inputs.button>
</div>
</form>
</x-app-layout> </x-app-layout>