This commit is contained in:
tanch0
2024-06-23 17:02:56 +05:45
parent 25760ad989
commit f85671cd4c
93 changed files with 2886 additions and 1579 deletions

View File

@ -1,8 +1,7 @@
@extends('hulaki_khabar.layout.layout')
@section('meta')
<meta property="og:title" content="{{ $news->title }}" />
<meta property="og:description"
content="{{ $news->title}}" />
<meta property="og:description" content="{{ $news->title }}" />
<meta property="og:image" content="{{ asset($news->thumb) }}" />
@endsection
@push('css')
@ -128,9 +127,110 @@
</div>
</div>
</section>
<div class="comments-area">
<h3 class="comments-title"> कमेन्ट :</h3>
<ol class="comment-list">
@foreach ($newsWithComment as $comment)
@if ($comment->comments->isNotEmpty())
@foreach ($comment->comments as $item)
<li class="comment">
<div class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img src="https://templates.envytheme.com/depan/default/assets/img/client/client-1.jpg"
class="avatar" alt="image">
<b class="fn">{{ $item->user?->name }} </b>
</div>
</footer>
<div class="comment-content">
<p>{{ $item->content }}</p>
</div>
</div>
@if ($item->subcomments)
<ol class="children">
@foreach ($item->subcomments as $subcomment)
<li class="comment">
<div class="comment-body">
<footer class="comment-meta">
<div class="comment-author vcard">
<img src="https://templates.envytheme.com/depan/default/assets/img/client/client-2.jpg"
class="avatar" alt="image">
<b class="fn">{{ $subcomment->user?->name }}</b>
</div>
</footer>
<div class="comment-content">
<p>{{ $subcomment->content }}</p>
</div>
{{-- @if ($loop->last)
<div class="reply">
<form action="{{ route('comments.store') }}"
method="POST" id="comment">
@csrf
<input type="hidden" name='news_id'
value="{{ $news->news_id }}">
<input type="hidden" name='users_id'
value="{{ auth()->user()->id }}">
<input type="hidden" name='parent_id'
value="{{ $item->id }}">
<textarea name="content"></textarea>
<input type="submit" value="Reply">
</form>
</div>
@endif --}}
</div>
</li>
@endforeach
</ol>
@else
<div class="reply">
<form action="{{ route('comments.store') }}" method="POST" id="comment">
@csrf
<input type="hidden" name='news_id' value="{{ $news->news_id }}">
<input type="hidden" name='users_id' value="{{ auth()->user()->id }}">
<input type="hidden" name='parent_id' value="{{ $item->id }}">
<textarea name="content"></textarea>
<input type="submit" value="Reply">
</form>
</div>
@endif
<div class="reply">
<form action="{{ route('comments.store') }}"
method="POST" id="comment">
@csrf
<input type="hidden" name='news_id'
value="{{ $news->news_id }}">
<input type="hidden" name='users_id'
value="{{ auth()->user()->id }}">
<input type="hidden" name='parent_id'
value="{{ $item->id }}">
<textarea name="content"></textarea>
<input type="submit" value="Reply">
</form>
</div>
</li>
@endforeach
@else
<div class="reply">
<form action="{{ route('comments.store') }}" method="POST" id="comment">
@csrf
<input type="hidden" name='news_id' value="{{ $news->news_id }}">
<input type="hidden" name='users_id' value="{{ auth()->user()->id }}">
{{-- <input type="hidden" name='parent_id' value="{{ $item->id }}"> --}}
<textarea name="content"></textarea>
<input type="submit" value="Reply">
</form>
</div>
@endif
@endforeach
</ol>
</div>
</div>
</div>
<div class="col-lg-3" id="sidebar">
<aside class="widget-area mt-50">
<section class="widget widget_featured_reports">
@ -155,12 +255,6 @@
@endforeach
</section>
</div><br>
{{-- <section class="widget widget_featured_reports">
<img src="{{ asset('hulaki/assets/img/ad/prabhu_pay_onlinekhabar.gif') }}" alt="image"
class="img-fluid">
</section> --}}
</aside>
</div>
</div>
@ -168,3 +262,20 @@
</section>
<!-- Start News Details Area -->
@endsection
@push('js')
<script>
$(document).ready(function() {
$("#comment").submit(function(e) {
e.preventDefault();
$.ajax({
url: "{{ route('comments.store') }}",
type: "POST",
data: $(this).serialize(),
success: function(data) {
window.location.reload();
}
});
})
})
</script>
@endpush