| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- {{--
- Вьюха: Список веб-форм конструктора
- Создана: 2026-05-07
- Контроллер: Admin\WebFormController::index()
- Переменные: $forms (коллекция WebForm с leads_count)
- --}}
- @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.forms.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">
- <table class="table table-hover mb-0">
- <thead>
- <tr>
- <th style="width:40px">#</th>
- <th>Название</th>
- <th>Слаг (шорткод)</th>
- <th>Email для уведомлений</th>
- <th style="width:80px">Полей</th>
- <th style="width:80px">Заявок</th>
- <th style="width:80px">Статус</th>
- <th style="width:120px"></th>
- </tr>
- </thead>
- <tbody>
- @forelse($forms as $form)
- <tr>
- <td class="text-muted">{{ $form->id }}</td>
- <td>
- <strong>{{ $form->title }}</strong>
- </td>
- <td>
- <code>{{ $form->slug }}</code>
- </td>
- <td class="text-muted">{{ $form->notify_email ?: '—' }}</td>
- <td>{{ count($form->fields ?? []) }}</td>
- <td>
- <a href="{{ route('admin.leads.index', ['form_id' => $form->id]) }}" class="text-dark">
- {{ $form->leads_count }}
- </a>
- </td>
- <td>
- @if($form->is_active)
- <span class="badge badge-success">Активна</span>
- @else
- <span class="badge badge-secondary">Выкл</span>
- @endif
- </td>
- <td class="text-right">
- <a href="{{ route('admin.forms.edit', $form) }}" class="btn btn-xs btn-default" title="Редактировать">
- <i class="fas fa-edit"></i>
- </a>
- <form action="{{ route('admin.forms.destroy', $form) }}" method="POST" class="d-inline"
- onsubmit="return confirm('Удалить форму «{{ $form->title }}» и все её заявки?')">
- @csrf @method('DELETE')
- <button type="submit" class="btn btn-xs btn-danger" title="Удалить">
- <i class="fas fa-trash"></i>
- </button>
- </form>
- </td>
- </tr>
- @empty
- <tr>
- <td colspan="8" class="text-center text-muted py-4">Форм пока нет. <a href="{{ route('admin.forms.create') }}">Создать первую</a></td>
- </tr>
- @endforelse
- </tbody>
- </table>
- </div>
- </div>
- {{-- Подсказка по использованию --}}
- <div class="callout callout-info mt-3">
- <h5><i class="fas fa-code"></i> Как вставить форму на страницу</h5>
- <p class="mb-0">
- Используйте Blade-компонент в шаблоне:
- <code><x-web-form slug="<em>слаг-формы</em>" /></code>
- </p>
- </div>
- @stop
|