diff --git a/app/Console/Commands/ImportHtmlTemplates.php b/app/Console/Commands/ImportHtmlTemplates.php index 1ec6a59..e68ee9f 100644 --- a/app/Console/Commands/ImportHtmlTemplates.php +++ b/app/Console/Commands/ImportHtmlTemplates.php @@ -290,14 +290,12 @@ class ImportHtmlTemplates extends Command // DOMDocument attribute değerlerini encode ettiği için bunları geri çeviriyoruz $html = str_replace(['%7B', '%7D'], ['{', '}'], $html); - // SPECIAL TOKENS FIX - if ($templateType === 'header') { - $html = str_replace('___SPECIAL_MENU___', '{custom.menu}', $html); // Geriye dönük uyumluluk - $html = str_replace('___CUSTOM_MENU___', '{custom.menu}', $html); - $html = str_replace('___CUSTOM_NAVBAR___', '{custom.navbar}', $html); - $html = str_replace('___CUSTOM_LANGUAGE___', '{custom.language-selector}', $html); - $html = str_replace('___SETTING_LANGUAGES___', '{custom.language-selector}', $html); - } + // SPECIAL TOKENS FIX - Replace placeholder tokens with actual template syntax + $html = str_replace('___SPECIAL_MENU___', '{custom.menu}', $html); + $html = str_replace('___CUSTOM_MENU___', '{custom.menu}', $html); + $html = str_replace('___CUSTOM_NAVBAR___', '{custom.navbar}', $html); + $html = str_replace('___CUSTOM_LANGUAGE___', '{custom.language-selector}', $html); + $html = str_replace('___SETTING_LANGUAGES___', '{custom.language-selector}', $html); return ['html' => $html, 'data' => $data]; } diff --git a/app/Filament/Admin/Resources/FooterTemplates/Tables/FooterTemplatesTable.php b/app/Filament/Admin/Resources/FooterTemplates/Tables/FooterTemplatesTable.php index f7c68fc..6797087 100644 --- a/app/Filament/Admin/Resources/FooterTemplates/Tables/FooterTemplatesTable.php +++ b/app/Filament/Admin/Resources/FooterTemplates/Tables/FooterTemplatesTable.php @@ -12,6 +12,7 @@ use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Filters\TrashedFilter; use Filament\Tables\Table; +use Filament\Actions\Action; class FooterTemplatesTable { @@ -56,6 +57,13 @@ class FooterTemplatesTable TrashedFilter::make(), ]) ->recordActions([ + Action::make('preview') + ->label(__('footer-templates.action_preview')) + ->icon('heroicon-o-eye') + ->modalContent(fn ($record) => view('filament.admin.resources.footer-templates.preview', ['record' => $record])) + ->modalSubmitAction(false) + ->modalCancelAction(false) + ->modalWidth('7xl'), ViewAction::make(), EditAction::make(), ]) diff --git a/app/Filament/Admin/Resources/HeaderTemplates/Tables/HeaderTemplatesTable.php b/app/Filament/Admin/Resources/HeaderTemplates/Tables/HeaderTemplatesTable.php index 0ae9b2f..12d5215 100644 --- a/app/Filament/Admin/Resources/HeaderTemplates/Tables/HeaderTemplatesTable.php +++ b/app/Filament/Admin/Resources/HeaderTemplates/Tables/HeaderTemplatesTable.php @@ -12,6 +12,7 @@ use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Filters\TrashedFilter; use Filament\Tables\Table; +use Filament\Actions\Action; class HeaderTemplatesTable { @@ -56,6 +57,13 @@ class HeaderTemplatesTable TrashedFilter::make(), ]) ->recordActions([ + Action::make('preview') + ->label(__('header-templates.action_preview')) + ->icon('heroicon-o-eye') + ->modalContent(fn ($record) => view('filament.admin.resources.header-templates.preview', ['record' => $record])) + ->modalSubmitAction(false) + ->modalCancelAction(false) + ->modalWidth('7xl'), ViewAction::make(), EditAction::make(), ]) diff --git a/lang/en/footer-templates.php b/lang/en/footer-templates.php index 1ef0b78..c4bb9f9 100644 --- a/lang/en/footer-templates.php +++ b/lang/en/footer-templates.php @@ -27,6 +27,7 @@ return [ 'column_deleted_at' => 'Deleted At', // Actions + 'action_preview' => 'Preview', 'create' => 'New Footer Template', 'edit' => 'Edit Footer Template', 'view' => 'View Footer Template', diff --git a/lang/en/header-templates.php b/lang/en/header-templates.php index 451ffa1..006d503 100644 --- a/lang/en/header-templates.php +++ b/lang/en/header-templates.php @@ -27,6 +27,7 @@ return [ 'column_deleted_at' => 'Deleted At', // Actions + 'action_preview' => 'Preview', 'create' => 'New Header Template', 'edit' => 'Edit Header Template', 'view' => 'View Header Template', diff --git a/lang/tr/footer-templates.php b/lang/tr/footer-templates.php index 1877a84..7a71b3b 100644 --- a/lang/tr/footer-templates.php +++ b/lang/tr/footer-templates.php @@ -27,6 +27,7 @@ return [ 'column_deleted_at' => 'Silinme', // Actions + 'action_preview' => 'Önizleme', 'create' => 'Yeni Footer Şablonu', 'edit' => 'Footer Şablonunu Düzenle', 'view' => 'Footer Şablonunu Görüntüle', diff --git a/lang/tr/header-templates.php b/lang/tr/header-templates.php index 5634a31..56c98bb 100644 --- a/lang/tr/header-templates.php +++ b/lang/tr/header-templates.php @@ -27,6 +27,7 @@ return [ 'column_deleted_at' => 'Silinme', // Actions + 'action_preview' => 'Önizleme', 'create' => 'Yeni Header Şablonu', 'edit' => 'Header Şablonunu Düzenle', 'view' => 'Header Şablonunu Görüntüle', diff --git a/resources/views/filament/admin/resources/footer-templates/preview.blade.php b/resources/views/filament/admin/resources/footer-templates/preview.blade.php new file mode 100644 index 0000000..bc29037 --- /dev/null +++ b/resources/views/filament/admin/resources/footer-templates/preview.blade.php @@ -0,0 +1,11 @@ +
+
+ +
+
+ diff --git a/resources/views/filament/admin/resources/header-templates/preview.blade.php b/resources/views/filament/admin/resources/header-templates/preview.blade.php new file mode 100644 index 0000000..50076f6 --- /dev/null +++ b/resources/views/filament/admin/resources/header-templates/preview.blade.php @@ -0,0 +1,11 @@ +
+
+ +
+
+