Server : Apache System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64 User : tradze ( 1001) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/tradze/public_html/app/Modules/Blog/Resources/Views/frontend/ |
@extends('blog::frontend.layouts.master')
@section('content')
<div class="row">
<!-- start left content-->
<div class="col-xs16 col-sm-12 col-md-12">
<div class="text-box">
<div class="title-date">
<div class="title">{{ $post->title }}</div>
<div class="date">{{ $post->created_at->format('M d, Y') }} in {{ $post->category->title }} by {{ $post->user->name }}</div>
</div>
<div class="text-faq">
{!! $post->body !!}
</div>
<div class="read-more-btn">
<a href="{{ $post->category->url }}" class="action-btn">Back to articles</a>
</div>
<div class="text-faq">
<hr>
<div class="title-date">
<div class="title">Comments</div>
</div>
<div class="text-faq">
@forelse($comments as $comment)
<div class="media">
<div class="media-left">
<i class="fa fa-user-secret fa-4x"></i>
</div>
<div class="media-body">
<h4 class="media-heading">{{ $comment->user_name }}</h4>
<div class="date">{{ $post->created_at->format('M d, Y H:i A') }}</div>
{{ $comment->body }}
</div>
</div>
@empty
<div class="media">
<div class="media-body">
<h4 class="media-heading">There are no comments.</h4>
</div>
</div>
@endforelse
</div>
<div class="title-date">
<div class="title">Add a new comment</div>
</div>
<div class="text-faq">
<div class="row">
<div class="col-md-10 col-lg-10 com-sm-16">
{{ Form::open(array('url' => URL::to('blog.addcomment'), 'method' => 'post', 'id'=>'sendComment')) }}
<div class="form-group">
{{ Form::text('name',null,['class'=>'form-control','id'=>'name','placeholder'=>'Full name *']) }}
<span class="white-star error-text" id="error_name"></span>
</div>
<div class="form-group">
{{ Form::text('email',null,['class'=>'form-control','id'=>'email','placeholder'=>'Email *']) }}
<span class="white-star error-text" id="error_email"></span>
</div>
<div class="form-group">
{{ Form::textarea('message',null,['class'=>'form-control','id'=>'message','style'=>'height:70px;','placeholder'=>'Your comment *']) }}
<span class="white-star error-text" id="error_message"></span>
</div>
<div class="read-more-btn">
<button type="submit" id="send" class="btn action-btn">Send your comment</button>
</div>
{{ Form::hidden('slug',$post->slug) }}
{{ Form::close() }}
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end left content-->
<!-- start left content-->
<div class="col-xs16 col-sm-4 col-md-4">
<div class="cat-bg">
<div class="title">CATEGORIES</div>
<div class="category-list">
@foreach($categories as $key=>$cat)
<div class="category-link"><a href="@if ($cat->posts->count()) {{ $cat->url }} @else # @endif">{{ $cat->title }} ({{ $cat->posts->count() }})</a></div>
@if ($key<($categories->count()-1))
<div class="sep-line"></div>
@endif
@endforeach
</div>
</div>
</div>
<!-- end left content-->
</div>
@endsection
@section('custom_scripts')
<script>
$(document).ready(function () {
$("#sendComment").submit(function(e){
e.preventDefault();
var sendBtn = $("#send");
$.ajax({
type: "POST",
url: '{{ route('blog.addcomment') }}',
data: $(this).serialize(),
dataType: 'json',
beforeSend: function(){
$('.error-text').text('');
sendBtn.prop('disabled',true);
sendBtn.html('<i class="fa fa-spin fa-spiner"></i> SENDING...');
}
})
.fail(function(data) {
var errors = $.parseJSON(data.responseText);
$.each(errors,function( index, value ){
$("#error_"+index).text(value[0]);
});
sendBtn.prop('disabled',false);
sendBtn.html('Send your comment');
})
.done(function(data){
var response = data;
sendBtn.prop('disabled',false);
sendBtn.html('Send your comment');
$("#sendComment").html("<h3 class='text-justify title'>"+response.message+"</h3>");
});
});
});
</script>
@endsection