Added CRUD routes for benefits, success stories, and visa grants
Landing registration page completed except design
This commit is contained in:
@ -75,9 +75,11 @@
|
||||
|
||||
|
||||
<li class="menu-title"><i class="ri-more-fill"></i> <span data-key="t-pages">Pages</span></li>
|
||||
{{ CCMS::createMenuLink('Page', route('articles.index')) }}
|
||||
{{ CCMS::createMenuLink('Services', route('services.index')) }}
|
||||
{{ CCMS::createMenuLink('Enquiries', route('enquiries-list')) }}
|
||||
{{ CCMS::createMenuLink('Testimonials', route('success_stories.index')) }}
|
||||
{{ CCMS::createMenuLink('Benefits', route('benefits.index')) }}
|
||||
{{ CCMS::createMenuLink('Success Stories', route('visa_grants.index')) }}
|
||||
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
167
resources/views/crud/generated/benefits/create.blade.php
Normal file
167
resources/views/crud/generated/benefits/create.blade.php
Normal file
@ -0,0 +1,167 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- 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">Add Benefits</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">Add Benefits</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('benefits.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="card mt-3">
|
||||
<h4>Custom Details</h4>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('benefits.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover', 'Cover Photo') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image_thumb', 'Image Thumb') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('benefits.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
createFormFieldsRepeater();
|
||||
// addFormField();
|
||||
// const addButtonContainer = document.getElementById('add-button-container');
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Fields';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title')
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer4.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
makeSortable();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
@endpush
|
233
resources/views/crud/generated/benefits/edit.blade.php
Normal file
233
resources/views/crud/generated/benefits/edit.blade.php
Normal file
@ -0,0 +1,233 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- 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">Edit Benefits</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">Edit Benefits</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('benefits.update', $data->benefit_id) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='benefit_id' value='{{ $data->benefit_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div>
|
||||
@if ($data->extra_content)
|
||||
@foreach (json_decode($data->extra_content) as $content)
|
||||
<div class="form-field row">
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Title
|
||||
</label><input type="text" name="fieldTitles[]" placeholder="Title"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldTitle }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Header
|
||||
</label><input type="text" name="fieldHeader[]" placeholder="Header"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldHeader }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
Description </label><input type="text" name="fieldDescriptions[]"
|
||||
class="form-control" value="{{ $content->fieldDescriptions }}"></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
<span class="row-selector-handle">☰</span></label><button
|
||||
class="btn btn-danger col form-control" onclick="removeRow(this);">Remove
|
||||
Field</button></div>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<h5>Additional Content</h5>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->sec_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('benefits.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('cover', 'Cover Photo', '', $data->cover_photo) }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('image_thumb', 'Image Thumb', '', $data->image_thumb) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('benefits.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Field';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
|
||||
// Create form field container
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
// header input
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title');
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
//description input
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
//event.preventDefault();
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer3.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
|
||||
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
}
|
||||
makeSortable();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function removeRow(button) {
|
||||
event.preventDefault();
|
||||
const row = button.parentNode.parentNode;
|
||||
row.parentNode.removeChild(row);
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createFormFieldsRepeater();
|
||||
</script>
|
||||
@endpush
|
231
resources/views/crud/generated/benefits/index.blade.php
Normal file
231
resources/views/crud/generated/benefits/index.blade.php
Normal file
@ -0,0 +1,231 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Benefits List") }}</h2>
|
||||
<a href="{{ route('benefits.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_benefits" data-url="{{ route('benefits.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("display") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("extra_content") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("cover") }}</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->benefit_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->display }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">{{ $item->extra_content }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover) }}</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('benefits.show',[$item->benefit_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('benefits.edit',[$item->benefit_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('benefits.toggle',[$item->benefit_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('benefits.destroy',[$item->benefit_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('benefits.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
|
||||
|
29
resources/views/crud/generated/benefits/show.blade.php
Normal file
29
resources/views/crud/generated/benefits/show.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><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('benefits.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Display : </b> <span>{{$data->display}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Extra Content : </b> <span>{{$data->extra_content}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</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
|
167
resources/views/crud/generated/success_stories/create.blade.php
Normal file
167
resources/views/crud/generated/success_stories/create.blade.php
Normal file
@ -0,0 +1,167 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- 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">Add Success Stories</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">Add Success Stories</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('success_stories.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="card mt-3">
|
||||
<h4>Custom Details</h4>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('success_stories.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover', 'Cover Photo') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image_thumb', 'Image Thumb') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('success_stories.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
createFormFieldsRepeater();
|
||||
// addFormField();
|
||||
// const addButtonContainer = document.getElementById('add-button-container');
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Fields';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title')
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer4.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
makeSortable();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
@endpush
|
233
resources/views/crud/generated/success_stories/edit.blade.php
Normal file
233
resources/views/crud/generated/success_stories/edit.blade.php
Normal file
@ -0,0 +1,233 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- 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">Edit Success Stories</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">Edit Success Stories</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('success_stories.update', $data->stories_id) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='stories_id' value='{{ $data->stories_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div>
|
||||
@if ($data->extra_content)
|
||||
@foreach (json_decode($data->extra_content) as $content)
|
||||
<div class="form-field row">
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Title
|
||||
</label><input type="text" name="fieldTitles[]" placeholder="Title"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldTitle }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Header
|
||||
</label><input type="text" name="fieldHeader[]" placeholder="Header"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldHeader }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
Description </label><input type="text" name="fieldDescriptions[]"
|
||||
class="form-control" value="{{ $content->fieldDescriptions }}"></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
<span class="row-selector-handle">☰</span></label><button
|
||||
class="btn btn-danger col form-control" onclick="removeRow(this);">Remove
|
||||
Field</button></div>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<h5>Additional Content</h5>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->sec_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('success_stories.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('cover', 'Cover Photo', '', $data->cover_photo) }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('image_thumb', 'Image Thumb', '', $data->image_thumb) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('success_stories.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Field';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
|
||||
// Create form field container
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
// header input
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title');
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
//description input
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
//event.preventDefault();
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer3.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
|
||||
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
}
|
||||
makeSortable();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function removeRow(button) {
|
||||
event.preventDefault();
|
||||
const row = button.parentNode.parentNode;
|
||||
row.parentNode.removeChild(row);
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createFormFieldsRepeater();
|
||||
</script>
|
||||
@endpush
|
231
resources/views/crud/generated/success_stories/index.blade.php
Normal file
231
resources/views/crud/generated/success_stories/index.blade.php
Normal file
@ -0,0 +1,231 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Success_stories List") }}</h2>
|
||||
<a href="{{ route('success_stories.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_success_stories" data-url="{{ route('success_stories.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("display") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("extra_content") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("cover") }}</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->stories_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->display }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">{{ $item->extra_content }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover) }}</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('success_stories.show',[$item->stories_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('success_stories.edit',[$item->stories_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('success_stories.toggle',[$item->stories_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('success_stories.destroy',[$item->stories_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('success_stories.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
|
||||
|
@ -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><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('success_stories.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Display : </b> <span>{{$data->display}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Extra Content : </b> <span>{{$data->extra_content}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</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
|
168
resources/views/crud/generated/visa_grants/create.blade.php
Normal file
168
resources/views/crud/generated/visa_grants/create.blade.php
Normal file
@ -0,0 +1,168 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- 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">Add Visa Grants</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">Add Visa Grants</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('visa_grants.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="card mt-3">
|
||||
<h4>Custom Details</h4>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('visa_grants.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover', 'Cover Photo') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image_thumb', 'Image Thumb') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('visa_grants.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
createFormFieldsRepeater();
|
||||
// addFormField();
|
||||
// const addButtonContainer = document.getElementById('add-button-container');
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Fields';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title')
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer4.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
makeSortable();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
@endpush
|
234
resources/views/crud/generated/visa_grants/edit.blade.php
Normal file
234
resources/views/crud/generated/visa_grants/edit.blade.php
Normal file
@ -0,0 +1,234 @@
|
||||
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- 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">Edit Visa Grants</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">Edit Visa Grants</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('visa_grants.update', $data->visa_id) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='visa_id' value='{{ $data->visa_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div>
|
||||
@if ($data->extra_content)
|
||||
@foreach (json_decode($data->extra_content) as $content)
|
||||
<div class="form-field row">
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Title
|
||||
</label><input type="text" name="fieldTitles[]" placeholder="Title"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldTitle }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Header
|
||||
</label><input type="text" name="fieldHeader[]" placeholder="Header"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldHeader }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
Description </label><input type="text" name="fieldDescriptions[]"
|
||||
class="form-control" value="{{ $content->fieldDescriptions }}"></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
<span class="row-selector-handle">☰</span></label><button
|
||||
class="btn btn-danger col form-control" onclick="removeRow(this);">Remove
|
||||
Field</button></div>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<h5>Additional Content</h5>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->sec_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('visa_grants.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('cover', 'Cover Photo', '', $data->cover) }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('image_thumb', 'Image Thumb', '', $data->image_thumb) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('visa_grants.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Field';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
|
||||
// Create form field container
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
// header input
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title');
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
//description input
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
//event.preventDefault();
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer3.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
|
||||
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
}
|
||||
makeSortable();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function removeRow(button) {
|
||||
event.preventDefault();
|
||||
const row = button.parentNode.parentNode;
|
||||
row.parentNode.removeChild(row);
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createFormFieldsRepeater();
|
||||
</script>
|
||||
@endpush
|
231
resources/views/crud/generated/visa_grants/index.blade.php
Normal file
231
resources/views/crud/generated/visa_grants/index.blade.php
Normal file
@ -0,0 +1,231 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Visa_grants List") }}</h2>
|
||||
<a href="{{ route('visa_grants.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_visa_grants" data-url="{{ route('visa_grants.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("display") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("extra_content") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("cover") }}</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->visa_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->display }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">{{ $item->extra_content }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover) }}</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('visa_grants.show',[$item->visa_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('visa_grants.edit',[$item->visa_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('visa_grants.toggle',[$item->visa_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('visa_grants.destroy',[$item->visa_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('visa_grants.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
|
||||
|
29
resources/views/crud/generated/visa_grants/show.blade.php
Normal file
29
resources/views/crud/generated/visa_grants/show.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><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('visa_grants.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Display : </b> <span>{{$data->display}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Extra Content : </b> <span>{{$data->extra_content}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</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
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user