From 5dfa9f2dccd8960b15a5a19c25c80f849d03a5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ro=C3=ABl=20Gonzalez?= Date: Sun, 16 Aug 2020 14:00:05 +0200 Subject: [PATCH] add import template and styling --- .../TemplateDownloadController.php | 13 +++++++++ config/filesystems.php | 5 ++++ .../livewire/bookable-flight-import.blade.php | 24 +++++++++++++++-- resources/views/office-events/show.blade.php | 27 ++++++++++--------- routes/tenant.php | 2 ++ storage/app/.gitignore | 1 + storage/app/flights-template.csv | 3 +++ 7 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 app/Http/Controllers/TemplateDownloadController.php create mode 100644 storage/app/flights-template.csv diff --git a/app/Http/Controllers/TemplateDownloadController.php b/app/Http/Controllers/TemplateDownloadController.php new file mode 100644 index 0000000..d187ddf --- /dev/null +++ b/app/Http/Controllers/TemplateDownloadController.php @@ -0,0 +1,13 @@ +download('flights-template.csv'); + } +} diff --git a/config/filesystems.php b/config/filesystems.php index 94c8112..17a3838 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -48,6 +48,11 @@ 'root' => storage_path('app'), ], + 'central-local' => [ + 'driver' => 'local', + 'root' => storage_path('app'), + ], + 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), diff --git a/resources/views/livewire/bookable-flight-import.blade.php b/resources/views/livewire/bookable-flight-import.blade.php index f5c4b63..0bedeb3 100644 --- a/resources/views/livewire/bookable-flight-import.blade.php +++ b/resources/views/livewire/bookable-flight-import.blade.php @@ -1,7 +1,27 @@
+
+ An easier way to add flights to your event is to import them from a spreadsheet. comma separated values files (csv) are supported for import. +
+ You can download the template of the spreadsheet below. +
+ Each row will represent one flight. Make sure to follow the format given in the template. +
+ When you have populated the spreadsheet with your flights, you can upload the file here and have them imported. +

+ Important Notes: +
+ All times are given in zulu format and should only contain digits! E.g. 0300 or 1500 and NOT 12:00pm or 14:30am. +
+ If you leave the date columns empty, the date for the booking will be the same as the event date! +
+ All dates are given in the following format: yyyy-mm-dd e.g 2020-12-31 +
+
- - + + @error('file')
{{ $message }} diff --git a/resources/views/office-events/show.blade.php b/resources/views/office-events/show.blade.php index 1b95191..a12ceb4 100644 --- a/resources/views/office-events/show.blade.php +++ b/resources/views/office-events/show.blade.php @@ -72,20 +72,23 @@ class="px-4">

Bookables actions


-
- @livewire('bookable-flight-import', ['event' => $event]) -
-
-
- +
+
+
+ +
+
+ +
-
- +
+
-
-
- @livewire('add-bookable-flight', ['event' => $event]) -
+
+ @livewire('add-bookable-flight', ['event' => $event]) +
+
+ @livewire('bookable-flight-import', ['event' => $event])
diff --git a/routes/tenant.php b/routes/tenant.php index 29b2765..cb944ea 100644 --- a/routes/tenant.php +++ b/routes/tenant.php @@ -42,6 +42,8 @@ Route::get('/home', 'HomeController@index')->name('home'); + Route::get('templates/flight-template')->uses(TemplateDownloadController::class . '@flightTemplate')->name('download-flight-template'); + Route::get('office')->uses(OfficeController::class. '@index')->name('office.index'); Route::get('office/events/create')->uses(OfficeEventController::class . '@create')->name('office-events.create'); Route::get('office/events')->uses(OfficeEventController::class . '@index')->name('office-events.index'); diff --git a/storage/app/.gitignore b/storage/app/.gitignore index 8f4803c..5d092c8 100644 --- a/storage/app/.gitignore +++ b/storage/app/.gitignore @@ -1,3 +1,4 @@ * !public/ !.gitignore +!flights-template.csv diff --git a/storage/app/flights-template.csv b/storage/app/flights-template.csv new file mode 100644 index 0000000..579fa96 --- /dev/null +++ b/storage/app/flights-template.csv @@ -0,0 +1,3 @@ +Departure Date,Departure Time,Arrival Date,Arrival Time,Origin Airport ICAO,Destination Airport ICAO,Callsign +2020-12-31,1300,2020-12-31,1900,KJFK,EGLL,AAL123 +,2300,,0200,EHAM,GTCS,RYR12AB