diff --git a/app/Http/Controllers/FormController.php b/app/Http/Controllers/FormController.php index a2992e5..32f1d7f 100644 --- a/app/Http/Controllers/FormController.php +++ b/app/Http/Controllers/FormController.php @@ -6,5 +6,10 @@ use Illuminate\Http\Request; class FormController extends Controller { - // + + public function index() + { + return view('dashboard.administration.forms'); + } + } diff --git a/config/adminlte.php b/config/adminlte.php index 1cbea8c..071ead4 100644 --- a/config/adminlte.php +++ b/config/adminlte.php @@ -355,6 +355,17 @@ return [ ], ], ], + [ + 'name' => 'FormBuilder', + 'active' => true, + 'files' => [ + [ + 'type' => 'js', + 'asset' => false, + 'location' => '/js/formbuilder.js' + ] + ] + ], [ 'name' => 'Select2', 'active' => false, diff --git a/public/js/formbuilder.js b/public/js/formbuilder.js new file mode 100644 index 0000000..fda4bf1 --- /dev/null +++ b/public/js/formbuilder.js @@ -0,0 +1,18 @@ +$(document).ready(function() { + $("#add").click(function() { + var lastField = $("#buildyourform div:last"); + var intId = (lastField && lastField.length && lastField.data("idx") + 1) || 1; + var fieldWrapper = $("
"); + fieldWrapper.data("idx", intId); + var fName = $(""); + var fType = $(""); + var removeButton = $(""); + removeButton.click(function() { + $(this).parent().remove(); + }); + fieldWrapper.append(fName); + fieldWrapper.append(fType); + fieldWrapper.append(removeButton); + $("#buildyourform").append(fieldWrapper); + }); +}); diff --git a/resources/views/dashboard/administration/forms.blade.php b/resources/views/dashboard/administration/forms.blade.php new file mode 100644 index 0000000..0ae9c46 --- /dev/null +++ b/resources/views/dashboard/administration/forms.blade.php @@ -0,0 +1,44 @@ +@extends('adminlte::page') + +@section('title', 'Raspberry Network | Application Form Management Tool') + +@section('content_header') + +

Administration / Form Builder

+ +@stop + +@section('content') + +
+ +
+ +
+ +
+ +
+ Form Builder +
+ +
+ +
+ + +
+ + + +
+ +
+ +
+ +@stop