| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- @extends('layout.app')
- @section('title', 'Просмотр сохраненных данных')
- @section('content')
- <h1>Сохраненные данные ({{ $count }} записей)</h1>
- @if (session('success'))
- <div class="alert-success">
- {{ session('success') }}
- </div>
- @endif
- @if ($submissions->isEmpty())
- <p>На данный момент нет сохраненных данных.</p>
- @else
- <table>
- <thead>
- <tr>
- <th>ID</th>
- <th>Имя</th>
- <th>Email</th>
- <th>Сообщение</th>
- <th>Статус</th>
- <th>Комментарии</th>
- <th>Теги</th>
- <th>Дата создания</th>
- <th>IP-адрес</th>
- <th>Действия</th>
- </tr>
- </thead>
- <tbody>
- @foreach ($submissions as $submission)
- <tr>
- <td>{{ $submission->id }}</td>
- <td>{{ $submission->name }}</td>
- <td>{{ $submission->email }}</td>
- <td>{{ Str::limit($submission->message ?? '-', 50) }}</td>
- <td>
- <span style="padding: 2px 8px; border-radius: 3px; background-color:
- @if($submission->status === 'active') #d4edda
- @elseif($submission->status === 'archived') #f8d7da
- @else #fff3cd @endif">
- {{ ucfirst($submission->status) }}
- </span>
- </td>
- <td>{{ $submission->comments_count }}</td>
- <td>
- @foreach($submission->tags as $tag)
- <span style="display: inline-block; padding: 2px 6px; margin: 2px; background-color: #e3f2fd; border-radius: 3px; font-size: 0.85em;">
- {{ $tag->name }}
- </span>
- @endforeach
- </td>
- <td>{{ $submission->created_at->format('d.m.Y H:i') }}</td>
- <td>{{ $submission->ip_address ?? 'Неизвестно' }}</td>
- <td>
- <a href="{{ route('submissions.show', $submission->id) }}" style="color: #3490dc; text-decoration: none; margin-right: 10px;">Просмотр</a>
- <a href="{{ route('submissions.edit', $submission->id) }}" style="color: #38c172; text-decoration: none; margin-right: 10px;">Редактировать</a>
- <form method="POST" action="{{ route('submissions.destroy', $submission->id) }}" style="display: inline;">
- @csrf
- @method('DELETE')
- <button type="submit" style="color: #e3342f; background: none; border: none; cursor: pointer; text-decoration: underline;"
- onclick="return confirm('Вы уверены, что хотите удалить эту заявку?')">
- Удалить
- </button>
- </form>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- @endif
- @endsection
|