Write tests - Write tests for what was done to this point that will be kept #11

Merged
okorpheus merged 61 commits from write-tests into master 2024-07-05 21:21:32 +00:00
2 changed files with 1 additions and 38 deletions
Showing only changes of commit 6724a31c38 - Show all commits

View File

@ -3,7 +3,7 @@
<x-card.card>
<x-card.heading>Edit Student</x-card.heading>
<x-form.form method="PATCH" class="!pt-2 !pb-6 !space-y-2" action="/students/{{ $student->id }}">
<x-form.form method="PATCH" class="!pt-2 !pb-6 !space-y-2" action="{{route('students.update')}}">
<x-form.field name="first_name" label_text="First Name" type="text" value="{{ $student->first_name }}"/>
<x-form.field name="last_name" label_text="Last Name" type="text" value="{{ $student->last_name }}"/>
<x-form.field name="grade" label_text="Grade" type="number" class="mb-3" value="{{ $student->grade }}"/>

View File

@ -1,37 +0,0 @@
@php use Illuminate\Support\Facades\Auth; @endphp
@push('scripts')
{{-- Code from https://codepen.io/ryangjchandler/pen/WNQQKeR--}}
<script src="{{ asset('js/sort_table_by_column.js') }}"></script>
@endpush
<x-layout.app>
<x-slot:page_title>Students</x-slot:page_title>
<x-table.container class="mx-auto max-w-2xl" x-data="data()">
<x-table.title_above_table>
<x-slot:title>Students <x-badge_pill>{{ $students->count() }}</x-badge_pill></x-slot:title>
<x-slot:subtitle>Before submitting entries, you must enter your students</x-slot:subtitle>
<x-slot:button>Add Student</x-slot:button>
</x-table.title_above_table>
<x-table.table>
<x-table.table_header_row>
<x-table.th first @click="sortByColumn" class="cursor-pointer select-none">Name</x-table.th>
<x-table.th @click="sortByColumn" class="cursor-pointer select-none">Grade</x-table.th>
<x-table.th :placeholder="true">
<span class="sr-only">Edit</span>
</x-table.th>
<x-table.body x-ref="tbody">
@foreach($students as $student)
<tr>
<x-table.td :first="true">{{ $student->full_name(true) }}</x-table.td>
<x-table.td>{{ $student->grade }}</x-table.td>
<x-table.td_right_link sr_text=", {{ $student->full_name() }}">
<x-slot:a href="/students/{{ $student->id }}/edit">Edit</x-slot:a>
</x-table.td_right_link>
</tr>
@endforeach
</x-table.body>
</x-table.table_header_row>
</x-table.table>
</x-table.container>
</x-layout.app>