123456789101112131415161718192021222324252627282930313233343536373839404142 |
- @extends('layout')
- @section('title') single-post @endsection
- @section('content')
- <div class="post" style="margin-left: 7%;">
- <div class="menu"><form method="get" action="/public/users/posts" style="width: 90%"><button name="id" value="{{$post->user[0]->id}}">{{$post->user[0]->name}}</button></form></div>
- <div style="margin: 10px;">{{$post->text}}</div>
- <div style="text-align: right;"> {{Str::limit($post->created_at, $limit=11, $end="")}} </div>
- @if ($moderates->count() != 0) <div style="text-align: right;">отредактированно</div> @endif
- </div>
- <div class="comments">
- <form method="post" action="/public/posts/post/comment">
- <input type="text" style="opacity: 0; width: 0" name="id" value="{{$post->id}}">
- @csrf
- <div>
- <div style="text-align: right">
- <label>Автор:</label>
- <select name="user" style="width: 100%;" value="{{old('user')}}">
- @foreach ($users as $user)
- @if (old('user') == $user->id) <option value="{{$user->id}}" selected>{{$user->name}}</option>
- @else <option value="{{$user->id}}">{{$user->name}}</option>
- @endif
- @endforeach
- </select>
- @error('user') <div style="color: #a9203e">{{$message}}</div> @enderror
- </div>
- <button type="submit" name="button" value="new">Опубликовать</button>
- </div>
- <textarea cols="40" rows="3" name="text" placeholder="Введите текст комментария...">{{old('text')}}</textarea>
- @error('text') <div style="color: #a9203e">{{$message}}</div> @enderror
- </form>
- @if ($comments->count() == 0) <div class="message">Будьте первым кто напишет комментарий</div>
- @else @each("comments.comment", $comments, "comment")
- @endif
- </div>
- @yield('action-button')
- @endsection
|