@extends('layouts.app')
@section('title', 'Edit Site')
@section('content')
<div class="card">
    <div class="card-header pb-0 d-flex justify-content-between"><h6>Edit — {{ $site->name }}</h6>
        @if(auth()->user()->isAdmin())
        <form action="{{ route('sites.destroy', $site) }}" method="POST" onsubmit="return confirm('Delete this site?')">@csrf @method('DELETE')<button class="btn btn-outline-danger btn-sm mb-0">Delete</button></form>@endif
    </div>
    <form action="{{ route('sites.update', $site) }}" method="POST">@csrf @method('PUT')
        <div class="card-body">@include('sites._form')</div>
        <div class="card-footer text-end"><a href="{{ route('sites.show', $site) }}" class="btn btn-outline-secondary btn-sm">Cancel</a><button class="btn btn-primary btn-sm">Save</button></div>
    </form>
</div>
@endsection
