auditionadmin/resources/views/students/index.blade.php

68 lines
3.0 KiB
PHP

@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-layout.page-section-container>
<x-layout.page-section>
<x-slot:section_name>Add Student</x-slot:section_name>
<x-form.form method="POST" action="/students">
<x-form.body-grid columns="8" class="max-w-full">
<x-form.field name="first_name" label_text="First Name" colspan="3" />
<x-form.field name="last_name" label_text="Last Name" colspan="3" />
<x-form.field name="grade" label_text="Grade" colspan="1" />
{{-- TODO make grade a dropdown --}}
<x-form.button class="mt-8">Save</x-form.button>
</x-form.body-grid>
</x-form.form>
</x-layout.page-section>
<x-layout.page-section>
<x-slot:section_name>Student Listing</x-slot:section_name>
<div class="px-4">
<x-table.table>
<thead>
<tr>
<x-table.th first>Name</x-table.th>
<x-table.th>Grade</x-table.th>
<x-table.th spacer_only>
<span class="sr-only">Edit</span>
</x-table.th>
</tr>
</thead>
<x-table.body>
@foreach($students as $student)
<tr>
<x-table.td first>{{ $student->full_name(true) }}</x-table.td>
<x-table.td>{{ $student->grade }}</x-table.td>
<x-table.td for_button>
<x-table.button href="/students/{{ $student->id }}/edit">Edit</x-table.button>
</x-table.td>
</tr>
@endforeach
</x-table.body>
</x-table.table>
</div>
</x-layout.page-section>
</x-layout.page-section-container>
</x-layout.app>
{{--<x-layout.app>--}}
{{-- <x-slot:page_title>Students</x-slot:page_title>--}}
{{-- <x-layout.page-section>--}}
{{-- <x-slot:section_name>Create Student</x-slot:section_name>--}}
{{-- <x-slot:section_description>Student full names must be unique. Add a middle initial to the first name if necessary.</x-slot:section_description>--}}
{{-- <x-form.card method="POST" action="/students/create" submit-button-text="Create Student" >--}}
{{-- <x-form.field name="first_name" label="First Name" div_classes="sm:col-span-3" required />--}}
{{-- <x-form.field name="last_name" label="Last Name" div_classes="sm:col-span-3" required />--}}
{{-- </x-form.card>--}}
{{-- </x-layout.page-section>--}}
{{--</x-layout.app>--}}