show.blade.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <!DOCTYPE html>
  2. <html lang="ru">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Просмотр записи #{{ $submission->id }}</title>
  6. <style>
  7. * { margin: 0; padding: 0; box-sizing: border-box; }
  8. body {
  9. font-family: Arial, sans-serif;
  10. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  11. min-height: 100vh;
  12. padding: 40px 20px;
  13. }
  14. .container {
  15. background: white;
  16. padding: 40px;
  17. border-radius: 10px;
  18. box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  19. max-width: 1200px;
  20. margin: 0 auto;
  21. }
  22. h1 {
  23. color: #333;
  24. margin-bottom: 10px;
  25. text-align: center;
  26. }
  27. .subtitle {
  28. color: #666;
  29. text-align: center;
  30. margin-bottom: 30px;
  31. font-size: 14px;
  32. }
  33. .header-actions {
  34. display: flex;
  35. justify-content: space-between;
  36. align-items: center;
  37. margin-bottom: 20px;
  38. flex-wrap: wrap;
  39. gap: 10px;
  40. }
  41. .btn {
  42. padding: 10px 20px;
  43. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  44. color: white;
  45. border: none;
  46. border-radius: 5px;
  47. font-size: 14px;
  48. font-weight: bold;
  49. cursor: pointer;
  50. text-decoration: none;
  51. display: inline-block;
  52. transition: transform 0.2s;
  53. }
  54. .btn:hover {
  55. transform: translateY(-2px);
  56. }
  57. .btn-secondary {
  58. background: linear-gradient(135deg, #a8a8a8 0%, #7f7f7f 100%);
  59. }
  60. .count-badge {
  61. background: #667eea;
  62. color: white;
  63. padding: 5px 15px;
  64. border-radius: 20px;
  65. font-size: 14px;
  66. font-weight: bold;
  67. }
  68. .table-wrapper {
  69. overflow-x: auto;
  70. margin-top: 20px;
  71. }
  72. table {
  73. width: 100%;
  74. border-collapse: collapse;
  75. background: white;
  76. }
  77. thead {
  78. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  79. }
  80. thead th {
  81. color: white;
  82. padding: 15px;
  83. text-align: left;
  84. font-weight: bold;
  85. font-size: 14px;
  86. }
  87. tbody tr {
  88. border-bottom: 1px solid #e1e1e1;
  89. transition: background-color 0.2s;
  90. }
  91. tbody tr:hover {
  92. background-color: #f8f9fa;
  93. }
  94. tbody tr:last-child {
  95. border-bottom: none;
  96. }
  97. td {
  98. padding: 15px;
  99. color: #333;
  100. font-size: 14px;
  101. }
  102. .message-cell {
  103. max-width: 300px;
  104. word-wrap: break-word;
  105. white-space: pre-wrap;
  106. }
  107. .date-cell {
  108. white-space: nowrap;
  109. color: #666;
  110. font-size: 13px;
  111. }
  112. .email-cell {
  113. color: #667eea;
  114. font-weight: 500;
  115. }
  116. .empty-state {
  117. text-align: center;
  118. padding: 60px 20px;
  119. color: #999;
  120. }
  121. .empty-state-icon {
  122. font-size: 64px;
  123. margin-bottom: 20px;
  124. }
  125. .alert {
  126. padding: 15px;
  127. border-radius: 5px;
  128. margin-bottom: 20px;
  129. }
  130. .alert-success {
  131. background: #d4edda;
  132. color: #155724;
  133. border: 1px solid #c3e6cb;
  134. }
  135. /* Стили для кнопок действий */
  136. .action-btn {
  137. padding: 5px 10px;
  138. font-size: 16px;
  139. border: none;
  140. border-radius: 5px;
  141. cursor: pointer;
  142. text-decoration: none;
  143. display: inline-block;
  144. margin: 0 2px;
  145. transition: all 0.2s;
  146. }
  147. .action-btn:hover {
  148. transform: scale(1.1);
  149. box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  150. }
  151. .btn-view {
  152. background: #3498db;
  153. color: white;
  154. }
  155. .btn-view:hover {
  156. background: #2980b9;
  157. }
  158. .btn-edit {
  159. background: #f1c40f;
  160. color: white;
  161. }
  162. .btn-edit:hover {
  163. background: #f39c12;
  164. }
  165. .btn-delete {
  166. background: #e74c3c;
  167. color: white;
  168. }
  169. .btn-delete:hover {
  170. background: #c0392b;
  171. }
  172. @media (max-width: 768px) {
  173. .container {
  174. padding: 20px;
  175. }
  176. table {
  177. font-size: 12px;
  178. }
  179. thead th, td {
  180. padding: 10px 8px;
  181. }
  182. .message-cell {
  183. max-width: 150px;
  184. }
  185. .action-btn {
  186. font-size: 14px;
  187. padding: 4px 8px;
  188. margin: 1px;
  189. }
  190. }
  191. .status-badge {
  192. padding: 4px 8px;
  193. border-radius: 12px;
  194. color: white;
  195. font-size: 12px;
  196. font-weight: bold;
  197. white-space: nowrap;
  198. }
  199. .status-primary { background-color: #007bff; }
  200. .status-warning { background-color: #ffc107; color: #212529; }
  201. .status-success { background-color: #28a745; }
  202. .status-danger { background-color: #dc3545; }
  203. .status-secondary { background-color: #6c757d; }
  204. </style>
  205. </head>
  206. <body>
  207. <div class="container">
  208. <h1>Просмотр записи #{{ $submission->id }}</h1>
  209. <div style="background: #f8f9fa; padding: 20px; border-radius: 8px;">
  210. <p><strong>Имя:</strong> {{ $submission->name }}</p>
  211. <hr style="margin: 15px 0;">
  212. <p><strong>Email:</strong> <span class="email-cell">{{ $submission->email }}</span></p>
  213. <hr style="margin: 15px 0;">
  214. {{-- НОВЫЕ ПОЛЯ --}}
  215. <p><strong>Категория:</strong> {{ $submission->category->name ?? 'N/A' }}</p>
  216. <hr style="margin: 15px 0;">
  217. <p><strong>Статус:</strong>
  218. <span class="status-badge status-{{ $submission->status->color_class ?? 'secondary' }}">
  219. {{ $submission->status->name ?? 'Неизвестен' }}
  220. </span>
  221. </p>
  222. <hr style="margin: 15px 0;">
  223. <p><strong>Сообщение:</strong></p>
  224. <pre class="message-cell" style="background: #fff; padding: 10px; border: 1px solid #ddd; border-radius: 4px;">{{ $submission->message }}</pre>
  225. <hr style="margin: 15px 0;">
  226. <p><strong>Дата отправки:</strong> <span class="date-cell">{{ $submission->created_at->format('d.m.Y в H:i:s') }}</span></p>
  227. </div>
  228. <div class="notes-section" style="margin-top: 30px;">
  229. <h2>Заметки к записи</h2>
  230. <div class="notes-list" style="margin-top: 15px;">
  231. @forelse($submission->notes as $note)
  232. <div style="background: #fff3cd; padding: 15px; border-radius: 5px; margin-bottom: 10px; border-left: 4px solid #ffeeba;">
  233. <p>{{ $note->body }}</p>
  234. <small style="color: #666; display: block; text-align: right; margin-top: 5px;">
  235. Добавлено: {{ $note->created_at->diffForHumans() }}
  236. </small>
  237. </div>
  238. @empty
  239. <p style="color: #888;">Заметок пока нет.</p>
  240. @endforelse
  241. </div>
  242. <form action="{{ route('admin.notes.add', $submission) }}" method="POST" style="margin-top: 20px;">
  243. @csrf
  244. <label for="note_body">Добавить заметку:</label>
  245. <textarea name="body" id="note_body" rows="3" required style="width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #ccc;"></textarea>
  246. <button type="submit" class="btn" style="margin-top: 10px; width: auto;">Сохранить заметку</button>
  247. </form>
  248. </div>
  249. <div style="margin-top: 30px;">
  250. <a href="{{ route('admin.index') }}" class="btn btn-secondary">← Назад к списку</a>
  251. <a href="{{ route('admin.edit', $submission) }}" class="btn" style="background: #f1c40f; margin-left: 10px;">Редактировать</a>
  252. </div>
  253. </div>
  254. </body>
  255. </html>