Skip to content

Commit

Permalink
Move all css and js to laravel mix and combine in one file remove pag…
Browse files Browse the repository at this point in the history
…ination form blade add js pagination ordering and search
  • Loading branch information
KalimeroMK committed Aug 3, 2022
1 parent 4d31cbf commit 5461d5a
Show file tree
Hide file tree
Showing 42 changed files with 17,160 additions and 22,130 deletions.
26 changes: 15 additions & 11 deletions Modules/Admin/Resources/views/layouts/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,23 @@
</div>

<!-- Bootstrap core JavaScript-->
<script src="{{asset('backend/vendor/jquery/jquery.min.js')}}"></script>
<script src="{{asset('backend/vendor/bootstrap/js/bootstrap.bundle.min.js')}}"></script>
<!-- Core plugin JavaScript-->
<script src="{{asset('backend/vendor/jquery-easing/jquery.easing.min.js')}}"></script>
<script src="{{asset('js/all.min.js')}}"></script>

<!-- Custom scripts for all pages-->
<script src="{{asset('backend/js/sb-admin-2.min.js')}}"></script>
<!-- Page level plugins -->
<script src="{{asset('backend/vendor/datatables/jquery.dataTables.min.js')}}"></script>
<script src="{{asset('backend/vendor/datatables/dataTables.bootstrap4.min.js')}}"></script>
<!-- Page level plugins -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
<script src="{{asset('backend/js/demo/datatables-demo.js')}}"></script>
@push('scripts')
<script>
$('#data-table').DataTable({
"ordering": true,
"paging": true,
"pageLength": 25,
"lengthMenu": [
[25, 50, 75, 100, -1],
[25, 50, 75, 100, 'All'],
],
});
</script>
@endpush
<script>
$(document).ready(function () {
$.ajaxSetup({
Expand Down
5 changes: 3 additions & 2 deletions Modules/Admin/Resources/views/layouts/head.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
rel="stylesheet">

<!-- Custom styles for this template-->
<link href="{{asset('backend/css/sb-admin-2.min.css')}}" rel="stylesheet">
<link href="{{ asset('backend/css/custom.css') }}">
<link href="{{asset('css/all.min.css')}}" rel="stylesheet">
<link href="{{asset('')}}" rel="stylesheet">

@stack('styles')

</head>
2 changes: 1 addition & 1 deletion Modules/Banner/Repository/BannerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BannerRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::paginate(10);
return $this->model::get();
}

}
34 changes: 1 addition & 33 deletions Modules/Banner/Resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<div class="row">
<div class="col-md-12">
@include('notification::notification')

</div>
</div>
<div class="card-header py-3">
Expand All @@ -17,7 +16,7 @@
<div class="card-body">
<div class="table-responsive">
@if(count($banners)>0)
<table class="table table-bordered" id="banner-dataTable" width="100%" cellspacing="0">
<table class="table table-bordered" id="data-table" width="100%" cellspacing="0">
<thead>
<tr>
<th>S.N.</th>
Expand Down Expand Up @@ -78,7 +77,6 @@ class="fas fa-trash-alt"></i></button>
@endforeach
</tbody>
</table>
<span style="float:right">{{$banners->links('vendor.pagination.bootstrap-4')}}</span>
@else
<h6 class="text-center">No banners found!!! Please create banner</h6>
@endif
Expand All @@ -87,35 +85,5 @@ class="fas fa-trash-alt"></i></button>
</div>
@endsection

@push('styles')
<link href="{{asset('backend/vendor/datatables/dataTables.bootstrap4.min.css')}}" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css"/>
<style>
.zoom {
transition: transform .2s; /* Animation */
}
.zoom:hover {
transform: scale(3.2);
}
</style>
@endpush

@push('scripts')
<script>
$('#banner-dataTable').DataTable({
"columnDefs": [
{
"orderable": false,
"targets": [3, 4, 5]
}
]
});
// Sweet alert

function deleteData(id) {

}
</script>
@endpush
2 changes: 1 addition & 1 deletion Modules/Brand/Repository/BrandRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class BrandRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::paginate(10);
return $this->model::get();
}
}
40 changes: 1 addition & 39 deletions Modules/Brand/Resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="card-body">
<div class="table-responsive">
@if(count($brands)>0)
<table class="table table-bordered" id="banner-dataTable" width="100%" cellspacing="0">
<table class="table table-bordered" id="data-table" width="100%" cellspacing="0">
<thead>
<tr>
<th>S.N.</th>
Expand Down Expand Up @@ -66,7 +66,6 @@ class="fas fa-trash-alt"></i></button>
@endforeach
</tbody>
</table>
<span style="float:right">{{$brands->links('vendor.pagination.bootstrap-4')}}</span>
@else
<h6 class="text-center">No brands found!!! Please create brand</h6>
@endif
Expand All @@ -75,41 +74,4 @@ class="fas fa-trash-alt"></i></button>
</div>
@endsection

@push('styles')
<link href="{{asset('backend/vendor/datatables/dataTables.bootstrap4.min.css')}}" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css"/>
<style>
div.dataTables_wrapper div.dataTables_paginate {
display: none;
}

