index.blade.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. {{--
  2. Вьюха: Список веб-форм конструктора
  3. Создана: 2026-05-07
  4. Контроллер: Admin\WebFormController::index()
  5. Переменные: $forms (коллекция WebForm с leads_count)
  6. --}}
  7. @extends('admin.layout')
  8. @section('title', 'Веб-формы')
  9. @section('content_header')
  10. <div class="d-flex justify-content-between align-items-center">
  11. <h1 class="m-0">Веб-формы</h1>
  12. <a href="{{ route('admin.forms.create') }}" class="btn btn-primary btn-sm">
  13. <i class="fas fa-plus"></i> Создать форму
  14. </a>
  15. </div>
  16. @stop
  17. @section('breadcrumb')
  18. <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">Главная</a></li>
  19. <li class="breadcrumb-item active">Веб-формы</li>
  20. @stop
  21. @section('content')
  22. @if(session('success'))
  23. <div class="alert alert-success alert-dismissible">
  24. <button type="button" class="close" data-dismiss="alert">&times;</button>
  25. {{ session('success') }}
  26. </div>
  27. @endif
  28. <div class="card card-primary card-outline">
  29. <div class="card-body p-0">
  30. <table class="table table-hover mb-0">
  31. <thead>
  32. <tr>
  33. <th style="width:40px">#</th>
  34. <th>Название</th>
  35. <th>Слаг (шорткод)</th>
  36. <th>Email для уведомлений</th>
  37. <th style="width:80px">Полей</th>
  38. <th style="width:80px">Заявок</th>
  39. <th style="width:80px">Статус</th>
  40. <th style="width:120px"></th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. @forelse($forms as $form)
  45. <tr>
  46. <td class="text-muted">{{ $form->id }}</td>
  47. <td>
  48. <strong>{{ $form->title }}</strong>
  49. </td>
  50. <td>
  51. <code>{{ $form->slug }}</code>
  52. </td>
  53. <td class="text-muted">{{ $form->notify_email ?: '—' }}</td>
  54. <td>{{ count($form->fields ?? []) }}</td>
  55. <td>
  56. <a href="{{ route('admin.leads.index', ['form_id' => $form->id]) }}" class="text-dark">
  57. {{ $form->leads_count }}
  58. </a>
  59. </td>
  60. <td>
  61. @if($form->is_active)
  62. <span class="badge badge-success">Активна</span>
  63. @else
  64. <span class="badge badge-secondary">Выкл</span>
  65. @endif
  66. </td>
  67. <td class="text-right">
  68. <a href="{{ route('admin.forms.edit', $form) }}" class="btn btn-xs btn-default" title="Редактировать">
  69. <i class="fas fa-edit"></i>
  70. </a>
  71. <form action="{{ route('admin.forms.destroy', $form) }}" method="POST" class="d-inline"
  72. onsubmit="return confirm('Удалить форму «{{ $form->title }}» и все её заявки?')">
  73. @csrf @method('DELETE')
  74. <button type="submit" class="btn btn-xs btn-danger" title="Удалить">
  75. <i class="fas fa-trash"></i>
  76. </button>
  77. </form>
  78. </td>
  79. </tr>
  80. @empty
  81. <tr>
  82. <td colspan="8" class="text-center text-muted py-4">Форм пока нет. <a href="{{ route('admin.forms.create') }}">Создать первую</a></td>
  83. </tr>
  84. @endforelse
  85. </tbody>
  86. </table>
  87. </div>
  88. </div>
  89. {{-- Подсказка по использованию --}}
  90. <div class="callout callout-info mt-3">
  91. <h5><i class="fas fa-code"></i> Как вставить форму на страницу</h5>
  92. <p class="mb-0">
  93. Используйте Blade-компонент в шаблоне:
  94. <code>&lt;x-web-form slug="<em>слаг-формы</em>" /&gt;</code>
  95. </p>
  96. </div>
  97. @stop