update
This commit is contained in:
@ -108,7 +108,7 @@
|
||||
</div>
|
||||
</li>
|
||||
@role('admin')
|
||||
<li class="nav-item">
|
||||
{{-- <li class="nav-item">
|
||||
<a class="nav-link menu-link collapsed" href="#sidebarMenu4" data-bs-toggle="collapse"
|
||||
role="button" aria-expanded="false" aria-controls="sidebarMenu1">
|
||||
<i class="ri-pages-line"></i> <span data-key="t-pages">Users</span>
|
||||
@ -120,6 +120,20 @@
|
||||
{{ CCMS::createMenuLink('Users', route('users.index')) }}
|
||||
</ul>
|
||||
</div>
|
||||
</li> --}}
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link menu-link collapsed" href="#sidebarMenu4" data-bs-toggle="collapse"
|
||||
role="button" aria-expanded="false" aria-controls="sidebarMenu1">
|
||||
<i class="ri-pages-line"></i> <span data-key="t-pages">Users</span>
|
||||
</a>
|
||||
<div class="collapse menu-dropdown" id="sidebarMenu4">
|
||||
<ul class="nav nav-sm flex-column">
|
||||
{{ CCMS::createMenuLink('Roles', route('role.index')) }}
|
||||
{{ CCMS::createMenuLink('Permissions', route('permissions.index')) }}
|
||||
{{ CCMS::createMenuLink('Users', route('user.index')) }}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@endrole
|
||||
|
||||
@ -131,6 +145,7 @@
|
||||
{{ CCMS::createMenuLink('Artilces', route('articles.index')) }}
|
||||
{{ CCMS::createMenuLink('Teams', route('teams.index')) }}
|
||||
{{ CCMS::createMenuLink('Popup', route('popups.index')) }}
|
||||
{{ CCMS::createMenuLink('Comments', route('comments.index')) }}
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1,241 +1,247 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-layout="vertical" data-topbar="light" data-sidebar="dark" data-sidebar-size="lg"
|
||||
data-sidebar-image="none" data-preloader="disable">
|
||||
data-sidebar-image="none" data-preloader="disable">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ config('app.name') }} - Admin Dashboard </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="{{ config('app.name') }} - Admin & Dashboard" name="description" />
|
||||
<meta content="Bibhuti" name="author" />
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<script>
|
||||
window.appUrl = "{{ env('APP_URL') }}";
|
||||
var route_prefix = "{{ env('APP_URL') }}/files";
|
||||
</script>
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ config('app.name') }} - Admin Dashboard </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="{{ config('app.name') }} - Admin & Dashboard" name="description" />
|
||||
<meta content="Bibhuti" name="author" />
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<script>
|
||||
window.appUrl = "{{ env('APP_URL') }}";
|
||||
var route_prefix = "{{ env('APP_URL') }}/files";
|
||||
</script>
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="assets/images/favicon.ico">
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="assets/images/favicon.ico">
|
||||
|
||||
<link rel="shortcut icon" href="{{ asset('assets/images/favicon.ico') }}">
|
||||
<link rel="shortcut icon" href="{{ asset('assets/images/favicon.ico') }}">
|
||||
|
||||
|
||||
<!-- gridjs css -->
|
||||
<link rel="stylesheet" href="{{ asset('assets/libs/gridjs/theme/mermaid.min.css') }}">
|
||||
<!-- gridjs css -->
|
||||
<link rel="stylesheet" href="{{ asset('assets/libs/gridjs/theme/mermaid.min.css') }}">
|
||||
|
||||
<!-- Layout config Js -->
|
||||
<script src="{{ asset('assets/js/layout.js') }}"></script>
|
||||
<!-- Bootstrap Css -->
|
||||
<link href="{{ asset('assets/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- Icons Css -->
|
||||
<link href="{{ asset('assets/css/icons.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- App Css-->
|
||||
<link href="{{ asset('assets/css/app.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- Layout config Js -->
|
||||
<script src="{{ asset('assets/js/layout.js') }}"></script>
|
||||
<!-- Bootstrap Css -->
|
||||
<link href="{{ asset('assets/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- Icons Css -->
|
||||
<link href="{{ asset('assets/css/icons.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- App Css-->
|
||||
<link href="{{ asset('assets/css/app.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- jsvectormap css -->
|
||||
<link href="https://cdn.datatables.net/1.13.5/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('assets/libs/jsvectormap/css/jsvectormap.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!-- jsvectormap css -->
|
||||
<link href="https://cdn.datatables.net/1.13.5/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('assets/libs/jsvectormap/css/jsvectormap.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('hulaki/assets/css/custom.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- custom Css-->
|
||||
@stack('css')
|
||||
<link href="{{ asset('assets/css/custom.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.auth-one-bg .bg-overlay {
|
||||
background: linear-gradient(to right, #bf2628, #b9070a);
|
||||
opacity: .9;
|
||||
}
|
||||
</style>
|
||||
<!-- custom Css-->
|
||||
@stack('css')
|
||||
<link href="{{ asset('assets/css/custom.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.auth-one-bg .bg-overlay {
|
||||
background: linear-gradient(to right, #bf2628, #b9070a);
|
||||
opacity: .9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="file-detail-show">
|
||||
|
||||
<!-- Begin page -->
|
||||
<div id="layout-wrapper">
|
||||
<!-- Begin page -->
|
||||
<div id="layout-wrapper">
|
||||
|
||||
@include('backend.header')
|
||||
@include('backend.header')
|
||||
|
||||
@include('backend.sidebar')
|
||||
@include('backend.sidebar')
|
||||
|
||||
<div class="vertical-overlay"></div>
|
||||
<div class="vertical-overlay"></div>
|
||||
|
||||
<div class="main-content">
|
||||
<div class="main-content">
|
||||
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
@yield('content')
|
||||
@yield('content')
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script> © {{ env('APP_NAME') }}.
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="text-sm-end d-none d-sm-block">
|
||||
Developed by <a href="https://www.bibhutisolutions.com/" target="_blank">Bibhuti Solutions Pvt. Ltd.</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script> © {{ env('APP_NAME') }}.
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="text-sm-end d-none d-sm-block">
|
||||
Developed by <a href="https://www.bibhutisolutions.com/" target="_blank">Bibhuti
|
||||
Solutions Pvt. Ltd.</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- end main content-->
|
||||
|
||||
</div>
|
||||
<!-- end main content-->
|
||||
<!-- END layout-wrapper -->
|
||||
|
||||
</div>
|
||||
<!-- END layout-wrapper -->
|
||||
|
||||
<!--start back-to-top-->
|
||||
<?php /*
|
||||
<!--start back-to-top-->
|
||||
<?php /*
|
||||
@include("backend.parts.customizer")
|
||||
*/
|
||||
?>
|
||||
?>
|
||||
|
||||
<!-- JAVASCRIPT -->
|
||||
<!-- JAVASCRIPT -->
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
|
||||
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
<script src="{{ asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/simplebar/simplebar.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/node-waves/waves.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/feather-icons/feather.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/pages/plugins/lord-icon-2.1.0.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/plugins.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/simplebar/simplebar.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/node-waves/waves.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/feather-icons/feather.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/pages/plugins/lord-icon-2.1.0.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/plugins.js') }}"></script>
|
||||
<!-- apexcharts -->
|
||||
<script src="{{ asset('assets/libs/apexcharts/apexcharts.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/pages/file-manager.init.js') }}"></script>
|
||||
|
||||
<!-- apexcharts -->
|
||||
<script src="{{ asset('assets/libs/apexcharts/apexcharts.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/pages/file-manager.init.js') }}"></script>
|
||||
<!-- App js -->
|
||||
<script src="{{ asset('assets/js/app.js') }}"></script>
|
||||
<script src="{{ asset('vendor/laravel-filemanager/js/stand-alone-button.js') }}"></script>
|
||||
<script src="{{ asset('hulaki/assets/js/custom.js') }}"></script>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="{{ asset('assets/js/app.js') }}"></script>
|
||||
<script src="{{ asset('vendor/laravel-filemanager/js/stand-alone-button.js') }}"></script>
|
||||
<!-- Vector map-->
|
||||
<script src="{{ asset('assets/libs/jsvectormap/js/jsvectormap.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/jsvectormap/maps/world-merc.js') }}"></script>
|
||||
|
||||
<!-- Vector map-->
|
||||
<script src="{{ asset('assets/libs/jsvectormap/js/jsvectormap.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/libs/jsvectormap/maps/world-merc.js') }}"></script>
|
||||
<!-- gridjs js -->
|
||||
<script src="{{ asset('assets/libs/gridjs/gridjs.umd.js') }}"></script>
|
||||
|
||||
<!-- gridjs js -->
|
||||
<script src="{{ asset('assets/libs/gridjs/gridjs.umd.js') }}"></script>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/toastify-js'></script>
|
||||
<script type='text/javascript' src='https://choices-js.github.io/Choices/assets/scripts/choices.js'></script>
|
||||
<script src='https://cdn.jsdelivr.net/npm/flatpickr'></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.14.0/Sortable.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-datepicker@1.10.0/dist/js/bootstrap-datepicker.min.js"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-datepicker@1.10.0/dist/css/bootstrap-datepicker3.min.css"
|
||||
rel="stylesheet">
|
||||
<!-- JAVASCRIPT -->
|
||||
<script type='text/javascript' src='https://cdn.jsdelivr.net/npm/toastify-js'></script>
|
||||
<script type='text/javascript' src='https://choices-js.github.io/Choices/assets/scripts/choices.js'></script>
|
||||
<script src='https://cdn.jsdelivr.net/npm/flatpickr'></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.14.0/Sortable.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-datepicker@1.10.0/dist/js/bootstrap-datepicker.min.js"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-datepicker@1.10.0/dist/css/bootstrap-datepicker3.min.css"
|
||||
rel="stylesheet">
|
||||
<!-- JAVASCRIPT -->
|
||||
|
||||
<!-- <script src="https://cdn.ckeditor.com/ckeditor5/38.1.1/classic/ckeditor.js"></script> -->
|
||||
<script src="https://cdn.ckeditor.com/4.16.2/full/ckeditor.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var baseUrl = '{{ env('APP_URL') }}'; // Replace with your base URL
|
||||
<!-- <script src="https://cdn.ckeditor.com/ckeditor5/38.1.1/classic/ckeditor.js"></script> -->
|
||||
<script src="https://cdn.ckeditor.com/4.16.2/full/ckeditor.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var baseUrl = '{{ env('APP_URL') }}'; // Replace with your base URL
|
||||
|
||||
var textareas = document.querySelectorAll('.ckeditor-classic');
|
||||
for (var i = 0; i < textareas.length; i++) {
|
||||
CKEDITOR.replace(textareas[i], {
|
||||
// height: 100,
|
||||
filebrowserImageBrowseUrl: baseUrl + '/files?type=Images',
|
||||
filebrowserImageUploadUrl: baseUrl + '/files/upload?type=Images&_token={{ csrf_token() }}',
|
||||
filebrowserBrowseUrl: baseUrl + '/files?type=Files',
|
||||
filebrowserUploadUrl: baseUrl + '/files/upload?type=Files&_token={{ csrf_token() }}',
|
||||
filebrowserImageUploadPath: '/storage/photos', // Adjust the path as per your requirements
|
||||
filebrowserUploadPath: '/storage/files', // Adjust the path as per your requirements
|
||||
baseHref: baseUrl + '/', // Set the baseHref to the baseUrl
|
||||
filebrowserImageBrowseCallback: function(url) {
|
||||
var relativePath = url.replace(baseUrl + '/', '');
|
||||
alert("COW");
|
||||
onSelectFile(relativePath); // Call your custom function with the relative path
|
||||
}
|
||||
var textareas = document.querySelectorAll('.ckeditor-classic');
|
||||
for (var i = 0; i < textareas.length; i++) {
|
||||
CKEDITOR.replace(textareas[i], {
|
||||
// height: 100,
|
||||
filebrowserImageBrowseUrl: baseUrl + '/files?type=Images',
|
||||
filebrowserImageUploadUrl: baseUrl +
|
||||
'/files/upload?type=Images&_token={{ csrf_token() }}',
|
||||
filebrowserBrowseUrl: baseUrl + '/files?type=Files',
|
||||
filebrowserUploadUrl: baseUrl + '/files/upload?type=Files&_token={{ csrf_token() }}',
|
||||
filebrowserImageUploadPath: '/storage/photos', // Adjust the path as per your requirements
|
||||
filebrowserUploadPath: '/storage/files', // Adjust the path as per your requirements
|
||||
baseHref: baseUrl + '/', // Set the baseHref to the baseUrl
|
||||
filebrowserImageBrowseCallback: function(url) {
|
||||
var relativePath = url.replace(baseUrl + '/', '');
|
||||
alert("COW");
|
||||
onSelectFile(relativePath); // Call your custom function with the relative path
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function onSelectFile(url) {
|
||||
// Use the relative path as needed
|
||||
console.log(url);
|
||||
}
|
||||
function onSelectFile(url) {
|
||||
// Use the relative path as needed
|
||||
console.log(url);
|
||||
}
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
$('.datepicker').datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
autoclose: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
jQuery(document).ready(function($) {
|
||||
$('.datepicker').datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
autoclose: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
// $('#lfm').filemanager('image', {prefix: route_prefix});
|
||||
</script>
|
||||
<script>
|
||||
// $('#lfm').filemanager('image', {prefix: route_prefix});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var lfm = function(id, type, options) {
|
||||
let button = document.getElementById(id);
|
||||
<script>
|
||||
var lfm = function(id, type, options) {
|
||||
let button = document.getElementById(id);
|
||||
|
||||
button.addEventListener('click', function() {
|
||||
var route_prefix = (options && options.prefix) ? options.prefix : '/filemanager';
|
||||
var target_input = document.getElementById(button.getAttribute('data-input'));
|
||||
var target_preview = document.getElementById(button.getAttribute('data-preview'));
|
||||
var multiple_selection = (options && options.multi_selection) ? options.multi_selection : false;
|
||||
// alert(multiple_selection);
|
||||
window.open(route_prefix + '?type=' + options.type || 'file', 'FileManager', 'width=900,height=600');
|
||||
window.SetUrl = function(items) {
|
||||
var file_path = items.map(function(item) {
|
||||
return item.url;
|
||||
}).join(',');
|
||||
button.addEventListener('click', function() {
|
||||
var route_prefix = (options && options.prefix) ? options.prefix : '/filemanager';
|
||||
var target_input = document.getElementById(button.getAttribute('data-input'));
|
||||
var target_preview = document.getElementById(button.getAttribute('data-preview'));
|
||||
var multiple_selection = (options && options.multi_selection) ? options.multi_selection : false;
|
||||
// alert(multiple_selection);
|
||||
window.open(route_prefix + '?type=' + options.type || 'file', 'FileManager',
|
||||
'width=900,height=600');
|
||||
window.SetUrl = function(items) {
|
||||
var file_path = items.map(function(item) {
|
||||
return item.url;
|
||||
}).join(',');
|
||||
|
||||
// set the value of the desired input to image url
|
||||
target_input.value = file_path;
|
||||
target_input.dispatchEvent(new Event('change'));
|
||||
// set the value of the desired input to image url
|
||||
target_input.value = file_path;
|
||||
target_input.dispatchEvent(new Event('change'));
|
||||
|
||||
// clear previous preview
|
||||
target_preview.innerHtml = '';
|
||||
// clear previous preview
|
||||
target_preview.innerHtml = '';
|
||||
|
||||
// set or change the preview image src
|
||||
items.forEach(function(item) {
|
||||
let img = document.createElement('img')
|
||||
img.setAttribute('style', 'height: 5rem')
|
||||
img.setAttribute('src', item.thumb_url)
|
||||
if (!multiple_selection) target_preview.innerHTML = '';
|
||||
target_preview.appendChild(img);
|
||||
});
|
||||
// set or change the preview image src
|
||||
items.forEach(function(item) {
|
||||
let img = document.createElement('img')
|
||||
img.setAttribute('style', 'height: 5rem')
|
||||
img.setAttribute('src', item.thumb_url)
|
||||
if (!multiple_selection) target_preview.innerHTML = '';
|
||||
target_preview.appendChild(img);
|
||||
});
|
||||
|
||||
// trigger change event
|
||||
target_preview.dispatchEvent(new Event('change'));
|
||||
// trigger change event
|
||||
target_preview.dispatchEvent(new Event('change'));
|
||||
};
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
// When the document is ready
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let success = "{{ Session::pull('success', '') }}";
|
||||
</script>
|
||||
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script>
|
||||
// When the document is ready
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let success = "{{ Session::pull('success', '') }}";
|
||||
|
||||
// If there is a success message in the session data
|
||||
if (success !== '') {
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Success',
|
||||
text: success
|
||||
// If there is a success message in the session data
|
||||
if (success !== '') {
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Success',
|
||||
text: success
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@if (isset($GLOBALS['scripts']))
|
||||
{!! implode(PHP_EOL, $GLOBALS['scripts']) !!}
|
||||
@endif
|
||||
@if (isset($GLOBALS['scripts']))
|
||||
{!! implode(PHP_EOL, $GLOBALS['scripts']) !!}
|
||||
@endif
|
||||
|
||||
@stack('js')
|
||||
@stack('js')
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
6
resources/views/components/form-buttons.blade.php
Normal file
6
resources/views/components/form-buttons.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
@props(['editable' => false, 'label' => 'Add', 'href' => '#'])
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->a($href = $href, $text = 'Cancel')->class('btn btn-danger') }}
|
||||
{{ html()->button($editable ? 'Update' : $label, 'submit')->class('btn btn-success') }}
|
||||
</div>
|
29
resources/views/crud/generated/comments/create.blade.php
Normal file
29
resources/views/crud/generated/comments/create.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Comment') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('comments.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('comments.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_comments', 'content', 'id', '', 'Parent Id', 'parent_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_users', 'name', 'id', '', 'Users Id', 'users_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_news', 'title', 'news_id', '', 'News Id', 'news_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-3"> {{createPlainTextArea('content', 'content', 'Content')}}</div> <br>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('comments.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
30
resources/views/crud/generated/comments/edit.blade.php
Normal file
30
resources/views/crud/generated/comments/edit.blade.php
Normal file
@ -0,0 +1,30 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Comment') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('comments.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('comments.update', [$data->id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='id' value='{{ $data->id }}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_comments', 'content', 'id', $data->parent_id, 'Parent Id', 'parent_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_users', 'name', 'id', $data->users_id, 'Users Id', 'users_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_news', 'title', 'news_id', $data->news_id, 'News Id', 'news_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-3"> {{ createPlainTextArea('content', '', 'Content', $data->content) }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('comments.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
244
resources/views/crud/generated/comments/index.blade.php
Normal file
244
resources/views/crud/generated/comments/index.blade.php
Normal file
@ -0,0 +1,244 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Comments List') }}</h2>
|
||||
<a href="{{ route('comments.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_comments" data-url="{{ route('comments.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Parent') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('users') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('news') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('content') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{ $item->id }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_comments', 'content', 'id', $item->parent_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_users', 'name', 'id', $item->users_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_news', 'title', 'news_id', $item->news_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->content }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('comments.show', [$item->id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('comments.edit', [$item->id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('comments.toggle', [$item->id]) }}"
|
||||
class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('comments.destroy', [$item->id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('comments.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
@ -3,14 +3,14 @@
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('users.index')); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('comments.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Email : </b> <span>{{$data->email}}</span></p><p><b>Username : </b> <span>{{$data->username}}</span></p><p><b>Email Verified At : </b> <span>{{$data->email_verified_at}}</span></p><p><b>Password : </b> <span>{{$data->password}}</span></p><p><b>Role : </b> <span>{{$data->role}}</span></p><p><b>Remember Token : </b> <span>{{$data->remember_token}}</span></p><p><b>Status : </b> <span
|
||||
<p><b>Parent Id : </b> <span>{{$data->parent_id}}</span></p><p><b>Users Id : </b> <span>{{$data->users_id}}</span></p><p><b>News Id : </b> <span>{{$data->news_id}}</span></p><p><b>Content : </b> <span>{{$data->content}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
137
resources/views/crud/generated/partials/role/action.blade.php
Normal file
137
resources/views/crud/generated/partials/role/action.blade.php
Normal file
@ -0,0 +1,137 @@
|
||||
<div class="row gy-4">
|
||||
|
||||
<div class="col-lg-4">
|
||||
{{ html()->label('Name')->class('form-label') }}
|
||||
{{ html()->text('name')->class('form-control')->placeholder('Enter Role Name')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
{{ html()->label('Guard Name')->class('form-label') }}
|
||||
{{ html()->text('guard_name', 'web')->class('form-control')->isReadonly($readonly = true) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
<div class="form-check form-switch form-switch-lg mt-3">
|
||||
{{ html()->checkbox('all_permissions_check')->class('form-check-input')->id('all-check') }}
|
||||
{{ html()->label('Select All')->class('form-check-label')->for('all-check') }}
|
||||
</div>
|
||||
{{ html()->p()->text('Enable all Permissions for this role')->class('fs-6 text-muted mt-1') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
<x-form-buttons :editable=$editable label='Assign' />
|
||||
</div>
|
||||
|
||||
@foreach ($permissionLists as $key => $permission)
|
||||
<div class="col-lg-4">
|
||||
<div class="form-check form-switch form-switch-custom form-switch-success mb-3">
|
||||
<input class="form-check-input parent-switch" type="checkbox" role="switch" id="check_{{ $key }}">
|
||||
<label class="form-check-label ms-2" for="{check_{$key}}">{{ Str::ucfirst($key) }}</label>
|
||||
</div>
|
||||
<fieldset class="rounded-2 p-3">
|
||||
<legend class="fs-5">Permissions</legend>
|
||||
<div class="row">
|
||||
|
||||
@foreach ($permission as $index => $item)
|
||||
<div class="col-lg-12">
|
||||
<div class="form-check form-check-success">
|
||||
{{ html()->checkbox('permissions[]')->id('permission_' . $index)->value($index)->class('form-check-input child-checkbox')->checked($editable && in_array($index, $permissionIDsArray)) }}
|
||||
{{ html()->label(Str::ucfirst($item))->for('permission_' . $index)->class('form-check-label ms-2') }}
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
||||
@push('js')
|
||||
<script type="text/javascript">
|
||||
// $(document).ready(function() {
|
||||
|
||||
// // Cache selectors
|
||||
// const childCheckboxes = $('.child-checkbox');
|
||||
// const parentSwitches = $('.parent-switch');
|
||||
// const allCheck = $('#all-check');
|
||||
|
||||
// // Initial selection (optional, can be removed if not needed)
|
||||
// childCheckboxes.trigger('change');
|
||||
|
||||
// // Parent switch and child checkbox change handler (combined)
|
||||
// $('.child-checkbox, .parent-switch').change(function() {
|
||||
// const currentCol = $(this).closest('.col-lg-4');
|
||||
// const currentSwitch = currentCol.find('.parent-switch');
|
||||
// const currentChildren = currentCol.find(childCheckboxes);
|
||||
|
||||
// let allChecked = true;
|
||||
// currentChildren.each(function() {
|
||||
// if (!$(this).prop('checked')) {
|
||||
// allChecked = false;
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
// currentSwitch.prop('checked', allChecked);
|
||||
// allCheck.prop('checked', childCheckboxes.prop(
|
||||
// 'checked')); // Check all checkbox state
|
||||
// });
|
||||
|
||||
// // "all-check" change handler
|
||||
// allCheck.change(function() {
|
||||
// childCheckboxes.prop('checked', this.checked).trigger('change');
|
||||
// });
|
||||
|
||||
// });
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.child-checkbox').trigger('change');
|
||||
|
||||
$('.parent-switch').change(function() {
|
||||
let childCheckboxes = $(this).closest('.col-lg-4').find('.child-checkbox');
|
||||
childCheckboxes.prop('checked', this.checked);
|
||||
});
|
||||
|
||||
$('.child-checkbox').change(function() {
|
||||
let parentSwitch = $(this).closest('.col-lg-4').find('.parent-switch');
|
||||
let childCheckboxes = $(this).closest('.col-lg-4').find('.child-checkbox');
|
||||
let allChecked = true;
|
||||
childCheckboxes.each(function() {
|
||||
if (!$(this).prop('checked')) {
|
||||
allChecked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
parentSwitch.prop('checked', allChecked);
|
||||
});
|
||||
|
||||
$('#all-check').change(function() {
|
||||
let childCheckboxes = $('.child-checkbox');
|
||||
childCheckboxes.prop('checked', this.checked);
|
||||
|
||||
childCheckboxes.prop('checked', this.checked).trigger('change');
|
||||
});
|
||||
|
||||
$('.child-checkbox, .parent-switch').change(function() {
|
||||
let allCheck = $('#all-check');
|
||||
let childCheckboxes = $('.child-checkbox');
|
||||
let allChecked = true;
|
||||
|
||||
childCheckboxes.each((index, checkBox) => {
|
||||
if (!$(checkBox).prop('checked')) {
|
||||
allChecked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
allCheck.prop('checked', allChecked);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
17
resources/views/crud/generated/partials/role/view.blade.php
Normal file
17
resources/views/crud/generated/partials/role/view.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-modal="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalgridLabel">View User</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('user.store') }}" class="needs-validation" novalidate method="post">
|
||||
@csrf
|
||||
@include('crud.generated.partials.user.action', ['btnType' => 'View'])
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,33 @@
|
||||
<div class="row gy-4">
|
||||
|
||||
{{-- <div class="col-md-4">
|
||||
{{ html()->label('For Employee')->class('form-label') }}
|
||||
{{ html()->select('employee_id', $employeeLists)->class('form-select select2')->placeholder('Select Employee') }}
|
||||
{{ html()->div('please select employee')->class('invalid-feedback') }}
|
||||
</div> --}}
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Role')->class('form-label') }}
|
||||
{{ html()->select('role[]', $roleLists, $editable ? $user->roles?->first()->id : null)->class('form-select select2')->placeholder('Select Role')->required() }}
|
||||
{{ html()->div('please select role')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Username')->class('form-label') }}
|
||||
{{ html()->text('name')->class('form-control')->placeholder('Enter Username')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Email')->class('form-label') }}
|
||||
{{ html()->email('email')->class('form-control')->placeholder('Enter Email')->required() }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Password')->class('form-label') }}
|
||||
{{ html()->password('password')->class('form-control')->placeholder('Enter Password')->required() }}
|
||||
</div>
|
||||
|
||||
<x-form-buttons :editable="$editable" label="Add" href="{{ route('user.index') }}" />
|
||||
|
||||
</div>
|
17
resources/views/crud/generated/partials/user/view.blade.php
Normal file
17
resources/views/crud/generated/partials/user/view.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-modal="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalgridLabel">View User</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('user.store') }}" class="needs-validation" novalidate method="post">
|
||||
@csrf
|
||||
@include('crud.generated.partials.user.action')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
122
resources/views/crud/generated/permissions/action.blade.php
Normal file
122
resources/views/crud/generated/permissions/action.blade.php
Normal file
@ -0,0 +1,122 @@
|
||||
<div class="row gy-4">
|
||||
|
||||
@foreach ($permissionLists as $key => $permission)
|
||||
{{-- @dd($permissionLists); --}}
|
||||
<div class="col-lg-4">
|
||||
{{-- <p class="justify-center text-soft-success"> --}}
|
||||
<div class="form-check form-switch form-switch-custom form-switch-success mb-3">
|
||||
{{-- <input class="form-check-input parent-switch" type="checkbox" role="switch" id="check_{{ $key }}"> --}}
|
||||
<label class="form-check-label ms-2" for="{check_{$key}}">{{ Str::ucfirst($key) }}</label>
|
||||
</div>
|
||||
{{-- {{ Str::ucfirst($key) }}
|
||||
</p> --}}
|
||||
<fieldset class="rounded-2 p-3">
|
||||
<legend class="fs-5">Permissions</legend>
|
||||
<div class="row">
|
||||
|
||||
@foreach ($permission as $index => $item)
|
||||
<div class="col-lg-12">
|
||||
<div class="form-check form-check-success">
|
||||
{{-- {{ html()->checkbox('permissions[]')->id('permission_' . $index)->value($index)->class('form-check-input child-checkbox')->checked($editable && in_array($index, $permissionIDsArray)) }} --}}
|
||||
<a href="javascript:void(0);"
|
||||
data-link="{{ route('permissions.destroy', $index) }}"
|
||||
data-id="{{ $index }}"
|
||||
class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
{{ html()->label(Str::ucfirst($item))->for('permission_' . $index)->class('form-check-label ms-2') }}
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
||||
@push('js')
|
||||
<script type="text/javascript">
|
||||
// $(document).ready(function() {
|
||||
|
||||
// // Cache selectors
|
||||
// const childCheckboxes = $('.child-checkbox');
|
||||
// const parentSwitches = $('.parent-switch');
|
||||
// const allCheck = $('#all-check');
|
||||
|
||||
// // Initial selection (optional, can be removed if not needed)
|
||||
// childCheckboxes.trigger('change');
|
||||
|
||||
// // Parent switch and child checkbox change handler (combined)
|
||||
// $('.child-checkbox, .parent-switch').change(function() {
|
||||
// const currentCol = $(this).closest('.col-lg-4');
|
||||
// const currentSwitch = currentCol.find('.parent-switch');
|
||||
// const currentChildren = currentCol.find(childCheckboxes);
|
||||
|
||||
// let allChecked = true;
|
||||
// currentChildren.each(function() {
|
||||
// if (!$(this).prop('checked')) {
|
||||
// allChecked = false;
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
// currentSwitch.prop('checked', allChecked);
|
||||
// allCheck.prop('checked', childCheckboxes.prop(
|
||||
// 'checked')); // Check all checkbox state
|
||||
// });
|
||||
|
||||
// // "all-check" change handler
|
||||
// allCheck.change(function() {
|
||||
// childCheckboxes.prop('checked', this.checked).trigger('change');
|
||||
// });
|
||||
|
||||
// });
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.child-checkbox').trigger('change');
|
||||
|
||||
$('.parent-switch').change(function() {
|
||||
let childCheckboxes = $(this).closest('.col-lg-4').find('.child-checkbox');
|
||||
childCheckboxes.prop('checked', this.checked);
|
||||
});
|
||||
|
||||
$('.child-checkbox').change(function() {
|
||||
let parentSwitch = $(this).closest('.col-lg-4').find('.parent-switch');
|
||||
let childCheckboxes = $(this).closest('.col-lg-4').find('.child-checkbox');
|
||||
let allChecked = true;
|
||||
childCheckboxes.each(function() {
|
||||
if (!$(this).prop('checked')) {
|
||||
allChecked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
parentSwitch.prop('checked', allChecked);
|
||||
});
|
||||
|
||||
$('#all-check').change(function() {
|
||||
let childCheckboxes = $('.child-checkbox');
|
||||
childCheckboxes.prop('checked', this.checked);
|
||||
|
||||
childCheckboxes.prop('checked', this.checked).trigger('change');
|
||||
});
|
||||
|
||||
$('.child-checkbox, .parent-switch').change(function() {
|
||||
let allCheck = $('#all-check');
|
||||
let childCheckboxes = $('.child-checkbox');
|
||||
let allChecked = true;
|
||||
|
||||
childCheckboxes.each((index, checkBox) => {
|
||||
if (!$(checkBox).prop('checked')) {
|
||||
allChecked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
allCheck.prop('checked', allChecked);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
@ -1,17 +0,0 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Permissions') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('permissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('permissions.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row"><div class="col-lg-6">{{createText("name","name","Name")}}
|
||||
</div><div class="col-lg-6">{{createText("guard_name","guard_name","Guard Name")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('permissions.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
@ -1,25 +0,0 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Permissions') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('permissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('permissions.update', [$data->id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<input type=hidden name='id' value='{{ $data->id }}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('name', 'name', 'Name', '', $data->name) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('guard_name', 'guard_name', 'Guard Name', '', $data->guard_name) }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('permissions.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -1,185 +1,59 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Permissions List') }}</h2>
|
||||
<a href="{{ route('permissions.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_permissions">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('name') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('guard_name') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{ $item->id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->guard_name }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('permissions.show', [$item->id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('permissions.edit', [$item->id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('permissions.destroy', [$item->id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">{{ $title }}</h4>
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">{{ $title }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- end page title -->
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('permission.generatePermissionFromRoutes') }}"
|
||||
class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i>Generate Permissions</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
@include('crud.generated.permissions.action')
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap5.min.css" />
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.2.9/css/responsive.bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.2/css/buttons.dataTables.min.css">
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/responsive/2.2.9/js/dataTables.responsive.min.js"></script>
|
||||
<script src="{{ asset('assets/js/pages/datatables.init.js') }}"></script>
|
||||
@endpush
|
||||
|
@ -1,28 +0,0 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('permissions.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Guard Name : </b> <span>{{$data->guard_name}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -1,34 +1,43 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Roles') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('roles.index')); ?>
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">{{ $title }}</h4>
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">{{ $title }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('role.store') }}" class="needs-validation" novalidate method="post">
|
||||
@csrf
|
||||
@include('crud.generated.partials.role.action', ['btnType' => 'Save'])
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('roles.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('name', 'name', 'Name') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('guard_name', 'guard_name', 'Guard Name') }}
|
||||
</div>
|
||||
<div class="col-lg-6 pb-3">
|
||||
<label for='permission' class="form-label col-form-label"> Permission</label>
|
||||
<select id="permission" name="permission" autocomplete="permission-name" class="form-select">
|
||||
@foreach($permissions as $permission)
|
||||
<option value="0"> Select Permission </option>
|
||||
<option value="{{ $permission->name }}" >{{ $permission->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('roles.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
|
@ -1,69 +1,45 @@
|
||||
@extends('backend.template')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="card col-8">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ __('Edit Roles') }}</h2>
|
||||
<a href="{{ route('roles.index') }}" class="btn btn-primary btn-cancel">Cancel</a>
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">{{ $title }}</h4>
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">{{ $title }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ html()->modelForm($role, 'PUT')->route('role.update', $role->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{ route('roles.update', [$data->id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('crud.generated.partials.role.action', ['btnType' => 'Save'])
|
||||
|
||||
<input type="hidden" name="id" value="{{ $data->id }}" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" id="name" name="name" class="form-control"
|
||||
value="{{ $data->name }}">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<label for="guard_name" class="form-label">Guard Name</label>
|
||||
<input type="text" id="guard_name" name="guard_name" class="form-control"
|
||||
value="{{ $data->guard_name }}">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 pb-3">
|
||||
<label for="permission" class="form-label">Permission</label>
|
||||
<select id="permission" name="permission" class="form-select">
|
||||
<option value="0">Add Permissions</option>
|
||||
@foreach ($permissions as $permission)
|
||||
<option value="{{ $permission->name }}">{{ $permission->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary btn-update">Submit</button>
|
||||
<a href="{{ route('roles.index') }}" class="btn btn-primary btn-cancel">Cancel</a>
|
||||
{{ html()->closeModelForm() }}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
|
||||
<div class="card col-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h4>{{ __('Roles with permissions') }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($data->permissions)
|
||||
@foreach ($data->permissions as $role_permission)
|
||||
<form class="d-inline-block" method="POST" action="{{route('roles.permissions.revoke',[$data->id,$role_permission->id])}}"
|
||||
onsubmit="return confirm('Are you sure?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">{{ $role_permission->name }}</button>
|
||||
</form>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
||||
|
@ -1,185 +1,66 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Roles List') }}</h2>
|
||||
<a href="{{ route('roles.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_roles">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('name') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('guard_name') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{ $item->id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->guard_name }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('roles.show', [$item->id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('roles.edit', [$item->id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('roles.destroy', [$item->id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Role Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('role.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Role</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table"
|
||||
style="width:100%">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Name</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Guard</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span
|
||||
class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($roles as $index => $role)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $role->name }}</td>
|
||||
<td class="tb-col">{{ $role->guard_name }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<a href="javascript:void(0);" class="link-info fs-15 view-item-btn"
|
||||
data-bs-toggle="modal" data-bs-target="#viewModal">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
<a href="{{ route('role.edit', $role->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i
|
||||
class="ri-edit-2-line"></i></a>
|
||||
|
||||
<a href="javascript:void(0);"
|
||||
data-link="{{ route('role.destroy', $role->id) }}"
|
||||
data-id="{{ $role->id }}"
|
||||
class="link-danger fs-15 remove-item"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -1,28 +0,0 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('roles.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Name : </b> <span>{{$data->name}}</span></p><p><b>Guard Name : </b> <span>{{$data->guard_name}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -79,7 +79,7 @@
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('settings.destroy', [$item->setting_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
class="dropdown-item remove-item" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
@ -1,25 +1,42 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Users') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('users.index')); ?>
|
||||
@extends('backend.template')@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">{{ $title }}</h4>
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">{{ $title }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('users.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('name', 'name', 'Name') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('email', 'email', 'Email') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('username', 'username', 'Username') }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('users.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('user.store') }}" class="needs-validation" novalidate method="post">
|
||||
@csrf
|
||||
@include('crud.generated.partials.user.action')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
|
@ -1,100 +1,47 @@
|
||||
@extends('backend.template')
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ __('Edit Users') }}</h2>
|
||||
<a href="{{ route('users.index') }}" class="btn btn-primary btn-cancel">Cancel</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('users.update', [$data->id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf
|
||||
@method('POST')
|
||||
<input type="hidden" name="id" value="{{ $data->id }}" />
|
||||
<div class="row">
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" id="name" name="name" class="form-control"
|
||||
value="{{ $data->name }}">
|
||||
</div>
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" id="email" name="email" class="form-control"
|
||||
value="{{ $data->email }}">
|
||||
</div>
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label for="role" class="form-label">Roles</label>
|
||||
<select id="role" name="role" autocomplete="role" class="form-select">
|
||||
<option value="0"> Add Roles </option>
|
||||
@foreach ($roles as $role)
|
||||
<option value="{{ $role->name }}">{{ $role->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">{{ $title }}</h4>
|
||||
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label for="permission" class="form-label">Permission</label>
|
||||
<select id="permission" name="permission" autocomplete="permission-name"
|
||||
class="form-select">
|
||||
<option value="0"> Add Permission </option>
|
||||
@foreach ($permissions as $permission)
|
||||
<option value="{{ $permission->name }}">{{ $permission->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary btn-update">Submit</button>
|
||||
<a href="{{ route('users.index') }}" class="btn btn-primary btn-cancel">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">{{ $title }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>{{ __('Roles') }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($data->roles)
|
||||
@foreach ($data->roles as $user_role)
|
||||
<form class="d-inline-block" method="POST"
|
||||
action="{{ route('users.roles.remove', [$data->id, $user_role->id]) }}"
|
||||
onsubmit="return confirm('Are you sure?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">{{ $user_role->name }}</button>
|
||||
</form>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>{{ __('Permissions') }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($data->permissions)
|
||||
@foreach ($data->permissions as $user_permission)
|
||||
<form class="d-inline-block" method="POST"
|
||||
action="{{ route('users.permissions.revoke', [$data->id, $user_permission->id]) }}"
|
||||
onsubmit="return confirm('Are you sure?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">{{ $user_permission->name }}</button>
|
||||
</form>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ html()->modelForm($user, 'PUT')->route('user.update', $user->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('crud.generated.partials.user.action')
|
||||
|
||||
{{ html()->closeModelForm() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
|
@ -1,187 +1,80 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Users List') }}</h2>
|
||||
{{-- <a href="{{ route('users.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a> --}}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_users">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('name') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('email') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('username') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{ $item->id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->name }}</td>
|
||||
<td class="tb-col">{{ $item->email }}</td>
|
||||
<td class="tb-col">{{ $item->username }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('users.show', [$item->id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('users.edit', [$item->id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('users.destroy', [$item->id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">User Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('user.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create User</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table"
|
||||
style="width:100%">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Username</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Email</span></th>
|
||||
{{-- <th class="tb-col"><span class="overline-title">Employee</span></th> --}}
|
||||
<th class="tb-col"><span class="overline-title">Role</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span
|
||||
class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($users as $index => $user)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $user->name }}</td>
|
||||
<td class="tb-col">{{ $user->email }}</td>
|
||||
{{-- <td class="tb-col">
|
||||
{{ $user->employee?->full_name }}
|
||||
<p class="small text-muted">{{ $user->employee?->department?->name }}
|
||||
</p>
|
||||
</td> --}}
|
||||
<td class="tb-col">{{ $user->roles?->first()?->name }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<a href="javascript:void(0);" class="link-info fs-15 view-item-btn"
|
||||
data-bs-toggle="modal" data-bs-target="#viewModal">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
<a href="{{ route('user.edit', $user->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i
|
||||
class="ri-edit-2-line"></i></a>
|
||||
|
||||
<a href="javascript:void(0);"
|
||||
data-link="{{ route('user.destroy', $user->id) }}"
|
||||
data-id="{{ $user->id }}"
|
||||
class="link-danger fs-15 remove-item"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('crud.generated.partials.user.view')
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -45,7 +45,11 @@
|
||||
<button type="submit">लगइन</button>
|
||||
</form>
|
||||
<div class="important-text">
|
||||
<p>खाता छैन? <a href="{{route('userRegister')}}">लगइन गर्नुहोस! </a></p>
|
||||
<form action={{ route('userRegister') }} method="POST">
|
||||
@csrf
|
||||
{{-- @method('GET') --}}
|
||||
<p>खाता छ? <a href="{{ route('userRegister') }}">रजिस्टर गर्नुहोस ! </a> </p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<div class="container">
|
||||
<div class="register-form">
|
||||
<h2>रजिस्टर</h2>
|
||||
<form id="register-form" action={{ route('postresgistration') }}>
|
||||
<form id="register-form" action={{ route('postRegistration') }}>
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label>नाम</label>
|
||||
@ -48,7 +48,7 @@
|
||||
<button type="submit">रजिस्टर गर्नुहोस</button>
|
||||
</form>
|
||||
<div class="important-text">
|
||||
<p>खाता छ? <a href="{{route('postresgistration')}}">रजिस्टर गर्नुहोस !</a></p>
|
||||
<p>खाता छ? <a href="{{route('postRegistration')}}">लगइन गर्नुहोस!</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,8 +1,7 @@
|
||||
@extends('hulaki_khabar.layout.layout')
|
||||
@section('meta')
|
||||
<meta property="og:title" content="{{ $news->title }}" />
|
||||
<meta property="og:description"
|
||||
content="{{ $news->title}}" />
|
||||
<meta property="og:description" content="{{ $news->title }}" />
|
||||
<meta property="og:image" content="{{ asset($news->thumb) }}" />
|
||||
@endsection
|
||||
@push('css')
|
||||
@ -128,9 +127,110 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="comments-area">
|
||||
<h3 class="comments-title">२ कमेन्ट :</h3>
|
||||
<ol class="comment-list">
|
||||
@foreach ($newsWithComment as $comment)
|
||||
@if ($comment->comments->isNotEmpty())
|
||||
@foreach ($comment->comments as $item)
|
||||
<li class="comment">
|
||||
<div class="comment-body">
|
||||
<footer class="comment-meta">
|
||||
<div class="comment-author vcard">
|
||||
<img src="https://templates.envytheme.com/depan/default/assets/img/client/client-1.jpg"
|
||||
class="avatar" alt="image">
|
||||
<b class="fn">{{ $item->user?->name }} </b>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="comment-content">
|
||||
<p>{{ $item->content }}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@if ($item->subcomments)
|
||||
<ol class="children">
|
||||
@foreach ($item->subcomments as $subcomment)
|
||||
<li class="comment">
|
||||
<div class="comment-body">
|
||||
<footer class="comment-meta">
|
||||
<div class="comment-author vcard">
|
||||
<img src="https://templates.envytheme.com/depan/default/assets/img/client/client-2.jpg"
|
||||
class="avatar" alt="image">
|
||||
<b class="fn">{{ $subcomment->user?->name }}</b>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="comment-content">
|
||||
<p>{{ $subcomment->content }}</p>
|
||||
</div>
|
||||
{{-- @if ($loop->last)
|
||||
<div class="reply">
|
||||
<form action="{{ route('comments.store') }}"
|
||||
method="POST" id="comment">
|
||||
@csrf
|
||||
<input type="hidden" name='news_id'
|
||||
value="{{ $news->news_id }}">
|
||||
<input type="hidden" name='users_id'
|
||||
value="{{ auth()->user()->id }}">
|
||||
<input type="hidden" name='parent_id'
|
||||
value="{{ $item->id }}">
|
||||
<textarea name="content"></textarea>
|
||||
<input type="submit" value="Reply">
|
||||
</form>
|
||||
</div>
|
||||
@endif --}}
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</ol>
|
||||
@else
|
||||
<div class="reply">
|
||||
<form action="{{ route('comments.store') }}" method="POST" id="comment">
|
||||
@csrf
|
||||
<input type="hidden" name='news_id' value="{{ $news->news_id }}">
|
||||
<input type="hidden" name='users_id' value="{{ auth()->user()->id }}">
|
||||
<input type="hidden" name='parent_id' value="{{ $item->id }}">
|
||||
<textarea name="content"></textarea>
|
||||
<input type="submit" value="Reply">
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
<div class="reply">
|
||||
<form action="{{ route('comments.store') }}"
|
||||
method="POST" id="comment">
|
||||
@csrf
|
||||
<input type="hidden" name='news_id'
|
||||
value="{{ $news->news_id }}">
|
||||
<input type="hidden" name='users_id'
|
||||
value="{{ auth()->user()->id }}">
|
||||
<input type="hidden" name='parent_id'
|
||||
value="{{ $item->id }}">
|
||||
<textarea name="content"></textarea>
|
||||
<input type="submit" value="Reply">
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="reply">
|
||||
<form action="{{ route('comments.store') }}" method="POST" id="comment">
|
||||
@csrf
|
||||
<input type="hidden" name='news_id' value="{{ $news->news_id }}">
|
||||
<input type="hidden" name='users_id' value="{{ auth()->user()->id }}">
|
||||
{{-- <input type="hidden" name='parent_id' value="{{ $item->id }}"> --}}
|
||||
<textarea name="content"></textarea>
|
||||
<input type="submit" value="Reply">
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3" id="sidebar">
|
||||
<aside class="widget-area mt-50">
|
||||
<section class="widget widget_featured_reports">
|
||||
@ -155,12 +255,6 @@
|
||||
@endforeach
|
||||
</section>
|
||||
</div><br>
|
||||
|
||||
{{-- <section class="widget widget_featured_reports">
|
||||
<img src="{{ asset('hulaki/assets/img/ad/prabhu_pay_onlinekhabar.gif') }}" alt="image"
|
||||
class="img-fluid">
|
||||
</section> --}}
|
||||
|
||||
</aside>
|
||||
</div>
|
||||
</div>
|
||||
@ -168,3 +262,20 @@
|
||||
</section>
|
||||
<!-- Start News Details Area -->
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#comment").submit(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: "{{ route('comments.store') }}",
|
||||
type: "POST",
|
||||
data: $(this).serialize(),
|
||||
success: function(data) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
Reference in New Issue
Block a user