Files
2026-10-07 20:04:10 -03:00

68 lines
2.9 KiB
PHP
Executable File

@extends('layouts.app')
@section('header', 'Templates')
@section('breadcrumbs')
@php
$breadcrumbs = [
'Templates' => null
];
@endphp
@endsection
@section('content')
<div class="card shadow mb-4">
<div class="card-header py-3 d-flex justify-content-between align-items-center">
<h6 class="m-0 fw-bold text-primary">Lista de Templates</h6>
<a href="{{ route('prompt-templates.create') }}" class="btn btn-primary btn-sm">
<i class="bi bi-plus-circle"></i> Novo Template
</a>
</div>
<div class="card-body">
@if(isset($templates) && count($templates) > 0)
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Nome</th>
<th>Categoria</th>
<th>Status</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
@foreach($templates as $template)
<tr>
<td>{{ $template->name }}</td>
<td>{{ $template->category ?? 'N/A' }}</td>
<td>
<span class="badge bg-{{ $template->is_public ? 'success' : 'secondary' }}">
{{ $template->is_public ? 'Público' : 'Privado' }}
</span>
</td>
<td>
<a href="{{ route('prompt-templates.edit', $template) }}" class="btn btn-warning btn-sm">
<i class="bi bi-pencil"></i>
</a>
<form action="{{ route('prompt-templates.destroy', $template) }}" method="POST" class="d-inline" onsubmit="return confirm('Tem certeza?')">
@csrf @method('DELETE')
<button class="btn btn-danger btn-sm"><i class="bi bi-trash"></i></button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if(is_object($templates) && method_exists($templates, 'links'))
<div class="mt-3">
{{ $templates->links() }}
</div>
@endif
@else
<p class="text-muted">Nenhum template encontrado.</p>
@endif
</div>
</div>
@endsection