First Commit
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('header', 'Editar Template')
|
||||
|
||||
@section('breadcrumbs')
|
||||
@php
|
||||
$breadcrumbs = [
|
||||
'Templates' => route('prompt-templates.index'),
|
||||
'Editar' => null
|
||||
];
|
||||
@endphp
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 fw-bold text-primary">Editar Template</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('prompt-templates.update', $promptTemplate) }}">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Nome</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="{{ old('name', $promptTemplate->name) }}" required>
|
||||
@error('name') <div class="text-danger small">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="description" class="form-label">Descrição</label>
|
||||
<textarea class="form-control" id="description" name="description" rows="2">{{ old('description', $promptTemplate->description) }}</textarea>
|
||||
@error('description') <div class="text-danger small">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="category" class="form-label">Categoria</label>
|
||||
<input type="text" class="form-control" id="category" name="category" value="{{ old('category', $promptTemplate->category) }}">
|
||||
@error('category') <div class="text-danger small">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="template_data" class="form-label">Dados do Template (JSON)</label>
|
||||
<textarea class="form-control font-monospace" id="template_data" name="template_data" rows="20" required>{{ old('template_data', json_encode($promptTemplate->template_data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) }}</textarea>
|
||||
@error('template_data') <div class="text-danger small">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="mb-3 form-check">
|
||||
<input type="checkbox" class="form-check-input" id="is_public" name="is_public" value="1" {{ old('is_public', $promptTemplate->is_public) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_public">Público</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary"><i class="bi bi-save"></i> Salvar</button>
|
||||
<a href="{{ route('prompt-templates.index') }}" class="btn btn-secondary">Cancelar</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user