| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <!DOCTYPE html>
- <html lang="ru">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Редактирование записи #{{ $submission->id }}</title>
- <style>
- * { margin: 0; padding: 0; box-sizing: border-box; }
- body {
- font-family: Arial, sans-serif;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- min-height: 100vh;
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 20px;
- }
- .container {
- background: white;
- padding: 40px;
- border-radius: 10px;
- box-shadow: 0 10px 40px rgba(0,0,0,0.2);
- max-width: 500px;
- width: 100%;
- }
- h1 {
- color: #333;
- margin-bottom: 10px;
- text-align: center;
- }
- .subtitle {
- color: #666;
- text-align: center;
- margin-bottom: 30px;
- font-size: 14px;
- }
- .form-group {
- margin-bottom: 20px;
- }
- label {
- display: block;
- margin-bottom: 5px;
- color: #333;
- font-weight: bold;
- }
- input, textarea, select {
- width: 100%;
- padding: 12px;
- border: 2px solid #e1e1e1;
- border-radius: 5px;
- font-size: 14px;
- transition: border-color 0.3s;
- background-color: white;
- }
- input:focus, textarea:focus, select:focus {
- outline: none;
- border-color: #667eea;
- }
- textarea {
- resize: vertical;
- min-height: 100px;
- }
- .btn {
- width: 100%;
- padding: 12px;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- color: white;
- border: none;
- border-radius: 5px;
- font-size: 16px;
- font-weight: bold;
- cursor: pointer;
- transition: transform 0.2s;
- }
- .btn:hover {
- transform: translateY(-2px);
- }
- .alert {
- padding: 15px;
- border-radius: 5px;
- margin-bottom: 20px;
- }
- .alert-success {
- background: #d4edda;
- color: #155724;
- border: 1px solid #c3e6cb;
- }
- .alert-error {
- background: #f8d7da;
- color: #721c24;
- border: 1px solid #f5c6cb;
- }
- .error-text {
- color: #e74c3c;
- font-size: 12px;
- margin-top: 5px;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <h1>Редактирование записи #{{ $submission->id }}</h1>
- @if ($errors->any())
- <div class="alert alert-error">
- <strong>Ошибка!</strong> Проверьте введенные данные.
- <ul style="margin-top: 10px; margin-left: 20px;">
- @foreach ($errors->all() as $error)
- <li>{{ $error }}</li>
- @endforeach
- </ul>
- </div>
- @endif
- <form action="{{ route('admin.update', $submission) }}" method="POST">
- @csrf
- @method('PUT')
- <div class="form-group">
- <label for="name">Имя</label>
- <input type="text" name="name" id="name" value="{{ old('name', $submission->name) }}" required>
- </div>
- <div class="form-group">
- <label for="email">Email</label>
- <input type="email" name="email" id="email" value="{{ old('email', $submission->email) }}" required>
- </div>
- <div class="form-group">
- <label for="category_id">Категория</label>
- <select name="category_id" id="category_id" required>
- @foreach($categories as $category)
- <option
- value="{{ $category->id }}"
- {{ old('category_id', $submission->category_id) == $category->id ? 'selected' : '' }}
- >
- {{ $category->name }}
- </option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- <label for="status_id">Статус</label>
- <select name="status_id" id="status_id" required>
- @foreach($statuses as $status)
- <option
- value="{{ $status->id }}"
- {{ old('status_id', $submission->status_id) == $status->id ? 'selected' : '' }}
- >
- {{ $status->name }}
- </option>
- @endforeach
- </select>
- </div>
-
- <div class="form-group">
- <label for="message">Сообщение</label>
- <textarea name="message" id="message" rows="5" required>{{ old('message', $submission->message) }}</textarea>
- </div>
- <div>
- <button type="submit" class="btn">Сохранить изменения</button>
- <a href="{{ route('admin.index') }}" class="btn" style="background: grey; margin-top: 10px;">Отмена</a>
- </div>
- </form>
- </div>
- </body>
- </html>
|