Merge remote-tracking branch 'origin/Page_Issue' into development

This commit is contained in:
RaffiMohammed
2023-10-26 13:31:43 +05:30
16 changed files with 735 additions and 39 deletions

View File

@@ -83,7 +83,7 @@ class="nav-item menu-open"
<div class="form-group col-sm-12 {{ $errors->has('description') ? 'has-error' : '' }}">
{!! Form::label('description',Lang::get('lang.description')) !!}
<span class="text-red"> *</span>
<div class="form-group" style="background-color:white">
{!! Form::textarea('description',null,['class' => 'form-control color','size' => '110x15','id'=>'myNicEditor','placeholder'=>Lang::get('lang.enter_the_description')]) !!}
</div>

View File

@@ -35,7 +35,7 @@ class="nav-item menu-open"
@section('content')
{!! Form::model($page,['url' => 'page/'.$page->slug, 'method' => 'PATCH','files'=>true]) !!}
{!! Form::model($page,['url' => 'page/'.$page->id, 'method' => 'PATCH','files'=>true]) !!}
@if(Session::has('errors'))
<?php //dd($errors); ?>
@@ -130,7 +130,7 @@ class="nav-item menu-open"
</div>
<div class="card-footer">
{!! Form::submit(Lang::get('lang.publish'),['class'=>'btn btn-primary'])!!}
</div>
</div>

View File

@@ -254,9 +254,22 @@ $category_id = $all->pluck('category_id')->toArray();
$(".form-group").removeClass("has-error");
// Perform your custom validation here
var name = $("#comment-name").val().trim();
var email = $("#comment-email").val().trim();
var comment = $("#comment-comment").val().trim();
var nameElement = $("#comment-name");
var emailElement = $("#comment-email");
var commentElement = $("#comment-comment");
if (nameElement.length > 0) {
var name = nameElement.val().trim();
}
if (emailElement.length > 0) {
var email = emailElement.val().trim();
}
if (commentElement.length > 0) {
var comment = commentElement.val().trim();
}
// Flag to track if there are any errors
var hasErrors = false;

View File

@@ -160,7 +160,11 @@
</ul>
</li>
<?php $pages = App\Model\kb\Page::where('status', '1')->where('visibility', '1')->get();
<?php
if(!Auth::check() || Auth::user()->role == 'user')
$pages = App\Model\kb\Page::where('status', '1')->where('visibility', '1')->get();
else
$pages = App\Model\kb\Page::where('status', '1')->get();
?>
@if(count($pages))
<li @yield('pages') class="nav-item dropdown">