Refactor template preview components: Moved preview component placement after the CodeEditor in footer, header, and section template forms for improved user experience. Enhanced loading indicators in the template preview Blade view for better feedback during content processing.

This commit is contained in:
Ümit Tunç
2025-10-31 17:01:27 -03:00
parent 52c4ba1b19
commit 8d6d0b52b9
4 changed files with 294 additions and 194 deletions
@@ -23,14 +23,6 @@ class FooterTemplateForm
->maxLength(255)
->columnSpanFull(),
// Preview Component
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'footer',
'data-field-name' => 'html_content',
])
->columnSpanFull(),
CodeEditor::make('html_content')
->label(__('footer-templates.field_html_content'))
->required()
@@ -42,6 +34,14 @@ class FooterTemplateForm
'data-field-name' => 'html_content',
]),
// Preview Component - placed after editor
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'footer',
'data-field-name' => 'html_content',
])
->columnSpanFull(),
Toggle::make('is_active')
->label(__('footer-templates.field_is_active'))
->default(true)
@@ -23,14 +23,6 @@ class HeaderTemplateForm
->maxLength(255)
->columnSpanFull(),
// Preview Component
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'header',
'data-field-name' => 'html_content',
])
->columnSpanFull(),
CodeEditor::make('html_content')
->label(__('header-templates.field_html_content'))
->required()
@@ -42,6 +34,14 @@ class HeaderTemplateForm
'data-field-name' => 'html_content',
]),
// Preview Component - placed after editor
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'header',
'data-field-name' => 'html_content',
])
->columnSpanFull(),
Toggle::make('is_active')
->label(__('header-templates.field_is_active'))
->default(true)
@@ -23,14 +23,6 @@ class SectionTemplateForm
->maxLength(255)
->columnSpanFull(),
// Preview Component
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'section',
'data-field-name' => 'html_content',
])
->columnSpanFull(),
CodeEditor::make('html_content')
->label(__('section-templates.field_html_content'))
->required()
@@ -42,6 +34,14 @@ class SectionTemplateForm
'data-field-name' => 'html_content',
]),
// Preview Component - placed after editor
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'section',
'data-field-name' => 'html_content',
])
->columnSpanFull(),
Toggle::make('is_active')
->label(__('section-templates.field_is_active'))
->default(true)