118 lines
6.6 KiB
PHP
118 lines
6.6 KiB
PHP
<div x-data="{ showAddDirectorForm: false, changeHeadDirectorForm: false}">
|
|
<x-layout.app>
|
|
<x-slot:page_title>School Info - {{ $school->name }}</x-slot:page_title>
|
|
|
|
<div class="mx-auto max-w-xl">
|
|
<x-card.card>
|
|
<x-card.info.body>
|
|
<x-card.info.row row_name="School Address">
|
|
<div class="md:grid md:grid-cols-3">
|
|
<div class="md:col-span-2">
|
|
{{ $school->name }}<br />
|
|
{{ $school->address }}<br />
|
|
{{ $school->city }}, {{ $school->state }} {{ $school->zip }}
|
|
</div>
|
|
<div class="text-indigo-600">
|
|
<a href="/schools/{{$school->id}}/edit"> [ Edit School ] </a>
|
|
</div>
|
|
</div>
|
|
</x-card.info.row>
|
|
|
|
<x-card.info.row row_name="Directors">
|
|
<ul>
|
|
@foreach($school->directors as $director)
|
|
<li>
|
|
{{ $director->full_name() }}
|
|
@if($director->hasFlag('head_director')) <span class="font-semibold">(head)</span> @endif
|
|
-
|
|
<a class='text-indigo-600' href="mailto:{{ $director->email }}">{{ $director->email }}</a>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
@if(auth()->user()->hasFlag('head_director'))
|
|
<div class="grid grid-cols-2 gap-2 mt-3">
|
|
<x-form.button type="button" @click="showAddDirectorForm=true">Add Director</x-form.button>
|
|
<x-form.button type="button" @click="changeHeadDirectorForm=true">Change Head</x-form.button>
|
|
</div>
|
|
@endif
|
|
</x-card.info.row>
|
|
@if(auth()->user()->hasFlag('head_director'))
|
|
<x-card.info.row row_name="Associated Email Domains">
|
|
<p class="text-sm text-gray-400 border-b">Users with emails in these domains (the part after the @) that don't already have a school
|
|
will be able to join your school.</p>
|
|
<ul>
|
|
@foreach($school->emailDomains as $domain)
|
|
<li class="flex my-2">
|
|
<a href="{{route('schools.delete_domain',$domain)}}">
|
|
<x-icons.circled-x color="red" />
|
|
</a>
|
|
{{ $domain->domain }}
|
|
</li>
|
|
@endforeach
|
|
<li class="border-t">
|
|
<p class="text-base">Add Domain</p>
|
|
<x-form.form method="post" action="{{route('schools.add_domain',$school)}}" class="-ml-8">
|
|
<div class="grid grid-cols-3">
|
|
<x-form.field name="domain" label_text="Domain (do not include @)" colspan="2" />
|
|
<x-form.button class="mt-6 ml-2">Add</x-form.button>
|
|
</div>
|
|
</x-form.form>
|
|
</li>
|
|
</ul>
|
|
</x-card.info.row>
|
|
@endif
|
|
</x-card.info.body>
|
|
</x-card.card>
|
|
</div>
|
|
|
|
</x-layout.app>
|
|
|
|
@if(auth()->user()->hasFlag('head_director'))
|
|
<x-modal-body showVar="showAddDirectorForm">
|
|
<x-slot:title>Add Director</x-slot:title>
|
|
<x-form.form method="POST" action="{{route('schools.add_director', $school)}}">
|
|
<x-form.body-grid>
|
|
<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="email" type="email" label_text="Email Address" colspan="3" />
|
|
<x-form.field name="cell_phone" label_text="Cell Phone" colspan="3" />
|
|
<x-form.field name="judging_preference" label_text="Judging Preference" colspan="6" />
|
|
</x-form.body-grid>
|
|
<x-form.footer submit-button-text="Add Director" />
|
|
</x-form.form>
|
|
</x-modal-body>
|
|
|
|
<x-modal-body showVar="changeHeadDirectorForm">
|
|
<x-slot:title>Change Head Director</x-slot:title>
|
|
{{-- Warming Message --}}
|
|
<div class="rounded-md bg-red-50 p-4">
|
|
<div class="flex">
|
|
<div class="flex-shrink-0">
|
|
<svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd" />
|
|
</svg>
|
|
</div>
|
|
<div class="ml-3">
|
|
<h3 class="text-sm font-medium text-red-800">WARNING!!!</h3>
|
|
<div class="mt-2 text-sm text-red-700">
|
|
<p>After making another director head, you will no longer have access to head director functions</p>
|
|
<p>This action cannot be undone</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p class="mt-3 border-b border-t py-3">Which director should be the head director at {{$school->name}}? (click to set)</p>
|
|
<x-card.list.body>
|
|
@foreach($school->directors as $director)
|
|
@continue($director->id === auth()->user()->id)
|
|
<x-card.list.row>
|
|
<a href="{{route('schools.set_head_director',['school'=>$school,'user'=>$director])}}">
|
|
{{ $director->full_name() }} < {{$director->email }} >
|
|
</a>
|
|
</x-card.list.row>
|
|
@endforeach
|
|
</x-card.list.body>
|
|
</x-modal-body>
|
|
@endif
|
|
</div>
|