From 13197b8be8fa53b5339ac5c924e0a5520762d903 Mon Sep 17 00:00:00 2001 From: frederikpyt Date: Mon, 21 Sep 2020 08:32:05 +0200 Subject: [PATCH] v1.3.2 - Fixed table css and removed pagination in backend --- .../app/Http/Controllers/AboutController.php | 3 - .../Http/Controllers/ContactController.php | 1 - .../app/Http/Controllers/EventController.php | 2 +- .../Http/Controllers/FeedbackController.php | 2 +- .../Http/Controllers/ResourceController.php | 2 +- skolehjem/public/css/admin.css | 15 ++- .../resources/sass/admin/content/table.scss | 13 ++- .../views/admin/feedbacks/index.blade.php | 92 +++++++------------ 8 files changed, 60 insertions(+), 70 deletions(-) diff --git a/skolehjem/app/Http/Controllers/AboutController.php b/skolehjem/app/Http/Controllers/AboutController.php index c3f7787..be083dd 100644 --- a/skolehjem/app/Http/Controllers/AboutController.php +++ b/skolehjem/app/Http/Controllers/AboutController.php @@ -7,9 +7,6 @@ use Illuminate\Http\Response; class AboutController extends Controller { - - - public function __construct() { $this->middleware(["auth"]); diff --git a/skolehjem/app/Http/Controllers/ContactController.php b/skolehjem/app/Http/Controllers/ContactController.php index e4c7b15..bae2372 100644 --- a/skolehjem/app/Http/Controllers/ContactController.php +++ b/skolehjem/app/Http/Controllers/ContactController.php @@ -28,7 +28,6 @@ class ContactController extends Controller */ public function index(Request $request) { - $contact = Contact::query()->get(); return Response::detect("contacts.index", [ "contacts" => $contact]); diff --git a/skolehjem/app/Http/Controllers/EventController.php b/skolehjem/app/Http/Controllers/EventController.php index f414c0b..557e846 100644 --- a/skolehjem/app/Http/Controllers/EventController.php +++ b/skolehjem/app/Http/Controllers/EventController.php @@ -245,6 +245,7 @@ class EventController extends Controller } } + //Fixes tags that have been substringed public function closetags($html) { preg_match_all('#<(?!meta|img|br|hr|input\b)\b([a-z]+)(?: .*)?(?#iU', $html, $result); $openedtags = $result[1]; @@ -289,7 +290,6 @@ class EventController extends Controller return 1; } } - } diff --git a/skolehjem/app/Http/Controllers/FeedbackController.php b/skolehjem/app/Http/Controllers/FeedbackController.php index 87f4bb2..682f15f 100644 --- a/skolehjem/app/Http/Controllers/FeedbackController.php +++ b/skolehjem/app/Http/Controllers/FeedbackController.php @@ -29,7 +29,7 @@ class FeedbackController extends Controller */ public function index(Request $request) { - $feedback = Feedbacks::query()->orderBy('created_at', 'desc')->paginate(20); + $feedback = Feedbacks::query()->orderBy('created_at', 'desc')->get(); return Response::detect("feedbacks.index", [ "feedback" => $feedback ]); } diff --git a/skolehjem/app/Http/Controllers/ResourceController.php b/skolehjem/app/Http/Controllers/ResourceController.php index 08b5086..2721593 100644 --- a/skolehjem/app/Http/Controllers/ResourceController.php +++ b/skolehjem/app/Http/Controllers/ResourceController.php @@ -104,7 +104,7 @@ class ResourceController extends Controller * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response + * @return Resource */ public static function storeMime(Request $request, ResourceCategory $category) { diff --git a/skolehjem/public/css/admin.css b/skolehjem/public/css/admin.css index b9ab598..e7917cf 100644 --- a/skolehjem/public/css/admin.css +++ b/skolehjem/public/css/admin.css @@ -6772,7 +6772,20 @@ nav > .pagination { .tbl { border-collapse: collapse; width: 100%; - table-layout: fixed; +} + +div.dataTables_length, +div.dataTables_info { + margin-right: auto !important; +} + +div.dataTables_paginate, +div.dataTables_filter { + margin-left: auto !important; +} + +.col-sm-12 { + width: 100%; } .tbl td, diff --git a/skolehjem/resources/sass/admin/content/table.scss b/skolehjem/resources/sass/admin/content/table.scss index ed40710..b4c8a5c 100644 --- a/skolehjem/resources/sass/admin/content/table.scss +++ b/skolehjem/resources/sass/admin/content/table.scss @@ -1,7 +1,18 @@ .tbl { border-collapse: collapse; width: 100%; - table-layout: fixed; + //table-layout: fixed; +} +div.dataTables_length, div.dataTables_info { + margin-right: auto !important; +} + +div.dataTables_paginate, div.dataTables_filter { + margin-left: auto !important; +} + +.col-sm-12 { + width: 100%; } .tbl td, .tbl th { diff --git a/skolehjem/resources/views/admin/feedbacks/index.blade.php b/skolehjem/resources/views/admin/feedbacks/index.blade.php index 189e133..22fe017 100644 --- a/skolehjem/resources/views/admin/feedbacks/index.blade.php +++ b/skolehjem/resources/views/admin/feedbacks/index.blade.php @@ -11,73 +11,43 @@ @section("content") - - -
- - - -
- - - - +
+ @if(auth()->user()->can('feedback.delete')) @endif - - @foreach($feedback as $fb) - - - - - @if(auth()->user()->can('feedback.delete')) - + + @foreach($feedback as $fb) + + + + + @if(auth()->user()->can('feedback.delete')) + - @endif - - @endforeach + + + + @endif + + @endforeach +
Dato Feedback Besked Feedback typeDelete
{{ date('d-m-Y', strtotime($fb->created_at)) }}{{ $fb->message }}{{ $fb->suggestion_form }}
$fb ]) }}" class="w-100 nostyle"> - @csrf - @method("delete") +
{{ date('d-m-Y', strtotime($fb->created_at)) }}{{ $fb->message }}{{ $fb->suggestion_form }} $fb ]) }}" class="w-100 nostyle"> + @csrf + @method("delete") - - -
- - {{ $feedback->links() }} - - - - - - - +@endsection +@section('scripts') + @endsection