diff --git a/app/Facades/WidgetFacade.php b/app/Facades/WidgetFacade.php
new file mode 100644
index 0000000..cc1bce1
--- /dev/null
+++ b/app/Facades/WidgetFacade.php
@@ -0,0 +1,15 @@
+middleware('auth');
- }
-
/**
* Show the application dashboard.
*
diff --git a/app/Http/Controllers/TableController.php b/app/Http/Controllers/TableController.php
index b7c509e..fcfcf4e 100644
--- a/app/Http/Controllers/TableController.php
+++ b/app/Http/Controllers/TableController.php
@@ -14,9 +14,9 @@ class TableController extends Controller
public function create()
{
$exampleColSpec =
- "string, latin, Latin Name\n".
- "string, common, Common Name\n".
- "int, lifespan, Lifespan";
+ "latin, string, Latin Name\n".
+ "common, string, Common Name\n".
+ "lifespan, int, Lifespan (years)";
$exampleData =
"Mercenaria mercenaria, hard clam, 40\n" .
@@ -27,4 +27,18 @@ class TableController extends Controller
compact('exampleColSpec', 'exampleData')
);
}
+
+ public function storeNew(Request $request)
+ {
+ $this->validate($request, [
+ 'table-name' => 'required',
+ 'table-descr' => 'string|nullable',
+ 'license' => 'string|nullable',
+ 'upstream' => 'string|nullable',
+ 'col-spec' => 'required',
+ 'row-data' => 'string|nullable',
+ ]);
+
+ return "Ok.";
+ }
}
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 3dc7939..95e9b5f 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -2,6 +2,7 @@
namespace App\Providers;
+use App\View\WidgetFactory;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@@ -25,6 +26,8 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
- //
+ $this->app->singleton(WidgetFactory::class, function () {
+ return new WidgetFactory();
+ });
}
}
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 5ea48d3..69772c1 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -53,7 +53,11 @@ class RouteServiceProvider extends ServiceProvider
{
Route::middleware('web')
->namespace($this->namespace)
- ->group(base_path('routes/web.php'));
+ ->group(base_path('routes/public.php'));
+
+ Route::middleware(['web', 'auth'])
+ ->namespace($this->namespace)
+ ->group(base_path('routes/user.php'));
}
/**
diff --git a/app/View/Widget.php b/app/View/Widget.php
new file mode 100644
index 0000000..41527ab
--- /dev/null
+++ b/app/View/Widget.php
@@ -0,0 +1,108 @@
+id = 'field-'.$name;
+ $this->name = $name;
+ $this->label = $label;
+ $this->viewName = $viewName;
+ }
+
+ // setting attributes via magic method
+ public function __call($method, $args)
+ {
+ static $cssProps = [
+ 'height', 'minHeight', 'maxHeight'
+ ];
+
+ if (empty($args)) $args = [''];
+
+ $arg = $args[0];
+
+ // css
+ $lccamel = $method;
+ if (in_array($lccamel, $cssProps)) {
+ return $this->css(kebab_case($lccamel), $arg);
+ }
+
+ if (property_exists($this, $method)) {
+ $this->$method = $arg;
+ }
+ else {
+ $this->attributes[$method] = $arg;
+ }
+
+ return $this;
+ }
+
+ public function css($prop, $val)
+ {
+ $this->style[$prop] = $val;
+ return $this;
+ }
+
+ public function __get($name)
+ {
+ if ($name == 'attributes') {
+ return $this->compileAttribs();
+ }
+
+ if ($name == 'value') {
+ return old($this->name, $this->value);
+ }
+
+ if (property_exists($this, $name)) {
+ return $this->$name;
+ }
+
+ return null;
+ }
+
+ public function compileAttribs()
+ {
+ // compile attribs string
+ $attribs_s = array_reduce(array_keys($this->attributes), function ($carry, $key) {
+ return $carry . ' ' . $key . '="' . e($this->attributes[$key]) . '"';
+ }, '');
+
+ // add a compiled list of styles
+ if (!empty($this->style)) {
+ $attribs_s .= 'style="'.trim(e(array_reduce(array_keys($this->style), function ($carry, $key) {
+ return $carry . $key . ': ' . $this->style[$key] . '; ';
+ }, ''))).'"';
+ }
+
+ return trim($attribs_s);
+ }
+
+ public function render()
+ {
+ return view('form.'.$this->viewName)->with(['w' => $this]);
+ }
+
+ public function __toString()
+ {
+ return (string) $this->render();
+ }
+}
diff --git a/app/View/WidgetFactory.php b/app/View/WidgetFactory.php
new file mode 100644
index 0000000..6d08ef7
--- /dev/null
+++ b/app/View/WidgetFactory.php
@@ -0,0 +1,27 @@
+minHeight('4em');
+ }
+}
diff --git a/config/app.php b/config/app.php
index b2b1b29..199b8ff 100644
--- a/config/app.php
+++ b/config/app.php
@@ -217,6 +217,7 @@ return [
// sideload
'SocialAuth' => AdamWathan\EloquentOAuth\Facades\OAuth::class,
+ 'Widget' => App\Facades\WidgetFacade::class,
],
// -------------- added keys --------------
diff --git a/public/fonts/fa-dtbl-1-preview.html b/public/fonts/fa-dtbl-1-preview.html
new file mode 100644
index 0000000..0fa4298
--- /dev/null
+++ b/public/fonts/fa-dtbl-1-preview.html
@@ -0,0 +1,386 @@
+
+
+
+ fa-dtbl-1 glyphs preview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+ PpPpPpPpPpPpPpPpPpPp
+
+
+ 12141618212436486072
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/fonts/fa-dtbl-1.css b/public/fonts/fa-dtbl-1.css
index fe8f918..138f940 100644
--- a/public/fonts/fa-dtbl-1.css
+++ b/public/fonts/fa-dtbl-1.css
@@ -38,10 +38,15 @@
font-smoothing: antialiased;
}
-.fa-facebook-square::before { content: "\f100"; }
-.fa-github::before { content: "\f101"; }
-.fa-google::before { content: "\f102"; }
-.fa-sign-in::before { content: "\f103"; }
-.fa-sign-out::before { content: "\f104"; }
-.fa-user-circle-o::before { content: "\f105"; }
-.fa-user-plus::before { content: "\f106"; }
+.fa-check::before { content: "\f100"; }
+.fa-facebook-square::before { content: "\f101"; }
+.fa-floppy-o::before, .fa-save::before { content: "\f102"; }
+.fa-github::before { content: "\f103"; }
+.fa-google::before { content: "\f104"; }
+.fa-question-circle::before { content: "\f105"; }
+.fa-sign-in::before { content: "\f106"; }
+.fa-sign-out::before { content: "\f107"; }
+.fa-times::before, .fa-close::before { content: "\f108"; }
+.fa-trash-o::before { content: "\f109"; }
+.fa-user-circle-o::before { content: "\f10a"; }
+.fa-user-plus::before { content: "\f10b"; }
diff --git a/public/fonts/fa-dtbl-1.eot b/public/fonts/fa-dtbl-1.eot
index 1aedfba..3cea901 100644
Binary files a/public/fonts/fa-dtbl-1.eot and b/public/fonts/fa-dtbl-1.eot differ
diff --git a/public/fonts/fa-dtbl-1.svg b/public/fonts/fa-dtbl-1.svg
index 27b577e..cb7fc6f 100644
--- a/public/fonts/fa-dtbl-1.svg
+++ b/public/fonts/fa-dtbl-1.svg
@@ -1,11 +1,11 @@