source: resources/views/blog/post.blade.php@ f457265

Last change on this file since f457265 was 0924b6c, checked in by Özkan İliyaz <iliyaz_96@…>, 4 years ago

initial commit

  • Property mode set to 100644
File size: 5.1 KB
Line 
1@extends('layouts.blog')
2@section('title')
3 {{ $post->title . " | Technoblog"}}
4@endsection
5
6@section('blog_content')
7
8 <div class="container-fluid m-0 p-0 mb-5">
9
10 <div class="w-100">
11
12 <div class="post-image w-100" style="position: relative;">
13 <img src="/uploads/{{ $post->image_link }}">
14 <div class="post-info">
15 <p class="post-title">{{ $post->title }}</p>
16
17 @if (!empty($post->user->userProfile->profile_photo_link))
18 <a href="/profile/{{ $post->user->userProfile->profile_link }}"><img class="author-avatar" src="/uploads/users/{{ $post->user->userProfile->profile_photo_link }}"></a>
19 @else
20 <a href="/profile/{{ $post->user->userProfile->profile_link }}"><span class="name-avatar">{{ strtoupper($post->user->name[0]) . strtoupper($post->user->surname[0]) }}</span></a>
21 @endif
22
23 <span class="author-name">Posted By <br> {{ $post->user->getFullName() }} </span>
24 <span class="text-white font-weight-bold pl-5" style="text-shadow: 0 0 1px black;">{{ $post->ago() }} </span>
25 <span class="pl-4 font-weight-bold text-white post-reaction" style="font-size: 16px; text-shadow: 0 0 1px black;">
26 <span class="likeCounter">{{ $likeCounter }}</span>&nbsp;
27 @if ($post->isLiked($ip))
28 <i data-unlike-id="{{ $likedId }}" class="text-danger fa fa-heart unlikePost" aria-hidden="true"></i>
29 @else
30 <i data-post-id="{{ $post->id }}"class="text-danger fa fa-heart-o likePost" aria-hidden="true"></i>
31 @endif
32 </span>
33 <span class="pl-4 font-weight-bold text-white" style="font-size: 16px; text-shadow: 0 0 1px black;">{{ count($comments) }} &nbsp; <i class="text-white fa fa-comment" aria-hidden="true"></i></span>
34 </div>
35 </div>
36
37 <div class="post-content">
38 {!! $post->content !!}
39 </div>
40
41 <div class="post-tags">
42 @foreach ($post->tag as $tag)
43 <span><a href="/tag/{{ $tag->name }}">{{ $tag->name }}</a></span>
44 @endforeach
45 <div class="post-reaction pt-2 float-right">
46 @if ($post->isLiked($ip))
47 <i data-unlike-id="{{ $likedId }}" class="text-danger fa fa-heart unlikePost" aria-hidden="true"></i>
48 @else
49 <i data-post-id="{{ $post->id }}"class="text-danger fa fa-heart-o likePost" aria-hidden="true"></i>
50 @endif
51 </div>
52 </div>
53
54 <div class="post-comments pt-5">
55
56 <h5 class="pb-4">Comments</h5>
57
58 @if($comments->count() == 0)
59 No comments yet.
60 @endif
61
62 @foreach ($comments as $comment)
63 <div class="comment-box" @if(auth()->check() && !$comment->is_active) style="border-left: 2px #f01a37 solid !important;" @endif>
64 <div class="row m-0">
65
66 <div class="col-md-1 pl-2 pr-2">
67 <span class="name-avatar">{{ strtoupper($comment->name[0])}}</span>
68 </div>
69 <div class="col-md-10">
70 <p class="comment-owner">{{ $comment->name }} - {{ $comment->ago() }}
71 @if (auth()->check() && !$comment->is_active && (auth()->user()->hasPermission("approve_all_comments") || $comment->post->user->id == auth()->id()))
72 <a href="javascript:void(0)" onclick="document.getElementById('confirmComment_{{ $comment->id}}').submit()" class="ml-2" style="font-size: 14px; cursor: pointer;">Confirm</a>
73 <form id="confirmComment_{{ $comment->id}}" action="{{ route("dashboard.comments.confirm", ["id" => $comment->id]) }}" method="post">
74 @method("patch")
75 @csrf
76 </form>
77 @endif
78 </p>
79 <p>{{ $comment->comment }}</p>
80 </div>
81 </div>
82 </div>
83 @endforeach
84 </div>
85
86 <div class="post-add-comment pt-5">
87
88 <h5 class="pb-2">What are your thoughts?</h5>
89
90 @if ($errors->any())
91 <div class="alert alert-danger">
92 <ul class="m-0 pl-2">
93 @foreach ($errors->all() as $error)
94 <li>{{ $error }}</li>
95 @endforeach
96 </ul>
97 </div>
98 @endif
99
100 <div class="comment-alert alert alert-dismissible fade show" role="alert">
101 <strong></strong>
102 <button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
103 </div>
104
105 <form class="commentForm" accept-charset="utf-8">
106
107 @csrf
108
109 <div class="form-group">
110 <label class="form-label">Name</label>
111 <input type="text" name="name" value="{{ old('name') }}" class="form-control" placeholder="Name" required>
112 </div>
113
114 <div class="form-group">
115 <label class="form-label">E-mail</label>
116 <input type="email" name="email" value="{{ old('email') }}" class="form-control" placeholder="E-mail" required>
117 </div>
118
119 <div class="form-group">
120 <label class="form-label">Comment</label>
121 <textarea class="form-control" rows="4" name="comment" required></textarea>
122 </div>
123
124 <input type="hidden" name="post_id" value="{{ $post->id }}">
125
126 <div class="form-group">
127 <input type="submit" value="Comment" class="submitBtn btn btn-primary">
128 </div>
129
130 </form>
131
132 </div>
133
134 </div>
135
136 </div>
137
138@endsection
Note: See TracBrowser for help on using the repository browser.