.zoom {
transition: transform .2s; /* Animation */
}
.zoom:hover {
transform: scale(3.2);
}
</style>
@endpush

@push('scripts')
<!-- Page level custom scripts -->
<script>
$('#banner-dataTable').DataTable({
"columnDefs": [
{
"orderable": false,
"targets": [3, 4]
}
]
});
// Sweet alert
function deleteData(id) {
}
</script>
@endpush
8 changes: 8 additions & 0 deletions Modules/Cart/Repository/CartRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ class CartRepository extends Repository
{
public $model = Cart::class;

/**
* @return mixed
*/
public function findAll(): mixed
{
return $this->model::get();
}

}
2 changes: 1 addition & 1 deletion Modules/Category/Repository/CategoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class CategoryRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::paginate(10);
return $this->model::get();
}
}
37 changes: 1 addition & 36 deletions Modules/Category/Resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="card-body">
<div class="table-responsive">
@if(count($categories)>0)
<table class="table table-bordered" id="banner-dataTable" width="100%" cellspacing="0">
<table class="table table-bordered" id="data-table" width="100%" cellspacing="0">
<thead>
<tr>
<th>S.N.</th>
Expand Down Expand Up @@ -69,7 +69,6 @@ class="btn btn-primary btn-sm float-left mr-1"
@endforeach
</tbody>
</table>
<span style="float:right">{{$categories->links('vendor.pagination.bootstrap-4')}}</span>
@else
<h6 class="text-center">No Categories found!!! Please create Category</h6>
@endif
Expand All @@ -78,37 +77,3 @@ class="btn btn-primary btn-sm float-left mr-1"
</div>
@endsection

@push('styles')
<link href="{{asset('backend/vendor/datatables/dataTables.bootstrap4.min.css')}}" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css"/>
<style>
div.dataTables_wrapper div.dataTables_paginate {
display: none;
}
</style>
@endpush

@push('scripts')

<!-- Page level plugins -->


<!-- Page level custom scripts -->
<script>
$('#banner-dataTable').DataTable({
"columnDefs": [
{
"orderable": false,
"targets": [3, 4, 5]
}
]
});
// Sweet alert
function deleteData(id) {
}
</script>
@endpush
2 changes: 1 addition & 1 deletion Modules/Coupon/Repository/CouponRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class CouponRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::paginate(10);
return $this->model::get();
}
}
73 changes: 1 addition & 72 deletions Modules/Coupon/Resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="card-body">
<div class="table-responsive">
@if(count($coupons)>0)
<table class="table table-bordered" id="banner-dataTable" width="100%" cellspacing="0">
<table class="table table-bordered" id="data-table" width="100%" cellspacing="0">
<thead>
<tr>
<th>S.N.</th>
Expand Down Expand Up @@ -90,74 +90,3 @@ class="fas fa-trash-alt"></i></button>
</div>
@endsection

@push('styles')
<link href="{{asset('backend/vendor/datatables/dataTables.bootstrap4.min.css')}}" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css"/>
<style>
div.dataTables_wrapper div.dataTables_paginate {
display: none;
}
.zoom {
transition: transform .2s; /* Animation */
}
.zoom:hover {
transform: scale(3.2);
}
</style>
@endpush

@push('scripts')

<!-- Page level plugins -->


<!-- Page level custom scripts -->
<script>
$('#banner-dataTable').DataTable({
"columnDefs": [
{
"orderable": false,
"targets": [4, 5]
}
]
});
// Sweet alert
function deleteData(id) {
}
</script>
<script>
$(document).ready(function () {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$('.dltBtn').click(function (e) {
const form = $(this).closest('form');
const dataID = $(this).data('id');
// alert(dataID);
e.preventDefault();
swal({
title: "Are you sure?",
text: "Once deleted, you will not be able to recover this data!",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then((willDelete) => {
if (willDelete) {
form.submit();
} else {
swal("Your data is safe!");
}
});
})
})
</script>
@endpush
4 changes: 2 additions & 2 deletions Modules/Message/Repository/MessageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Modules\Message\Repository;

use Modules\Admin\Models\Message;
use Modules\Core\Repositories\Repository;
use Modules\Message\Models\Message;

class MessageRepository extends Repository
{
Expand All @@ -14,6 +14,6 @@ class MessageRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::paginate(10);
return $this->model::get();
}
}
2 changes: 1 addition & 1 deletion Modules/Newsletter/Repository/NewsletterRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class NewsletterRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::paginate(10);
return $this->model::get();
}
}
2 changes: 1 addition & 1 deletion Modules/Notification/Repository/NotificationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class NotificationRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::paginate(10);
return $this->model::get();
}
}
2 changes: 1 addition & 1 deletion Modules/Order/Repository/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OrderRepository extends Repository
*/
public function findAll(): mixed
{
return $this->model::with('shipping', 'user', 'carts')->paginate(10);
return $this->model::with('shipping', 'user', 'carts')->get();
}

/**
Expand Down
Loading

0 comments on commit 5461d5a

Please sign in to comment.