diff options
author | Mateja <mail@matejamaric.com> | 2020-11-01 15:11:39 +0100 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2020-11-01 15:11:39 +0100 |
commit | 3e5dc09d0010078568f8590daef1f95722a4dd05 (patch) | |
tree | 3d3d5992a2462b82cb1869c68853b02daeed113b | |
parent | 590ecae90b0d03cd03507ca88e29a0ed4c28e5c1 (diff) | |
download | yota-laravel-3e5dc09d0010078568f8590daef1f95722a4dd05.tar.gz yota-laravel-3e5dc09d0010078568f8590daef1f95722a4dd05.zip |
Work on callsigns.
-rw-r--r-- | app/Http/Controllers/SpecialCallsController.php | 3 | ||||
-rw-r--r-- | resources/views/layouts/app.blade.php | 3 | ||||
-rw-r--r-- | resources/views/pages/callsigns.blade.php | 45 |
3 files changed, 48 insertions, 3 deletions
diff --git a/app/Http/Controllers/SpecialCallsController.php b/app/Http/Controllers/SpecialCallsController.php index 6f173b9..72da6b9 100644 --- a/app/Http/Controllers/SpecialCallsController.php +++ b/app/Http/Controllers/SpecialCallsController.php @@ -97,7 +97,8 @@ class SpecialCallsController extends Controller public function add(Request $request) { - return view('pages.callsigns'); + $data = SpecialCall::all(); + return view('pages.callsigns', compact('data')); } public function addForm(Request $request) diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index a85d43a..8d2d01a 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -5,8 +5,8 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="{{ asset('css/app.css') }}" type="text/css"> - <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> + @yield('styles') <title>YOTA - @yield('title')</title> </head> @@ -19,5 +19,6 @@ <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> + @yield('scripts') </body> </html> diff --git a/resources/views/pages/callsigns.blade.php b/resources/views/pages/callsigns.blade.php index 7866a1f..19dc984 100644 --- a/resources/views/pages/callsigns.blade.php +++ b/resources/views/pages/callsigns.blade.php @@ -5,5 +5,48 @@ @section('navbar', View::make('inc.special_navbar')) @section('content') - <strong>CALLSIGNS ADMINISTRATION</strong> + <h3>Callsigns Administration:</h3> + @if (count($data) > 0) + <div class="p-0 mr-0 mt-3 col-lg-6 table-responsive"> + <table class="table table-bordered"> + @foreach ($data as $row) + <tr> + <td class="align-middle">{{ $row->sign }}</td> + <td><button class="btn btn-warning">Edit</button></td> + <td><button class="btn btn-danger">Delete</button></td> + </tr> + @endforeach + </table> + </div> + @endif + + <h3 class="mt-4">Add Callsign:</h3> + <form action="{{ route('addSignForm') }}" method="POST"> + @csrf + <div class="form-group"> + <label for="Sign">Special Callsign:</label> + <input type="text" name="sign" value="" id="Sign" class="form-control"> + </div> + <div class="form-group"> + <label for="editor">Description:</label> + <textarea name="description" id="editor" class="form-control"></textarea> + </div> + <div class="form-group"> + <input type="submit" name="submit" value="Add callsign" class="btn btn-primary"> + </div> + </form> +@endsection + +@section('scripts') +<script src="https://cdn.ckeditor.com/ckeditor5/23.1.0/classic/ckeditor.js"></script> +<script> +ClassicEditor + .create( document.querySelector( '#editor' ) ) + .then( editor => { + console.log( editor ); + } ) + .catch( error => { + console.error( error ); + } ); +</script> @endsection |