?
@extends('layoutsdashboard.dashboard-design', [
'webtitle' => 'My CMS Blocks',
])
@section('content')
<script src="{{ url('/userjs/tinymce/tinymce.min.js') }}" referrerpolicy="origin"></script>
<style>
.tox .tox-statusbar__branding svg {
fill: rgb(216 220 225 / 80%);
}
.tox .tox-statusbar__branding a:focus:not(:disabled):not([aria-disabled=true]) svg,
.tox .tox-statusbar__branding a:hover:not(:disabled):not([aria-disabled=true]) svg {
fill: #eff2f5;
}
</style>
<div class="section-userdata">
<div class="container py-4">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="card shadow">
<div class="card-header card-title bg-transparent px-0">
<h4>Manage Blocks</h4>
</div>
<div class="row">
<div class="col-md-12">
<div class=" form-top alert alert-danger">
@include('error.error-display')
</div>
<form method="POST" action="{{ url('') }}/createpagesupdate" id="createpagesupdate"
enctype="multipart/form-data">
@csrf
<input name="template" type="hidden" class="@error('template') is-invalid @enderror"
value="1">
<input name="language" type="hidden" class="@error('language') is-invalid @enderror"
value="1">
<input name="blockid" type="hidden" class="@error('language') is-invalid @enderror"
value="{{ $data->id ?? '' }}">
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
<select name="navigation"
class="form-control @error('type') is-invalid @enderror"
value="{{ old('Navigation') }}">
<option value='0' selected>Select Navigation</Option>
@foreach ($navData as $navOption)
<option value='{{ $navOption->id }}'
@if ($navOption->id == ($data->categoryid ?? '')) selected @endif>
>{{ $navOption->title }}</option>
@foreach ($navOption->navSub as $subOption)
@if ($subOption->id != '')
<option
value='{{ $subOption->id }}'@if ($subOption->id == ($data->categoryid ?? '')) selected @endif>
>>{{ $subOption->title }}</option>
@foreach ($subOption->navSub as $subsubOption)
@if ($subsubOption->id != '')
<option value='{{ $subsubOption->id }}'
@if ($subsubOption->id == ($data->categoryid ?? '')) selected @endif>
>>>{{ $subsubOption->title }}</option>
@endif
@endforeach
@endif
@endforeach
@endforeach
</select>
@error('Navigation')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Navigation</label>
</div>
</div>
<div class="col">
<div class="form-floating mb-2">
<select name="type"
class="form-control @error('type') is-invalid @enderror"
value="{{ old('type') }}">
<option value='0'>Select Type</option>
@foreach ($typeData as $typeOption)
<option value='{{ $typeOption->id }}'
@if ($typeOption->id == ($data->typeid ?? '')) selected @endif>
{{ $typeOption->title }}</option>
@endforeach
</select>
@error('type')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Type</label>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
<select name="type"
class="form-control @error('type') is-invalid @enderror"
value="{{ old('type') }}">
<option value='0'>Select Parent</option>
@foreach ($blockParentData as $typeOption)
<option value='{{ $typeOption->id }}'
@if ($typeOption->id == ($data->parentid ?? '')) selected @endif>
{{ $typeOption->title }}</option>
@endforeach
</select>
@error('type')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Parent (for sub navigation / optional)</label>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
<input name="URL" id='floatingInput' type="text"
class="form-control @error('URL') is-invalid @enderror"
value="{{ old('URL') }}{{ $data->URL ?? '' }}" placeholder="URL"
autocomplete="off">
<label for="floatingInput">URL(optional / Used when referring to external site with https)</label>
@error('URL')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
</div>
</div>
<div class="col">
<div class="form-floating mb-2">
<input name="URLroute" id='floatingInput' type="text"
class="form-control @error('URLroute') is-invalid @enderror"
value="{{ old('URLroute') }}{{ $data->URLroute ?? '' }}"
placeholder="URLroute" autocomplete="off">
<label for="floatingInput">URLRoute (optional / Used when referring to existing site page)</label>
@error('URL')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
<input name="title" id='floatingInput' type="text"
class="form-control @error('title') is-invalid @enderror"
value="{{ old('title') }}{{ $data->title ?? '' }}"
placeholder="title" autocomplete="off">
<label for="floatingInput">Title</label>
@error('title')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
</div>
</div>
<div class="col">
<div class="form-floating mb-2">
<input name="subtitle" id='floatingInput' type="text"
class="form-control
@error('subtitle') is-invalid @enderror"
value="{{ old('subtitle') }}{{ $data->subtitle ?? '' }}"
placeholder="Sub Title" autocomplete="off">
<label for="floatingInput">Sub Title</label>
@error('subtitle')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
<input name="metades" type="text"
class="form-control @error('metades') is-invalid @enderror"
value="{{ $data->meta ?? '' }}{{ old('metades') }}"
placeholder="Metal Description" autocomplete="off">
@error('metades')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Meta Description</label>
</div>
</div>
<div class="col">
<div class="form-floating mb-2">
<input name="keyword" type="text"
class="form-control @error('keyword') is-invalid @enderror"
value="{{ $data->keyword ?? '' }}{{ old('keyword') }}"
placeholder="keyword" autocomplete="off">
@error('keyword')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Keyword</label>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
<input name="benefit1" type="text"
class="form-control @error('benefit1') is-invalid @enderror"
value="{{ $data->benefit1 ?? '' }}{{ old('benefit1') }}"
placeholder="Benefit" autocomplete="off">
@error('benefit1')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Benefit 1</label>
</div>
</div>
<div class="col">
<div class="form-floating mb-2">
<input name="benefit2" type="text"
class="form-control @error('benefit2') is-invalid @enderror"
value="{{ $data->benefit2 ?? '' }}{{ old('benefit2') }}"
placeholder="Benefit" autocomplete="off">
@error('benefit2')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Benefit 2</label>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
<input name="benefit3" type="text"
class="form-control @error('benefit3') is-invalid @enderror"
value="{{ $data->benefit3 ?? '' }}{{ old('benefit3') }}"
placeholder="Benefit" autocomplete="off">
@error('benefit3')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Benefit 3</label>
</div>
</div>
<div class="col">
<div class="form-floating mb-2">
<input name="benefit4" type="text"
class="form-control @error('benefit4') is-invalid @enderror"
value="{{ $data->benefit4 ?? '' }}{{ old('benefit4') }}"
placeholder="Benefit" autocomplete="off">
@error('benefit4')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Benefit 4</label>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col ">
<div class="form-floating mb-2">
<input name="videoembed" type="text"
class="form-control @error('videoembed') is-invalid @enderror"
value="{{ $data->videoembed ?? '' }}{{ old('videoembed') }}"
placeholder="Video Embed" autocomplete="off">
@error('videoembed')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
<label for="floatingInput">Video Embed</label>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col mb-2">
<div class="list-group-item d-flex justify-content-between align-items-center">
<label for="enablefaq" class="form-check-label h6 mb-0">Enable FAQ
Section</label>
<div class="form-check form-switch">
<input type="hidden" name="enablefaq" value="1">
<input class="form-check-input" type="checkbox" role="switch"
id="enablefaq" name="enablefaq" value="2"
{{-- {{ $data->enablefaq == '2' ? 'checked' : '' }} --}}
{{ isset($data->enablefaq) && $data->enablefaq == '2' ? 'checked' : '' }}>
</div>
</div>
</div>
<div class="col mb-2">
<div class="list-group-item d-flex justify-content-between align-items-center">
<label for="enableteam" class="form-check-label h6 mb-0">Enable
Team Section</label>
<div class="form-check form-switch">
<input type="hidden" name="enableteam" value="1">
<input class="form-check-input" type="checkbox" role="switch"
id="enableteam" name="enableteam" value="2"
{{-- {{ $data->enableteam == '2' ? 'checked' : '' }} --}}
{{ isset($data->enableteam) && $data->enableteam == '2' ? 'checked' : '' }}>
</div>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col mb-2">
<div class="list-group-item d-flex justify-content-between align-items-center">
<label for="enabletestimonial" class="form-check-label h6 mb-0">Enable
Testimonials Section</label>
<div class="form-check form-switch">
<input type="hidden" name="enabletestimonial" value="1">
<input class="form-check-input" type="checkbox" role="switch"
id="enabletestimonial" name="enabletestimonial" value="2"
{{-- {{ $data->enabletestimonial == '2' ? 'checked' : '' }} --}}
{{ isset($data->enabletestimonial) && $data->enabletestimonial == '2' ? 'checked' : '' }}>
</div>
</div>
</div>
<div class="col mb-2">
<div class="list-group-item d-flex justify-content-between align-items-center">
<label for="enablewidget" class="form-check-label h6 mb-0">Enable
Support Widget</label>
<div class="form-check form-switch">
<input type="hidden" name="enablewidget" value="1">
<input class="form-check-input" type="checkbox" role="switch"
id="enablewidget" name="enablewidget" value="2"
{{-- {{ $data->enablewidget == '2' ? 'checked' : '' }} --}}
{{ isset($data->enablewidget) && $data->enablewidget == '2' ? 'checked' : '' }}>
</div>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col mb-2">
<div class="list-group-item d-flex justify-content-between align-items-center">
<label for="enablebanner" class="form-check-label h6 mb-0">Enable
Promotional Banner</label>
<div class="form-check form-switch">
<input type="hidden" name="enablebanner" value="1">
<input class="form-check-input" type="checkbox" role="switch"
id="enablebanner" name="enablebanner" value="2"
{{-- {{ $data->enablebanner == '2' ? 'checked' : '' }} --}}
{{ isset($data->enablebanner) && $data->enablebanner == '2' ? 'checked' : '' }}>
</div>
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="form-floating mb-2">
{{-- <input name="description" type="text" class="form-control @error('description') is-invalid @enderror" value="{{old('description')}}"
placeholder="description" autocomplete="off" > --}}
<textarea name="description" class="form-control @error('description') is-invalid @enderror"
placeholder="description">{{ old('description') }}{{ $data->description ?? '' }}</textarea>
<label for="floatingInput">Description</label>
@error('description')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="input-group mb-2">
<label class="input-group-text" for="file-input">
<i class="bi bi-card-image"><span>Upload Image</span></i>
</label>
<input name="uploadImage[]" type="file"
class="form-control @error('uploadImage') is-invalid @enderror"
value="{{ old('uploadImage') }}" multiple placeholder="Upload Image">
<i class="bi bi-info-circle-fill" data-bs-toggle="tooltip"
data-bs-placement="right" data-bs-title="Image size is 466x446"></i>
@error('uploadImage')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
</div>
</div>
</div>
<div class="row g-2 ">
<div class="col">
<div class="input-group mb-2">
<label class="input-group-text" for="file-input">
<i class="bi bi-file-earmark-text"><span>Upload Document</span></i>
</label>
<input name="uploadDoc[]" type="file"
class="form-control @error('uploadDoc') is-invalid @enderror"
value="{{ old('uploadDoc') }}" placeholder="Upload Document">
@error('uploadDoc')
<div class="alert alert-danger">{{ $message }}</div>
@enderror
</div>
</div>
</div>
<div class="submitbtn my-3">
<button class="btn btn-lg btn-primary hvr-rectangle-out" type="submit"
form='createpagesupdate'>Submit <i
class="fa fa-arrow-circle-right"></i></button>
</div>
</form>
{{-- <ul class="uploadimage">
@if (!empty($Event->coverimage))
<li>
<i class="bi bi-card-image"></i>
<div class="imgdelete">
<a href="{{url('admin-Event-drop'.'/'.$Event->id.'/2') }}"> <i class="fa fa-times" aria-hidden="true"></i></a>
</div>
</li>
@endif
</ul> --}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function() {
$('[data-bs-toggle="tooltip"]').tooltip();
});
</script>
<script>
tinymce.init({
selector: 'textarea',
height: 500,
menubar: true,
plugins: 'advlist autolink lists link charmap preview anchor searchreplace visualblocks fullscreen insertdatetime table help wordcount',
toolbar: 'undo redo | formatselect | ' + 'bold italic backcolor | alignleft aligncenter ' +
'alignright alignjustify | bullist numlist outdent indent | ' + 'removeformat | help',
toolbar1: false,
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
});
</script>
@stop