|
| 1 | +@extends('statamic::layout') |
| 2 | + |
| 3 | +@section('title', __('Detours - Actions')) |
| 4 | + |
| 5 | +@section('content') |
| 6 | +<div class="max-w-3xl mx-auto space-y-6"> |
| 7 | + <h1> |
| 8 | + {{ __('Import & Export Detours') }} |
| 9 | + </h1> |
| 10 | + |
| 11 | + <div class="bg-white shadow-sm ring-1 ring-gray-200 rounded-lg p-6"> |
| 12 | + <h2 class="text-lg font-semibold text-gray-900">{{ __('Upload file') }}</h2> |
| 13 | + <p class="mt-1 text-sm text-gray-600"> |
| 14 | + {{ __('Upload a CSV to be imported.')}} |
| 15 | + </p> |
| 16 | + |
| 17 | + @if (session('status')) |
| 18 | + <div class="mt-4 rounded-md bg-green-50 px-4 py-3 text-sm text-green-800 ring-1 ring-green-200"> |
| 19 | + {{ session('status') }} |
| 20 | + </div> |
| 21 | + @endif |
| 22 | + |
| 23 | + @if ($errors->any()) |
| 24 | + <div class="mt-4 rounded-md bg-red-50 px-4 py-3 text-sm text-red-800 ring-1 ring-red-200"> |
| 25 | + <ul class="list-disc pl-5 space-y-1"> |
| 26 | + @foreach ($errors->all() as $error) |
| 27 | + <li>{{ $error }}</li> |
| 28 | + @endforeach |
| 29 | + </ul> |
| 30 | + </div> |
| 31 | + @endif |
| 32 | + |
| 33 | + <form method="POST" action="{{ cp_route('justbetter.detours.actions.import') }}" enctype="multipart/form-data" class="mt-6 space-y-4"> |
| 34 | + @csrf |
| 35 | + |
| 36 | + <div> |
| 37 | + <label for="file" class="block text-sm font-medium text-gray-900">{{ __('Choose file') }}</label> |
| 38 | + <div class="mt-2"> |
| 39 | + <input |
| 40 | + id="file" |
| 41 | + name="file" |
| 42 | + type="file" |
| 43 | + class="block w-full text-sm text-gray-900 file:mr-4 file:rounded-md file:border-0 file:bg-gray-100 file:px-4 file:py-2 file:text-sm file:font-semibold file:text-gray-800 hover:file:bg-gray-200 rounded-md border border-gray-300 bg-white px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" |
| 44 | + required |
| 45 | + /> |
| 46 | + </div> |
| 47 | + </div> |
| 48 | + |
| 49 | + <div class="flex items-center gap-3"> |
| 50 | + <button |
| 51 | + type="submit" |
| 52 | + class="btn btn-primary" |
| 53 | + > |
| 54 | + {{ __('Upload') }} |
| 55 | + </button> |
| 56 | + </div> |
| 57 | + </form> |
| 58 | + </div> |
| 59 | + |
| 60 | + <div class="bg-white shadow-sm ring-1 ring-gray-200 rounded-lg p-6"> |
| 61 | + <h2 class="text-lg font-semibold text-gray-900">{{ __('Export') }}</h2> |
| 62 | + <p class="mt-1 text-sm text-gray-600"> |
| 63 | + {{ __('Generate and download an export file.') }} |
| 64 | + </p> |
| 65 | + |
| 66 | + <div class="mt-6 flex flex-col sm:flex-row gap-3"> |
| 67 | + <a |
| 68 | + href="{{ cp_route('justbetter.detours.actions.export') }}" |
| 69 | + class="btn btn-primary" |
| 70 | + > |
| 71 | + {{ __('Download CSV') }} |
| 72 | + </a> |
| 73 | + </div> |
| 74 | +</div> |
| 75 | + |
| 76 | +</div> |
| 77 | +@endsection |
0 commit comments