diff --git a/app/Exceptions/ViewException.php b/app/Exceptions/ViewException.php new file mode 100644 index 0000000..5c21332 --- /dev/null +++ b/app/Exceptions/ViewException.php @@ -0,0 +1,14 @@ +captured = $captured; + parent::__construct($cause); + } +} diff --git a/app/Http/Controllers/TableController.php b/app/Http/Controllers/TableController.php index 576478c..b7c509e 100644 --- a/app/Http/Controllers/TableController.php +++ b/app/Http/Controllers/TableController.php @@ -13,6 +13,18 @@ class TableController extends Controller */ public function create() { - return view('table.create'); + $exampleColSpec = + "string, latin, Latin Name\n". + "string, common, Common Name\n". + "int, lifespan, Lifespan"; + + $exampleData = + "Mercenaria mercenaria, hard clam, 40\n" . + "Magallana gigas, pacific oyster, 30\n" . + "Patella vulgata, common limpet, 20"; + + return view('table.create', + compact('exampleColSpec', 'exampleData') + ); } } diff --git a/resources/views/table/create.blade.php b/resources/views/table/create.blade.php index 905decf..a3a8783 100644 --- a/resources/views/table/create.blade.php +++ b/resources/views/table/create.blade.php @@ -3,9 +3,90 @@ @section('content')
- {{-- Dash card --}}
- asdf +
+ + + + @if ($errors->has('table-name')) + + {{ $errors->first('table-name') }} + + @endif +
+ +
+ + + + @if ($errors->has('table-descr')) + + {{ $errors->first('table-descr') }} + + @endif +
+ +
+ + + + @if ($errors->has('license')) + + {{ $errors->first('license', 'CC0') }} + + @endif +
+ +
+ + + + @if ($errors->has('upstream')) + + {{ $errors->first('upstream') }} + + @endif +
+ +
+
+
+

Insert the initial table definition and data in CSV format. Columns are defined as CSV rows:

+
    +
  • type (int, string, float, bool) +
  • column identifier (letters, numbers, and underscore only) +
  • user-friendly column title +
+
+
+ +
+ + + + @if ($errors->has('col-spec')) + + {{ $errors->first('col-spec') }} + + @endif +
+ +
+ + + + @if ($errors->has('row-data')) + + {{ $errors->first('row-data') }} + + @endif +
diff --git a/vendor_patches/07_view_error_debug.patch b/vendor_patches/07_view_error_debug.patch index ddcc05b..974db8b 100644 --- a/vendor_patches/07_view_error_debug.patch +++ b/vendor_patches/07_view_error_debug.patch @@ -16,6 +16,6 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP } - throw $e; -+ throw new \App\Exceptions\ViewException($e, $buffered); ++ throw new \MightyPork\Exceptions\ViewException($e, $buffered); } }