| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- {{--
- Вьюха: список отзывов клиентов
- Создана: 2026-05-07
- Контроллер: Admin\ReviewAdminController::index()
- Переменные: $reviews (коллекция Review)
- --}}
- @extends('admin.layout')
- @section('title', 'Отзывы клиентов')
- @section('content_header')
- <div class="d-flex justify-content-between align-items-center">
- <h1 class="m-0">Отзывы клиентов</h1>
- <a href="{{ route('admin.reviews.create') }}" class="btn btn-primary btn-sm">
- <i class="fas fa-plus"></i> Добавить отзыв
- </a>
- </div>
- @stop
- @section('breadcrumb')
- <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">Главная</a></li>
- <li class="breadcrumb-item active">Отзывы</li>
- @stop
- @section('content')
- @if(session('success'))
- <div class="alert alert-success alert-dismissible">
- <button type="button" class="close" data-dismiss="alert">×</button>
- {{ session('success') }}
- </div>
- @endif
- <div class="card card-primary card-outline">
- <div class="card-body p-0">
- @if($reviews->isEmpty())
- <div class="p-4 text-muted">Отзывов пока нет. <a href="{{ route('admin.reviews.create') }}">Добавить первый</a></div>
- @else
- <table class="table table-hover table-sm mb-0">
- <thead class="thead-light">
- <tr>
- <th style="width:50px">#</th>
- <th>Автор</th>
- <th>Автомобиль</th>
- <th style="width:100px">Рейтинг</th>
- <th style="width:100px">Дата</th>
- <th style="width:80px">Статус</th>
- <th style="width:110px" class="text-right">Действия</th>
- </tr>
- </thead>
- <tbody>
- @foreach($reviews as $review)
- <tr class="{{ $review->is_active ? '' : 'text-muted' }}">
- <td>{{ $review->id }}</td>
- <td>
- <strong>{{ $review->author }}</strong>
- <div class="text-muted small">{{ Str::limit($review->body, 60) }}</div>
- </td>
- <td>{{ $review->car_name ?: '—' }}</td>
- <td>
- @for ($i = 1; $i <= 5; $i++)
- <span style="color:{{ $i <= $review->rating ? '#f39c12' : '#dee2e6' }}">★</span>
- @endfor
- </td>
- <td>{{ $review->review_date?->format('d.m.Y') ?: '—' }}</td>
- <td>
- <form action="{{ route('admin.reviews.toggle', $review) }}" method="POST" class="d-inline">
- @csrf
- <button type="submit"
- class="badge badge-{{ $review->is_active ? 'success' : 'secondary' }} border-0"
- style="cursor:pointer;font-size:11px;padding:4px 8px"
- title="{{ $review->is_active ? 'Кликните, чтобы скрыть' : 'Кликните, чтобы показать' }}">
- {{ $review->is_active ? 'Активен' : 'Скрыт' }}
- </button>
- </form>
- </td>
- <td class="text-right">
- <a href="{{ route('admin.reviews.edit', $review) }}"
- class="btn btn-xs btn-info" title="Редактировать">
- <i class="fas fa-edit"></i>
- </a>
- <form action="{{ route('admin.reviews.destroy', $review) }}" method="POST"
- class="d-inline"
- onsubmit="return confirm('Удалить отзыв «{{ addslashes($review->author) }}»?')">
- @csrf @method('DELETE')
- <button class="btn btn-xs btn-danger ml-1" title="Удалить">
- <i class="fas fa-trash"></i>
- </button>
- </form>
- </td>
- </tr>
- @endforeach
- </tbody>
- </table>
- @endif
- </div>
- </div>
- @stop
|