submission_detail.blade.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @extends('layout.app')
  2. @section('title', 'Детали заявки #' . $submission->id)
  3. @section('content')
  4. <div style="margin-bottom: 20px;">
  5. <a href="{{ route('data.show') }}" style="color: #3490dc; text-decoration: none;">← Назад к списку</a>
  6. </div>
  7. <h1>Заявка #{{ $submission->id }}</h1>
  8. <div style="background-color: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 20px;">
  9. <h2 style="margin-top: 0;">Основная информация</h2>
  10. <p><strong>Имя:</strong> {{ $submission->name }}</p>
  11. <p><strong>Email:</strong> {{ $submission->email }}</p>
  12. <p><strong>Сообщение:</strong> {{ $submission->message ?? 'Отсутствует' }}</p>
  13. <p><strong>Статус:</strong> {{ ucfirst($submission->status) }}</p>
  14. <p><strong>IP-адрес:</strong> {{ $submission->ip_address }}</p>
  15. <p><strong>Дата создания:</strong> {{ $submission->created_at->format('d.m.Y H:i:s') }}</p>
  16. <p><strong>Последнее обновление:</strong> {{ $submission->updated_at->format('d.m.Y H:i:s') }}</p>
  17. </div>
  18. @if($submission->tags->isNotEmpty())
  19. <div style="margin-bottom: 20px;">
  20. <h2>Теги</h2>
  21. @foreach($submission->tags as $tag)
  22. <span style="display: inline-block; padding: 5px 12px; margin: 5px; background-color: #e3f2fd; border-radius: 5px;">
  23. {{ $tag->name }}
  24. </span>
  25. @endforeach
  26. </div>
  27. @endif
  28. @if($submission->attachments->isNotEmpty())
  29. <div style="margin-bottom: 20px;">
  30. <h2>Вложения ({{ $submission->attachments->count() }})</h2>
  31. <ul>
  32. @foreach($submission->attachments as $attachment)
  33. <li>
  34. <strong>{{ $attachment->filename }}</strong>
  35. ({{ round($attachment->size / 1024, 2) }} KB, {{ $attachment->mime_type }})
  36. </li>
  37. @endforeach
  38. </ul>
  39. </div>
  40. @endif
  41. <div>
  42. <h2>Комментарии ({{ $submission->comments->count() }})</h2>
  43. @if($submission->comments->isEmpty())
  44. <p>Комментариев пока нет.</p>
  45. @else
  46. @foreach($submission->comments as $comment)
  47. <div style="background-color: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 15px;">
  48. <p><strong>{{ $comment->author }}</strong> <small style="color: #6c757d;">{{ $comment->created_at->format('d.m.Y H:i') }}</small></p>
  49. <p>{{ $comment->content }}</p>
  50. @if($comment->attachments->isNotEmpty())
  51. <div style="margin-top: 10px;">
  52. <strong>Вложения:</strong>
  53. <ul style="margin-top: 5px;">
  54. @foreach($comment->attachments as $attachment)
  55. <li>{{ $attachment->filename }}</li>
  56. @endforeach
  57. </ul>
  58. </div>
  59. @endif
  60. </div>
  61. @endforeach
  62. @endif
  63. </div>
  64. <div style="margin-top: 30px;">
  65. <a href="{{ route('submissions.edit', $submission->id) }}" style="padding: 10px 15px; background-color: #38c172; color: white; text-decoration: none; border-radius: 4px; margin-right: 10px;">
  66. Редактировать
  67. </a>
  68. <form method="POST" action="{{ route('submissions.destroy', $submission->id) }}" style="display: inline;">
  69. @csrf
  70. @method('DELETE')
  71. <button type="submit" style="padding: 10px 15px; background-color: #e3342f; color: white; border: none; border-radius: 4px; cursor: pointer;"
  72. onclick="return confirm('Вы уверены, что хотите удалить эту заявку?')">
  73. Удалить
  74. </button>
  75. </form>
  76. </div>
  77. @endsection