edit.blade.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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>Редактирование записи #{{ $submission->id }}</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. display: flex;
  14. justify-content: center;
  15. align-items: center;
  16. padding: 20px;
  17. }
  18. .container {
  19. background: white;
  20. padding: 40px;
  21. border-radius: 10px;
  22. box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  23. max-width: 500px;
  24. width: 100%;
  25. }
  26. h1 {
  27. color: #333;
  28. margin-bottom: 10px;
  29. text-align: center;
  30. }
  31. .subtitle {
  32. color: #666;
  33. text-align: center;
  34. margin-bottom: 30px;
  35. font-size: 14px;
  36. }
  37. .form-group {
  38. margin-bottom: 20px;
  39. }
  40. label {
  41. display: block;
  42. margin-bottom: 5px;
  43. color: #333;
  44. font-weight: bold;
  45. }
  46. input, textarea, select {
  47. width: 100%;
  48. padding: 12px;
  49. border: 2px solid #e1e1e1;
  50. border-radius: 5px;
  51. font-size: 14px;
  52. transition: border-color 0.3s;
  53. background-color: white;
  54. }
  55. input:focus, textarea:focus, select:focus {
  56. outline: none;
  57. border-color: #667eea;
  58. }
  59. textarea {
  60. resize: vertical;
  61. min-height: 100px;
  62. }
  63. .btn {
  64. width: 100%;
  65. padding: 12px;
  66. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  67. color: white;
  68. border: none;
  69. border-radius: 5px;
  70. font-size: 16px;
  71. font-weight: bold;
  72. cursor: pointer;
  73. transition: transform 0.2s;
  74. }
  75. .btn:hover {
  76. transform: translateY(-2px);
  77. }
  78. .alert {
  79. padding: 15px;
  80. border-radius: 5px;
  81. margin-bottom: 20px;
  82. }
  83. .alert-success {
  84. background: #d4edda;
  85. color: #155724;
  86. border: 1px solid #c3e6cb;
  87. }
  88. .alert-error {
  89. background: #f8d7da;
  90. color: #721c24;
  91. border: 1px solid #f5c6cb;
  92. }
  93. .error-text {
  94. color: #e74c3c;
  95. font-size: 12px;
  96. margin-top: 5px;
  97. }
  98. </style>
  99. </head>
  100. <body>
  101. <div class="container">
  102. <h1>Редактирование записи #{{ $submission->id }}</h1>
  103. @if ($errors->any())
  104. <div class="alert alert-error">
  105. <strong>Ошибка!</strong> Проверьте введенные данные.
  106. <ul style="margin-top: 10px; margin-left: 20px;">
  107. @foreach ($errors->all() as $error)
  108. <li>{{ $error }}</li>
  109. @endforeach
  110. </ul>
  111. </div>
  112. @endif
  113. <form action="{{ route('admin.update', $submission) }}" method="POST">
  114. @csrf
  115. @method('PUT')
  116. <div class="form-group">
  117. <label for="name">Имя</label>
  118. <input type="text" name="name" id="name" value="{{ old('name', $submission->name) }}" required>
  119. </div>
  120. <div class="form-group">
  121. <label for="email">Email</label>
  122. <input type="email" name="email" id="email" value="{{ old('email', $submission->email) }}" required>
  123. </div>
  124. <div class="form-group">
  125. <label for="category_id">Категория</label>
  126. <select name="category_id" id="category_id" required>
  127. @foreach($categories as $category)
  128. <option
  129. value="{{ $category->id }}"
  130. {{ old('category_id', $submission->category_id) == $category->id ? 'selected' : '' }}
  131. >
  132. {{ $category->name }}
  133. </option>
  134. @endforeach
  135. </select>
  136. </div>
  137. <div class="form-group">
  138. <label for="status_id">Статус</label>
  139. <select name="status_id" id="status_id" required>
  140. @foreach($statuses as $status)
  141. <option
  142. value="{{ $status->id }}"
  143. {{ old('status_id', $submission->status_id) == $status->id ? 'selected' : '' }}
  144. >
  145. {{ $status->name }}
  146. </option>
  147. @endforeach
  148. </select>
  149. </div>
  150. <div class="form-group">
  151. <label for="message">Сообщение</label>
  152. <textarea name="message" id="message" rows="5" required>{{ old('message', $submission->message) }}</textarea>
  153. </div>
  154. <div>
  155. <button type="submit" class="btn">Сохранить изменения</button>
  156. <a href="{{ route('admin.index') }}" class="btn" style="background: grey; margin-top: 10px;">Отмена</a>
  157. </div>
  158. </form>
  159. </div>
  160. </body>
  161. </html>