submission_edit.blade.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. @extends('layout.app')
  2. @section('title', 'Редактирование заявки #' . $submission->id)
  3. @section('content')
  4. <div style="margin-bottom: 20px;">
  5. <a href="{{ route('submissions.show', $submission->id) }}" style="color: #3490dc; text-decoration: none;">← Назад к заявке</a>
  6. </div>
  7. <h1>Редактирование заявки #{{ $submission->id }}</h1>
  8. @if ($errors->any())
  9. <div class="error-list">
  10. <strong>Обнаружены ошибки:</strong>
  11. <ul>
  12. @foreach ($errors->all() as $error)
  13. <li>{{ $error }}</li>
  14. @endforeach
  15. </ul>
  16. </div>
  17. @endif
  18. <form method="POST" action="{{ route('submissions.update', $submission->id) }}">
  19. @csrf
  20. @method('PUT')
  21. <div style="margin-bottom: 15px;">
  22. <label for="name" style="display: block; margin-bottom: 5px;">Имя:</label>
  23. <input type="text" id="name" name="name" value="{{ old('name', $submission->name) }}" required
  24. style="width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid {{ $errors->has('name') ? 'red' : '#ccc' }};">
  25. @error('name')
  26. <small style="color: red;">{{ $message }}</small>
  27. @enderror
  28. </div>
  29. <div style="margin-bottom: 15px;">
  30. <label for="email" style="display: block; margin-bottom: 5px;">Email:</label>
  31. <input type="email" id="email" name="email" value="{{ old('email', $submission->email) }}" required
  32. style="width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid {{ $errors->has('email') ? 'red' : '#ccc' }};">
  33. @error('email')
  34. <small style="color: red;">{{ $message }}</small>
  35. @enderror
  36. </div>
  37. <div style="margin-bottom: 15px;">
  38. <label for="message" style="display: block; margin-bottom: 5px;">Сообщение:</label>
  39. <textarea id="message" name="message" rows="5"
  40. style="width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid {{ $errors->has('message') ? 'red' : '#ccc' }};">{{ old('message', $submission->message) }}</textarea>
  41. @error('message')
  42. <small style="color: red;">{{ $message }}</small>
  43. @enderror
  44. </div>
  45. <div style="margin-bottom: 15px;">
  46. <label for="status" style="display: block; margin-bottom: 5px;">Статус:</label>
  47. <select id="status" name="status" required
  48. style="width: 100%; padding: 8px; box-sizing: border-box; border: 1px solid #ccc;">
  49. <option value="active" {{ old('status', $submission->status) === 'active' ? 'selected' : '' }}>Активно</option>
  50. <option value="archived" {{ old('status', $submission->status) === 'archived' ? 'selected' : '' }}>Архивировано</option>
  51. <option value="pending" {{ old('status', $submission->status) === 'pending' ? 'selected' : '' }}>В ожидании</option>
  52. </select>
  53. @error('status')
  54. <small style="color: red;">{{ $message }}</small>
  55. @enderror
  56. </div>
  57. <button type="submit" style="padding: 10px 15px; background-color: #3490dc; color: white; border: none; border-radius: 4px; cursor: pointer;">
  58. Сохранить изменения
  59. </button>
  60. <a href="{{ route('submissions.show', $submission->id) }}" style="padding: 10px 15px; background-color: #6c757d; color: white; text-decoration: none; border-radius: 4px; margin-left: 10px; display: inline-block;">
  61. Отмена
  62. </a>
  63. </form>
  64. @endsection