Moved repeated container components to app layout

This commit is contained in:
Christopher C. Wells 2021-03-05 17:20:13 -08:00
parent 580b16a634
commit 5bc2684ca7
17 changed files with 158 additions and 290 deletions

View File

@ -4,11 +4,6 @@
Delete {{ $food->name }}?
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ route('foods.destroy', $food) }}">
@method('delete')
@csrf
@ -51,8 +46,4 @@
<a class="ml-3 text-gray-500 hover:text-gray-700" href="{{ route('foods.show', $food) }}">
No, do not delete</a>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -4,11 +4,6 @@
{{ ($food->exists ? "Edit {$food->name}" : 'Add Food') }}
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ ($food->exists ? route('foods.update', $food) : route('foods.store')) }}">
@if ($food->exists)@method('put')@endif
@csrf
@ -154,8 +149,4 @@
</x-inputs.button>
</div>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -10,11 +10,6 @@
</a>
</div>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<x-search-view :route="route('api:v1:foods.index')" :tags="$tags">
<x-slot name="results">
<template x-for="food in results" :key="food">
@ -70,8 +65,4 @@
</template>
</x-slot>
</x-search-view>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -22,10 +22,6 @@
</a>
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<div class="flex flex-col space-y-2 sm:flex-row sm:space-x-4 sm:space-y-0">
<div class="p-1 mb-2 border-2 border-black font-sans md:w-72">
<div class="text-3xl font-extrabold leading-none">Nutrition Facts</div>
@ -104,8 +100,4 @@
@endif
</div>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -4,11 +4,6 @@
Delete {{ $goal->goal }} goal?
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ route('goals.destroy', $goal) }}">
@method('delete')
@csrf
@ -21,8 +16,4 @@
<a class="ml-3 text-gray-500 hover:text-gray-700 hover:border-gray-300"
href="{{ route('goals.show', $goal) }}">No, do not delete</a>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -4,11 +4,6 @@
{{ ($goal->exists ? 'Edit' : 'Add') }} Goal
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ ($goal->exists ? route('goals.update', $goal) : route('goals.store')) }}">
@if ($goal->exists)@method('put')@endif
@csrf
@ -72,8 +67,4 @@
</x-inputs.button>
</div>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -31,11 +31,6 @@
</a>
</div>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<div class="space-y-4">
@forelse($goals['present'] as $goal)
<div class="flex space-x-2 items-center">
@ -58,8 +53,4 @@
<div>No goals set.</div>
@endforelse
</div>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -17,10 +17,6 @@
</a>
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<div class="grid grid-cols-2 gap-y-1 gap-x-3 max-w-md inline-grid">
<div class="font-bold">From</div>
<div>{{ $goal->from?->toDateString() ?? 'Any' }}</div>
@ -33,8 +29,4 @@
<div class="font-bold">Goal</div>
<div>{{ $goal->goal }}{{ $nameOptions[$goal->name]['unit'] }}</div>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -7,11 +7,6 @@
</a>
</div>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ route('journal-entries.store.from-nutrients') }}">
@csrf
<div class="flex flex-col space-y-4 md:flex-row md:space-x-4 md:space-y-0 w-full mb-4">
@ -72,8 +67,4 @@
<x-inputs.button class="ml-3">Add Entry</x-inputs.button>
</div>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -7,11 +7,6 @@
</a>
</div>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ route('journal-entries.store') }}">
@csrf
<div x-data x-init="initJournalEntries($el);" class="space-y-4">
@ -35,10 +30,6 @@
</div>
</div>
</form>
</div>
</div>
</div>
</div>
@once
@push('scripts')

View File

@ -4,11 +4,6 @@
Delete {{ $entry->summary }}?
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ route('journal-entries.destroy', $entry) }}">
@method('delete')
@csrf
@ -33,8 +28,4 @@
<a class="ml-3 text-gray-500 hover:text-gray-700 hover:border-gray-300"
href="{{ route('journal-entries.index') }}">No, do not delete</a>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -31,11 +31,6 @@
</a>
</div>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<div class="flex align-top flex-col space-y-4 sm:flex-row sm:space-x-4 sm:space-y-0">
<div class="w-full sm:w-5/12 lg:w-4/12">
<div class="flex justify-between items-baseline">
@ -161,8 +156,4 @@
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -52,7 +52,16 @@
@endforeach
</div>
@endif
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
{{ $slot }}
</div>
</div>
</div>
</div>
</main>
</div>

View File

@ -4,11 +4,6 @@
Delete {{ $recipe->name }}?
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ route('recipes.destroy', $recipe) }}">
@method('delete')
@csrf
@ -39,8 +34,4 @@
<a class="ml-3 text-gray-500 hover:text-gray-700" href="{{ route('recipes.show', $recipe) }}">
No, do not delete</a>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -4,11 +4,6 @@
{{ ($recipe->exists ? "Edit {$recipe->name}" : 'Add Recipe') }}
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ ($recipe->exists ? route('recipes.update', $recipe) : route('recipes.store')) }}">
@if ($recipe->exists)@method('put')@endif
@csrf
@ -112,10 +107,6 @@
</x-inputs.button>
</div>
</form>
</div>
</div>
</div>
</div>
@once
@push('scripts')

View File

@ -10,11 +10,6 @@
</a>
</div>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<x-search-view :route="route('api:v1:recipes.index')" :tags="$tags">
<x-slot name="results">
<template x-for="recipe in results" :key="recipe">
@ -66,8 +61,4 @@
</template>
</x-slot>
</x-search-view>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@ -17,10 +17,6 @@
</a>
</h2>
</x-slot>
<div class="py-6">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<div class="flex flex-col-reverse justify-between pb-4 sm:flex-row">
<div x-data="{showNutrientsSummary: false}">
@if(!$recipe->tags->isEmpty())
@ -62,7 +58,7 @@
</div>
</div>
<div>
<div class="p-1 border-2 border-black font-sans md:w-72">
<div class="p-1 border-2 border-black font-sans sm:ml-4 md:w-72">
<div class="text-3xl font-extrabold leading-none">Nutrition Facts</div>
<div class="leading-snug">{{ $recipe->servings }} {{ \Illuminate\Support\Str::plural('serving', $recipe->servings ) }}</div>
@if($recipe->serving_weight)
@ -123,8 +119,4 @@
@endif
</div>
@endif
</div>
</div>
</div>
</div>
</x-app-layout>