some initial work on New Table page

pull/26/head
Ondřej Hruška 6 years ago
parent eeaa837c29
commit ba721592cd
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 14
      app/Exceptions/ViewException.php
  2. 14
      app/Http/Controllers/TableController.php
  3. 85
      resources/views/table/create.blade.php
  4. 2
      vendor_patches/07_view_error_debug.patch

@ -0,0 +1,14 @@
<?php
namespace FlowBox\Exceptions;
class ViewException extends FBRuntimeException
{
public $captured;
public function __construct(\Exception $cause, $captured)
{
$this->captured = $captured;
parent::__construct($cause);
}
}

@ -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')
);
}
}

@ -3,9 +3,90 @@
@section('content')
<div class="container">
<div class="row justify-content-center">
{{-- Dash card --}}
<div class="col-md-8">
asdf
<div class="row form-group">
<label for="table-name" class="col-md-3 col-form-label text-md-right">Title</label>
<input id="table-name" name="table-name" class="form-control col-md-8" value="{{old('table-name')}}">
@if ($errors->has('table-name'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('table-name') }}</strong>
</span>
@endif
</div>
<div class="row form-group">
<label for="table-descr" class="col-md-3 col-form-label text-md-right">Description</label>
<textarea id="table-descr" name="table-descr" class="form-control col-md-8" style="height: 6em">{{--
--}}{{old('table-descr')}}{{--
--}}</textarea>
@if ($errors->has('table-descr'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('table-descr') }}</strong>
</span>
@endif
</div>
<div class="row form-group">
<label for="license" class="col-md-3 col-form-label text-md-right">License</label>
<input id="license" name="license" class="form-control col-md-8" value="{{old('license')}}">
@if ($errors->has('license'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('license', 'CC0') }}</strong>
</span>
@endif
</div>
<div class="row form-group">
<label for="upstream" class="col-md-3 col-form-label text-md-right">Adapted from</label>
<input id="upstream" name="upstream" class="form-control col-md-8" value="{{old('upstream')}}">
@if ($errors->has('upstream'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('upstream') }}</strong>
</span>
@endif
</div>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-8">
<p>Insert the initial table definition and data in CSV format. Columns are defined as CSV rows:</p>
<ul>
<li>type (int, string, float, bool)
<li>column identifier (letters, numbers, and underscore only)
<li>user-friendly column title
</ul>
</div>
</div>
<div class="row form-group">
<label for="col-spec" class="col-md-3 col-form-label text-md-right">Columns specification</label>
<textarea id="col-spec" name="col-spec" class="form-control col-md-8" style="height: 6em">{{--
--}}{{old('col-spec', $exampleColSpec)}}{{--
--}}</textarea>
@if ($errors->has('col-spec'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('col-spec') }}</strong>
</span>
@endif
</div>
<div class="row">
<label for="row-data" class="col-md-3 col-form-label text-md-right">Initial data</label>
<textarea id="row-data" name="row-data" class="form-control col-md-8" style="height: 16em">{{--
--}}{{old('row-data', $exampleData)}}{{--
--}}</textarea>
@if ($errors->has('row-data'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('row-data') }}</strong>
</span>
@endif
</div>
</div>
</div>
</div>

@ -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);
}
}

Loading…
Cancel
Save