single_user.blade.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. @extends('layout')
  2. @section('title') single-user @endsection
  3. @section('content')
  4. <div class="user">
  5. {{$user->name}}
  6. <div style="text-align: right">
  7. @if ($user->role == "admin") {{$user->role}} @endif
  8. </div>
  9. </div>
  10. <form method="post" action="/public/posts/insert" class="new_post" style="margin-top: 20px;">
  11. <input type="text" style="opacity: 0; width: 0" name="user" value="{{$user->id}}">
  12. @csrf
  13. <div>
  14. <div style="text-align: right">
  15. <label>Дата публикации:</label>
  16. <input name="date_publication" type="date" style="width: 100%" value="{{old('date_publication')}}"/>
  17. @error('date_publication') <div style="color: #a9203e">{{$message}}</div> @enderror
  18. </div>
  19. <button type="submit" name="button" value="new">Опубликовать</button>
  20. </div>
  21. <textarea cols="40" rows="3" name="text" placeholder="Введите текст поста...">{{old('text')}}</textarea>
  22. @error('text') <div style="color: #a9203e">{{$message}}</div> @enderror
  23. </form>
  24. <div style="display: flex; flex-direction: column; gap: 20px; margin-top: 20px; margin-left: 9%;">
  25. @if ($posts->count() == 0) <b style="font-size: 20pt; text-decoration: underline; color: #7d324c;">Создайте свой первый пост</b>
  26. @else @each("posts.post", $posts, "post")
  27. @endif
  28. </div>
  29. @yield('action-button')
  30. @endsection