Move form components out of auth directory
This commit is contained in:
parent
fa524e80da
commit
7282a6b589
|
|
@ -74,13 +74,13 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||||
{
|
{
|
||||||
return $this
|
return $this
|
||||||
->hasManyThrough(Student::class, School::class, 'id','school_id','school_id','id')
|
->hasManyThrough(Student::class, School::class, 'id','school_id','school_id','id')
|
||||||
->orderBy('last_name','asc')
|
->orderBy('last_name')
|
||||||
->orderBy('first_name','asc');
|
->orderBy('first_name');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array of schools using the users email domiain
|
* Return an array of schools using the users email domain
|
||||||
* @return SchoolEmailDomain[]
|
* @return SchoolEmailDomain[]
|
||||||
*/
|
*/
|
||||||
public function possibleSchools()
|
public function possibleSchools()
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
</div>
|
</div>
|
||||||
<form class="space-y-6" action="/forgot-password" method="POST">
|
<form class="space-y-6" action="/forgot-password" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<x-auth.form-field name="email" label="Email address" type="email" autocomplete="email" required />
|
<x-form.field name="email" label="Email address" type="email" autocomplete="email" required />
|
||||||
<x-auth.form-button>Send Password Reset</x-auth.form-button>
|
<x-form.button>Send Password Reset</x-form.button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
<div class="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
<div class="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
||||||
<form class="space-y-6" action="/login" method="POST">
|
<form class="space-y-6" action="/login" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<x-auth.form-field name="email" label="Email address" type="email" autocomplete="email" required />
|
<x-form.field name="email" label="Email address" type="email" autocomplete="email" required />
|
||||||
<x-auth.form-field name="password" label="Password" type="password" required />
|
<x-form.field name="password" label="Password" type="password" required />
|
||||||
<x-auth.rememberme-forgotpassword />
|
<x-auth.rememberme-forgotpassword />
|
||||||
<x-auth.form-button>Log In</x-auth.form-button>
|
<x-form.button>Log In</x-form.button>
|
||||||
</form>
|
</form>
|
||||||
<div class="pt-4 border-t border-gray-900/10 mt-4">
|
<div class="pt-4 border-t border-gray-900/10 mt-4">
|
||||||
Don't have an account? <a href="/register" class="font-semibold text-indigo-600 hover:text-indigo-500"> Click here to register.
|
Don't have an account? <a href="/register" class="font-semibold text-indigo-600 hover:text-indigo-500"> Click here to register.
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@
|
||||||
<div class="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
<div class="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
||||||
<form class="space-y-6" action="/register" method="POST">
|
<form class="space-y-6" action="/register" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<x-auth.form-field name="first_name" label="First Name" type="text" autocomplete="given-name" required />
|
<x-form.field name="first_name" label="First Name" type="text" autocomplete="given-name" required />
|
||||||
<x-auth.form-field name="last_name" label="Last Name" type="text" autocomplete="family-name" required />
|
<x-form.field name="last_name" label="Last Name" type="text" autocomplete="family-name" required />
|
||||||
<x-auth.form-field name="email" label="Email address" type="email" autocomplete="email" required />
|
<x-form.field name="email" label="Email address" type="email" autocomplete="email" required />
|
||||||
<x-auth.form-field name="cell_phone" label="Cell Phone Number" type="tel" autocomplete="tel-national" />
|
<x-form.field name="cell_phone" label="Cell Phone Number" type="tel" autocomplete="tel-national" />
|
||||||
<x-auth.form-field name="judging_preference" label="Judging Preference" type="text" />
|
<x-form.field name="judging_preference" label="Judging Preference" type="text" />
|
||||||
<x-auth.form-field name="password" label="Password" type="password" autocomplete="new-password" required />
|
<x-form.field name="password" label="Password" type="password" autocomplete="new-password" required />
|
||||||
<x-auth.form-field name="password_confirmation" label="Confirm Password" autocomplete="new-password" type="password" required />
|
<x-form.field name="password_confirmation" label="Confirm Password" autocomplete="new-password" type="password" required />
|
||||||
<x-auth.form-button>Create Account</x-auth.form-button>
|
<x-form.button>Create Account</x-form.button>
|
||||||
</form>
|
</form>
|
||||||
<div class="pt-4 border-t border-gray-900/10 mt-4">
|
<div class="pt-4 border-t border-gray-900/10 mt-4">
|
||||||
Already have an account? <a href="/login" class="font-semibold text-indigo-600 hover:text-indigo-500"> Click here to Log In.
|
Already have an account? <a href="/login" class="font-semibold text-indigo-600 hover:text-indigo-500"> Click here to Log In.
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@
|
||||||
<div class="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
<div class="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
||||||
<form class="space-y-6" action="/reset-password" method="POST">
|
<form class="space-y-6" action="/reset-password" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<x-auth.form-field name="email" label="Email address" type="email" autocomplete="email" required />
|
<x-form.field name="email" label="Email address" type="email" autocomplete="email" required />
|
||||||
<x-auth.form-field name="password" label="Password" type="password" required />
|
<x-form.field name="password" label="Password" type="password" required />
|
||||||
<x-auth.form-field name="password_confirmation" label="Confirm Password" type="password" required />
|
<x-form.field name="password_confirmation" label="Confirm Password" type="password" required />
|
||||||
<input type="hidden" name="token" id="token" value="{{ request()->route('token') }}" >
|
<input type="hidden" name="token" id="token" value="{{ request()->route('token') }}" >
|
||||||
<x-auth.form-button>Reset Password</x-auth.form-button>
|
<x-form.button>Reset Password</x-form.button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,14 @@
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<x-auth.form-button>Resend Verification Email</x-auth.form-button>
|
<x-form.button>Resend Verification Email</x-form.button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form method="POST" action="{{ route('logout') }}">
|
<form method="POST" action="{{ route('logout') }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
|
||||||
<x-auth.form-button>Logout</x-auth.form-button>
|
<x-form.button>Logout</x-form.button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@
|
||||||
{{ $buttons }}
|
{{ $buttons }}
|
||||||
@else
|
@else
|
||||||
<!-- TODO make the cancel button do something -->
|
<!-- TODO make the cancel button do something -->
|
||||||
<x-auth.form-button-nocolor type="button">Cancel</x-auth.form-button-nocolor>
|
<x-form.button-nocolor type="button">Cancel</x-form.button-nocolor>
|
||||||
<x-auth.form-button>{{ $submitButtonText }}</x-auth.form-button>
|
<x-form.button>{{ $submitButtonText }}</x-form.button>
|
||||||
@endif
|
@endif
|
||||||
{{ $buttons }}
|
{{ $buttons }}
|
||||||
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
<div class="{{ $div_classes }}">
|
<div class="{{ $div_classes }}">
|
||||||
<label for="{{ $name }}" class="{{ $labelClasses }}">{{ $label }}</label>
|
<label for="{{ $name }}" class="{{ $labelClasses }}">{{ $label }}</label>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
|
<!--suppress HtmlFormInputWithoutLabel -->
|
||||||
<input {{$attributes->merge($inputAttributes)}}>
|
<input {{$attributes->merge($inputAttributes)}}>
|
||||||
</div>
|
</div>
|
||||||
@error($name)
|
@error($name)
|
||||||
|
|
@ -15,11 +15,10 @@
|
||||||
<div class="min-h-full">
|
<div class="min-h-full">
|
||||||
<x-layout.navbar />
|
<x-layout.navbar />
|
||||||
|
|
||||||
<header class="bg-white shadow-sm">
|
@if($page_title)
|
||||||
<div class="mx-auto max-w-7xl px-4 py-4 sm:px-6 lg:px-8">
|
<x-layout.page-header>{{ $page_title }}</x-layout.page-header>
|
||||||
<h1 class="text-lg font-semibold leading-6 text-gray-900">{{ $page_title }}</h1>
|
@endif
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<main>
|
<main>
|
||||||
<div class="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8">
|
<div class="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8">
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
@php use Illuminate\Support\Facades\Auth; @endphp
|
@php use Illuminate\Support\Facades\Auth; @endphp
|
||||||
|
{{--TODO Clean up mobile menu area--}}
|
||||||
<nav class="bg-indigo-600"
|
<nav class="bg-indigo-600"
|
||||||
x-data="{
|
x-data="{
|
||||||
mobile_menu_open: false
|
mobile_menu_open: false
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<header class="bg-white shadow-sm">
|
||||||
|
<div class="mx-auto max-w-7xl px-4 py-4 sm:px-6 lg:px-8">
|
||||||
|
<h1 class="text-lg font-semibold leading-6 text-gray-900">{{ $slot }}</h1>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
@ -17,16 +17,16 @@
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
<div class="px-4 py-6 sm:p-8">
|
<div class="px-4 py-6 sm:p-8">
|
||||||
<div class="grid max-w-2xl grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
|
<div class="grid max-w-2xl grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
|
||||||
<x-auth.form-field name="first_name" label="First Name" value="{{ Auth::user()->first_name }}" div_classes="sm:col-span-3" />
|
<x-form.field name="first_name" label="First Name" value="{{ Auth::user()->first_name }}" div_classes="sm:col-span-3" />
|
||||||
<x-auth.form-field name="last_name" label="Last Name" value="{{ Auth::user()->last_name }}" div_classes="sm:col-span-3" />
|
<x-form.field name="last_name" label="Last Name" value="{{ Auth::user()->last_name }}" div_classes="sm:col-span-3" />
|
||||||
<x-auth.form-field name="email" label="Email Address" value="{{ Auth::user()->email }}" div_classes="sm:col-span-3" />
|
<x-form.field name="email" label="Email Address" value="{{ Auth::user()->email }}" div_classes="sm:col-span-3" />
|
||||||
<x-auth.form-field name="cell_phone" label="Cell Phone" value="{{ Auth::user()->cell_phone }}" div_classes="sm:col-span-3" />
|
<x-form.field name="cell_phone" label="Cell Phone" value="{{ Auth::user()->cell_phone }}" div_classes="sm:col-span-3" />
|
||||||
<x-auth.form-field name="judging_preference" label="Judging Preference" value="{{ Auth::user()->judging_preference }}" div_classes="sm:col-span-5" />
|
<x-form.field name="judging_preference" label="Judging Preference" value="{{ Auth::user()->judging_preference }}" div_classes="sm:col-span-5" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-end gap-x-6 border-t border-gray-900/10 px-4 py-4 sm:px-8">
|
<div class="flex items-center justify-end gap-x-6 border-t border-gray-900/10 px-4 py-4 sm:px-8">
|
||||||
<x-auth.form-button-nocolor type="button">Cancel</x-auth.form-button-nocolor>
|
<x-form.button-nocolor type="button">Cancel</x-form.button-nocolor>
|
||||||
<x-auth.form-button>Update Profile</x-auth.form-button>
|
<x-form.button>Update Profile</x-form.button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
@ -42,11 +42,11 @@
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<x-auth.form-card method="PUT" action="/user/password" cols="1" submit-button-text="Change Password">
|
<x-form.card method="PUT" action="/user/password" cols="1" submit-button-text="Change Password">
|
||||||
<x-auth.form-field name="current_password" label="Current Password" type="password" autocomplete="current-password" required />
|
<x-form.field name="current_password" label="Current Password" type="password" autocomplete="current-password" required />
|
||||||
<x-auth.form-field name="password" label="New Password" type="password" autocomplete="new-password" required />
|
<x-form.field name="password" label="New Password" type="password" autocomplete="new-password" required />
|
||||||
<x-auth.form-field name="password_confirmation" label="Confirm New Password" autocomplete="new-password" type="password" required />
|
<x-form.field name="password_confirmation" label="Confirm New Password" autocomplete="new-password" type="password" required />
|
||||||
</x-auth.form-card>
|
</x-form.card>
|
||||||
|
|
||||||
</x-layout.page-section>
|
</x-layout.page-section>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,18 +6,18 @@
|
||||||
section_description=""
|
section_description=""
|
||||||
:first="true">
|
:first="true">
|
||||||
|
|
||||||
<x-auth.form-card
|
<x-form.card
|
||||||
submit-button-text="Create School"
|
submit-button-text="Create School"
|
||||||
method="POST"
|
method="POST"
|
||||||
action="/schools"
|
action="/schools"
|
||||||
cols="9"
|
cols="9"
|
||||||
>
|
>
|
||||||
<x-auth.form-field name="name" label="School Name" div_classes="sm:col-span-6"/>
|
<x-form.field name="name" label="School Name" div_classes="sm:col-span-6"/>
|
||||||
<x-auth.form-field name="address" label="School Address" div_classes="sm:col-span-6"/>
|
<x-form.field name="address" label="School Address" div_classes="sm:col-span-6"/>
|
||||||
<x-auth.form-field name="city" label="City" div_classes="sm:col-span-3"/>
|
<x-form.field name="city" label="City" div_classes="sm:col-span-3"/>
|
||||||
<x-auth.form-field name="state" label="State" div_classes="sm:col-span-2"/>
|
<x-form.field name="state" label="State" div_classes="sm:col-span-2"/>
|
||||||
<x-auth.form-field name="zip" label="Zip" div_classes="sm:col-span-1"/>
|
<x-form.field name="zip" label="Zip" div_classes="sm:col-span-1"/>
|
||||||
</x-auth.form-card>
|
</x-form.card>
|
||||||
|
|
||||||
</x-layout.page-section>
|
</x-layout.page-section>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,17 @@
|
||||||
section_description=""
|
section_description=""
|
||||||
:first="true">
|
:first="true">
|
||||||
|
|
||||||
<x-auth.form-card
|
<x-form.card
|
||||||
submit-button-text="Update School"
|
submit-button-text="Update School"
|
||||||
method="PATCH"
|
method="PATCH"
|
||||||
action="/schools/{{ $school->id }}"
|
action="/schools/{{ $school->id }}"
|
||||||
>
|
>
|
||||||
<x-auth.form-field name="name" label="School Name" value="{{ $school->name }}" div_classes="sm:col-span-6"/>
|
<x-form.field name="name" label="School Name" value="{{ $school->name }}" div_classes="sm:col-span-6"/>
|
||||||
<x-auth.form-field name="address" label="School Address" value="{{ $school->address }}" div_classes="sm:col-span-6"/>
|
<x-form.field name="address" label="School Address" value="{{ $school->address }}" div_classes="sm:col-span-6"/>
|
||||||
<x-auth.form-field name="city" label="City" value="{{ $school->city }}" div_classes="sm:col-span-3"/>
|
<x-form.field name="city" label="City" value="{{ $school->city }}" div_classes="sm:col-span-3"/>
|
||||||
<x-auth.form-field name="state" label="State" value="{{ $school->state }}" div_classes="sm:col-span-2"/>
|
<x-form.field name="state" label="State" value="{{ $school->state }}" div_classes="sm:col-span-2"/>
|
||||||
<x-auth.form-field name="zip" label="Zip" value="{{ $school->zip }}" div_classes="sm:col-span-1"/>
|
<x-form.field name="zip" label="Zip" value="{{ $school->zip }}" div_classes="sm:col-span-1"/>
|
||||||
</x-auth.form-card>
|
</x-form.card>
|
||||||
|
|
||||||
</x-layout.page-section>
|
</x-layout.page-section>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@
|
||||||
<x-layout.page-section>
|
<x-layout.page-section>
|
||||||
<x-slot:section_name>Create Student</x-slot:section_name>
|
<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-slot:section_description>Student full names must be unique. Add a middle initial to the first name if necessary.</x-slot:section_description>
|
||||||
<x-auth.form-card method="POST" action="/students/create" submit-button-text="Create Student" >
|
<x-form.card method="POST" action="/students/create" submit-button-text="Create Student" >
|
||||||
<x-auth.form-field name="first_name" label="First Name" div_classes="sm:col-span-3" required />
|
<x-form.field name="first_name" label="First Name" div_classes="sm:col-span-3" required />
|
||||||
<x-auth.form-field name="last_name" label="Last 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-auth.form-card>
|
</x-form.card>
|
||||||
</x-layout.page-section>
|
</x-layout.page-section>
|
||||||
</x-layout.app>
|
</x-layout.app>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<div class="overflow-hidden rounded-lg bg-white shadow mt-4">
|
<div class="overflow-hidden rounded-lg bg-white shadow mt-4">
|
||||||
<div class="px-4 py-5 sm:p-6">
|
<div class="px-4 py-5 sm:p-6">
|
||||||
<x-auth.form-button href="/login" class="px-40">Login</x-auth.form-button>
|
<x-form.button href="/login" class="px-40">Login</x-form.button>
|
||||||
<x-auth.form-button href="/register" class="px-40 mt-3">Create Account</x-auth.form-button>
|
<x-form.button href="/register" class="px-40 mt-3">Create Account</x-form.button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue