Mercurial > packages > magicforger
diff src/Generator/View/stubs/index.stub @ 31:8dd668020310 codex
started converting too bootstrap, also better support for casts
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Tue, 19 Aug 2025 20:34:53 -0400 |
| parents | 555bfaa500ac |
| children | 45f384a24553 |
line wrap: on
line diff
--- a/src/Generator/View/stubs/index.stub Wed Jun 18 09:04:59 2025 -0400 +++ b/src/Generator/View/stubs/index.stub Tue Aug 19 20:34:53 2025 -0400 @@ -1,50 +1,50 @@ <x-app-layout> <x-slot name="header"> - <h2 class="font-semibold text-xl text-gray-800 leading-tight"> + <h2 class="fw-semibold fs-4 text-dark"> All {{ Str::plural(ucfirst('{{ modelVariable }}')) }} </h2> </x-slot> - <div class="py-12"> - <div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> - <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6"> - <div class="flex items-center justify-between mb-4"> - <span></span> - <a href="{{ route('{{ tableName }}.create') }}" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700"> - + New {{ ucfirst('{{ modelVariable }}') }} - </a> - </div> - <table class="w-full text-left border-collapse table-auto"> - <thead> - <tr class="border-b"> - {{ headerInsertPoint }} - <th class=" p-2">Actions</th> - </tr> - </thead> - <tbody> - @forelse ($items as $item) - <tr class="border-b"> - {{ valueInsertPoint }} - <td class="p-2"> - <div class="flex space-x-2"> - <a href="{{ route('{{ tableName }}.show', $item) }}" class="text-blue-600 hover:underline">View</a> - <a href="{{ route('{{ tableName }}.edit', $item) }}" class="text-yellow-600 hover:underline">Edit</a> - <form action="{{ route('{{ tableName }}.destroy', $item) }}" method="POST" class="inline"> - @csrf - @method('DELETE') - <button type="submit" class="text-red-600 hover:underline" onclick="return confirm('Delete?')">Delete</button> - </form> - </div> - </td> - </tr> - @empty - <tr> - <td class="p-2" colspan="{{ colCount }}">No {{ tableName }} found.</td> - </tr> - @endforelse - </tbody> - </table> - </div> + <div class="py-5"> + <div class="container"> + <div class="bg-white shadow-sm rounded p-4"> + <div class="d-flex align-items-center justify-content-between mb-3"> + <span></span> + <a href="{{ route('{{ tableName }}.create') }}" class="btn btn-primary"> + + New {{ ucfirst('{{ modelVariable }}') }} + </a> + </div> + <table class="table table-hover"> + <thead> + <tr> + {{ headerInsertPoint }} + <th scope="col">Actions</th> + </tr> + </thead> + <tbody> + @forelse ($items as $item) + <tr> + {{ valueInsertPoint }} + <td> + <div class="d-flex gap-2"> + <a href="{{ route('{{ tableName }}.show', $item) }}" class="text-primary">View</a> + <a href="{{ route('{{ tableName }}.edit', $item) }}" class="text-warning">Edit</a> + <form action="{{ route('{{ tableName }}.destroy', $item) }}" method="POST" class="d-inline"> + @csrf + @method('DELETE') + <button type="submit" class="btn btn-link text-danger p-0" onclick="return confirm('Delete?')">Delete</button> + </form> + </div> + </td> + </tr> + @empty + <tr> + <td colspan="{{ colCount }}">No {{ tableName }} found.</td> + </tr> + @endforelse + </tbody> + </table> + </div> </div> </div> </x-app-layout>
