@extends('layouts.customer')
@section('title', $template->name)
@section('page-title', $template->name)
@section('content')
{{ $template->name }}
@if(is_array($template->settings) && (($template->settings['origin'] ?? null) === 'ai'))
AI
@endif
{{ $template->description ?? 'No description' }}
Preview
@if($template->customer_id === auth('customer')->id())
@customercan('templates.permissions.can_edit_templates')
@php
$builder = is_array($template->grapesjs_data) ? ($template->grapesjs_data['builder'] ?? null) : null;
$editRoute = ($builder === 'unlayer') ? 'customer.templates.unlayer.edit' : 'customer.templates.edit';
@endphp
Edit
@endcustomercan
@customercan('templates.permissions.can_create_templates')
@endcustomercan
@endif
@if (session('success'))
{{ session('success') }}
@endif
@if (session('error'))
{{ session('error') }}
@endif
- Type
-
{{ ucfirst($template->type) }}
- Usage Count
- {{ $template->usage_count }} times
- Created
- {{ $template->created_at->format('M d, Y H:i') }}
- Last Updated
- {{ $template->updated_at->format('M d, Y H:i') }}
- Visibility
-
@if($template->is_public)
Public
@else
Private
@endif
@php
$rawBuilderData = is_array($template->grapesjs_data) ? $template->grapesjs_data : null;
$jsonPayload = $rawBuilderData;
if (is_array($rawBuilderData) && ($rawBuilderData['builder'] ?? null) === 'unlayer' && is_array($rawBuilderData['unlayer'] ?? null)) {
$jsonPayload = $rawBuilderData['unlayer'];
}
$jsonPretty = $jsonPayload ? json_encode($jsonPayload, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) : '';
@endphp
@if($template->customer_id === auth('customer')->id())
Danger Zone
Once you delete a template, there is no going back.
@customercan('templates.permissions.can_delete_templates')
@endcustomercan
@endif
@endsection