From abe4a9dda9ea7e72872b64654c455915974ea5be Mon Sep 17 00:00:00 2001 From: Neerholt Date: Fri, 9 Apr 2021 11:23:52 +0200 Subject: [PATCH] v1.5.8 Added model, but there is some problems. --- .../app/Http/Controllers/EventController.php | 2 +- skolehjem/public/css/admin.css | 50 ++++++++++++++ skolehjem/resources/sass/admin/admin.scss | 3 + .../resources/sass/admin/modal/modal.scss | 38 +++++++++++ .../views/admin/guides/create.blade.php | 31 --------- .../views/admin/news/index.blade.php | 68 +++++++++++++------ 6 files changed, 139 insertions(+), 53 deletions(-) create mode 100644 skolehjem/resources/sass/admin/modal/modal.scss diff --git a/skolehjem/app/Http/Controllers/EventController.php b/skolehjem/app/Http/Controllers/EventController.php index 040c842..0fb8c8d 100644 --- a/skolehjem/app/Http/Controllers/EventController.php +++ b/skolehjem/app/Http/Controllers/EventController.php @@ -288,7 +288,7 @@ class EventController extends Controller } public function previewPages(Request $request){ - $event = Event::find($request->preview)->only("accountable", "description", "name", "date"); + $event = Event::find($request->preview); $convertToJsonArray = json_encode($event); return $convertToJsonArray; } diff --git a/skolehjem/public/css/admin.css b/skolehjem/public/css/admin.css index c78133e..d57c3ae 100644 --- a/skolehjem/public/css/admin.css +++ b/skolehjem/public/css/admin.css @@ -6907,6 +6907,56 @@ nav > .pagination { overflow: hidden; } +.modal { + display: none; + /* Hidden by default */ + position: fixed; + /* Stay in place */ + z-index: 1; + /* Sit on top */ + padding-top: 100px; + /* Location of the box */ + left: 0; + top: 0; + width: 100%; + /* Full width */ + height: 100%; + /* Full height */ + overflow: auto; + /* Enable scroll if needed */ + background-color: black; + /* Fallback color */ + background-color: rgba(0, 0, 0, 0.4); + /* Black w/ opacity */ +} + +/* Modal Content */ + +.modal-content { + background-color: #fefefe; + margin: auto; + padding: 20px; + border: 1px solid #888; + width: 330px; + min-width: 400px; +} + +/* The Close Button */ + +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; +} + .tbl { border-collapse: collapse; width: 100%; diff --git a/skolehjem/resources/sass/admin/admin.scss b/skolehjem/resources/sass/admin/admin.scss index 27f01b1..0a0f11d 100644 --- a/skolehjem/resources/sass/admin/admin.scss +++ b/skolehjem/resources/sass/admin/admin.scss @@ -17,5 +17,8 @@ // Content @import 'content/content'; +// Modal +@import 'modal/modal'; + // Tables @import "content/table"; diff --git a/skolehjem/resources/sass/admin/modal/modal.scss b/skolehjem/resources/sass/admin/modal/modal.scss new file mode 100644 index 0000000..c47d647 --- /dev/null +++ b/skolehjem/resources/sass/admin/modal/modal.scss @@ -0,0 +1,38 @@ + +.modal { + display: none; /* Hidden by default */ + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + padding-top: 100px; /* Location of the box */ + left: 0; + top: 0; + width: 100%; /* Full width */ + height: 100%; /* Full height */ + overflow: auto; /* Enable scroll if needed */ + background-color: rgb(0,0,0); /* Fallback color */ + background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ +} + +/* Modal Content */ +.modal-content { + background-color: #fefefe; + margin: auto; + padding: 20px; + border: 1px solid #888; + width: 330px; + min-width: 400px; +} + +/* The Close Button */ +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, .close:focus { + color: #000; + text-decoration: none; + cursor: pointer; +} diff --git a/skolehjem/resources/views/admin/guides/create.blade.php b/skolehjem/resources/views/admin/guides/create.blade.php index 35fec96..e5590d1 100644 --- a/skolehjem/resources/views/admin/guides/create.blade.php +++ b/skolehjem/resources/views/admin/guides/create.blade.php @@ -22,37 +22,6 @@ #editor { margin-bottom: 1rem; } - .modal { - display: none; /* Hidden by default */ - position: fixed; /* Stay in place */ - z-index: 1; /* Sit on top */ - padding-top: 100px; /* Location of the box */ - left: 0; - top: 0; - width: 100%; /* Full width */ - height: 100%; /* Full height */ - overflow: auto; /* Enable scroll if needed */ - background-color: rgb(0,0,0); /* Fallback color */ - background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ - } - - /* Modal Content */ - .modal-content { - background-color: #fefefe; - margin: auto; - padding: 20px; - border: 1px solid #888; - width: 330px; - min-width: 400px; - } - - /* The Close Button */ - .close { - color: #aaaaaa; - float: right; - font-size: 28px; - font-weight: bold; - }

Opret Vejledning

diff --git a/skolehjem/resources/views/admin/news/index.blade.php b/skolehjem/resources/views/admin/news/index.blade.php index 556f1d0..2746a92 100644 --- a/skolehjem/resources/views/admin/news/index.blade.php +++ b/skolehjem/resources/views/admin/news/index.blade.php @@ -43,7 +43,7 @@ @endif @if(auth()->user()->can('news.edit')) $new ]) }}">Update - Update + Update @endif @if(auth()->user()->can('news.delete')) @@ -55,8 +55,54 @@ @endforeach + + @endsection @section('scripts') + @endsection