firstcommit
This commit is contained in:
0
Modules/FAQ/resources/assets/.gitkeep
Normal file
0
Modules/FAQ/resources/assets/.gitkeep
Normal file
0
Modules/FAQ/resources/assets/js/app.js
Normal file
0
Modules/FAQ/resources/assets/js/app.js
Normal file
0
Modules/FAQ/resources/assets/sass/app.scss
Normal file
0
Modules/FAQ/resources/assets/sass/app.scss
Normal file
0
Modules/FAQ/resources/views/.gitkeep
Normal file
0
Modules/FAQ/resources/views/.gitkeep
Normal file
47
Modules/FAQ/resources/views/create.blade.php
Normal file
47
Modules/FAQ/resources/views/create.blade.php
Normal file
@@ -0,0 +1,47 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Create FAQ
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'FAQ',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'FAQs',
|
||||
'link' => null,
|
||||
],
|
||||
[
|
||||
'title' => 'Add FAQ',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xxl">
|
||||
<div class="card mb-4">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="mb-0">Add Faq</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form
|
||||
action="{{ route('cms.faqs.store')}}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('faq::partial.form')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
49
Modules/FAQ/resources/views/edit.blade.php
Normal file
49
Modules/FAQ/resources/views/edit.blade.php
Normal file
@@ -0,0 +1,49 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
Update FAQ
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'FAQ',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'FAQs',
|
||||
'link' => null,
|
||||
],
|
||||
[
|
||||
'title' => 'Update FAQ',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xxl">
|
||||
<div class="card mb-4">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="mb-0">Update Faq</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('cms.faqs.update', ['uuid' => $faq->uuid]) }}" method="POST"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
@include('faq::partial.form')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
134
Modules/FAQ/resources/views/index.blade.php
Normal file
134
Modules/FAQ/resources/views/index.blade.php
Normal file
@@ -0,0 +1,134 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('title')
|
||||
FAQ
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
@php
|
||||
$breadcrumbData = [
|
||||
[
|
||||
'title' => 'FAQ',
|
||||
'link' => 'null',
|
||||
],
|
||||
[
|
||||
'title' => 'Dashboard',
|
||||
'link' => route('dashboard'),
|
||||
],
|
||||
[
|
||||
'title' => 'FAQs',
|
||||
'link' => null,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
@include('admin::layouts.partials.breadcrumb', $breadcrumbData)
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4 class="card-header">List of FAQ</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="flex-column flex-md-row">
|
||||
<div class="dt-action-buttons text-end pt-3 px-3">
|
||||
<div class="dt-buttons btn-group flex-wrap">
|
||||
<a href="{{ route('cms.faqs.create') }}"
|
||||
class="btn btn-secondary create-new btn-primary d-none d-sm-inline-block text-white">
|
||||
<i class="bx bx-plus me-sm-1"></i>
|
||||
Add New
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-datatable table-responsive">
|
||||
<table class="datatables-users table border-top">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Question</th>
|
||||
<th>Answer</th>
|
||||
<th>Ordering</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="table-border-bottom-0">
|
||||
@if(count($faqs) > 0)
|
||||
@foreach ($faqs ?? [] as $faq)
|
||||
<tr>
|
||||
<td>
|
||||
#{{ $loop->iteration }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Str::words($faq->question, 4, '...') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Str::words($faq->answer, 7, '...') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $faq->ordering }}
|
||||
</td>
|
||||
<td>
|
||||
<span
|
||||
class="badge bg-label-{{ $faq->status == 'active' ? 'success' : 'danger' }}">
|
||||
{{ $faq->status }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<button type="button" class="btn p-0 dropdown-toggle hide-arrow"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="bx bx-dots-vertical-rounded"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('cms.faqs.edit', ['uuid' => $faq->uuid]) }}"><i
|
||||
class="bx bx-edit-alt me-1"></i>
|
||||
Edit</a>
|
||||
|
||||
{{-- <div class="dropdown-item btn-delete" data-name="[ {{ $faq->question }} ]"
|
||||
data-action="{{ route('cms.faqs.delete', ['uuid' => $faq->uuid]) }}"
|
||||
>
|
||||
<i class="bx bx-trash me-1"></i> Delete
|
||||
</div> --}}
|
||||
<form method="POST" action="{{ route('cms.faqs.delete', ['uuid' => $faq->uuid]) }}"
|
||||
id="deleteForm_{{ $faq->uuid }}" class="dropdown-item">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="border-0 bg-transparent deleteBtn"
|
||||
style="color:inherit"><i class="bx bx-trash me-1"></i>
|
||||
Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="6">No record found.</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="px-3">
|
||||
{{ $faqs->links('admin::layouts.partials.pagination') }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
{{-- style --}}
|
||||
@push('required-styles')
|
||||
@include('admin::vendor.dataTables.style')
|
||||
@endpush
|
||||
|
||||
{{-- script --}}
|
||||
@push('required-scripts')
|
||||
@include('admin::vendor.dataTables.script')
|
||||
@endpush
|
29
Modules/FAQ/resources/views/layouts/master.blade.php
Normal file
29
Modules/FAQ/resources/views/layouts/master.blade.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>FAQ Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-faq', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-faq', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
60
Modules/FAQ/resources/views/partial/form.blade.php
Normal file
60
Modules/FAQ/resources/views/partial/form.blade.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="basic-default-name">Question</label>
|
||||
<input type="text" class="form-control" name="question" value="{{ old('question', $faq->question ?? '') }}"
|
||||
placeholder="e.g. How to add about us page? " required />
|
||||
@error('question')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="basic-default-name">Answer</label>
|
||||
<textarea name="" id="mainTextarea" class="d-none">{{ !empty($faq) ? $faq->answer : '' }}</textarea>
|
||||
<textarea name="answer" class="form-control full-editor" id="editorTextarea" rows='5' required
|
||||
placeholder="e.g. First login as admin, then click on the pages from cms and fillup form and submit. "></textarea>
|
||||
@error('answer')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="mb-3 col-md-6"">
|
||||
<label class="form-label" for="basic-default-name">Ordering</label>
|
||||
<input type="number" class="form-control" name="ordering"
|
||||
value="{{ old('ordering', $faq->ordering ?? '') }}" placeholder="e.g. 30" required />
|
||||
@error('ordering')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label class="form-label" for="basic-default-company">Status</label>
|
||||
<select class="select2 form-select" id="basic-default-company select2Basic"
|
||||
aria-label="Default select example" name="status" required>
|
||||
<option value="active"{{ ($faq->status ?? '') == 'active' ? 'selected' : '' }}>Active</option>
|
||||
<option value="inactive"{{ ($faq->status ?? '') == 'inactive' ? 'selected' : '' }}>Inactive</option>
|
||||
</select>
|
||||
@error('status')
|
||||
<div class="text-danger">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
@if (empty($faq))
|
||||
Save Faq
|
||||
@else
|
||||
Update Faq
|
||||
@endif
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('required-styles')
|
||||
@include('admin::vendor.full_editor.style')
|
||||
@include('admin::vendor.select2.style')
|
||||
@endpush
|
||||
|
||||
@push('required-scripts')
|
||||
@include('admin::vendor.textareaContentDisplay.script')
|
||||
@include('admin::vendor.full_editor.script')
|
||||
@include('admin::vendor.select2.script')
|
||||
@endpush
|
Reference in New Issue
Block a user