index.blade.php 8.8 KB

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