Browse Source

260226 新增編輯器提示

OMEGA\lulufj.ho 1 month ago
parent
commit
55331d699b
2 changed files with 9 additions and 5 deletions
  1. 7
    4
      app/Filament/Resources/EsgResource.php
  2. 2
    1
      app/Filament/Resources/NewsResource.php

+ 7
- 4
app/Filament/Resources/EsgResource.php View File

@@ -123,9 +123,7 @@ class EsgResource extends Resource
123 123
                                     FilamentLexicalEditor::make('content.text_content_tw')
124 124
                                         ->label('中文')
125 125
                                         
126
-                                            ->label(new \Illuminate\Support\HtmlString('
127
-      中文<br>  <img src="' . asset('images/your-image.png') . '" alt="label image" class="h-6 w-auto" />
128
-    '))
126
+                                            ->label(new \Illuminate\Support\HtmlString('中文  <a href="' . asset('images/tool-bar.png') . '", target="_blank">工具列說明</a>'))
129 127
                                         ->id(fn ($get) => "text_content_tw_" . $get('item_key') . "_" . uniqid())
130 128
                                         ->enabledToolbars($editor_toolbar)
131 129
                                         ->required()
@@ -150,7 +148,8 @@ class EsgResource extends Resource
150 148
                                                 }
151 149
                                             }),
152 150
                                         FilamentLexicalEditor::make('block_content_tw')
153
-                                            ->label('繁體中文內容')
151
+                                            // ->label('繁體中文內容')
152
+                                            ->label(new \Illuminate\Support\HtmlString('繁體中文內容  <a href="' . asset('images/tool-bar.png') . '", target="_blank">工具列說明</a>'))
154 153
                                             ->id(fn ($get) => "block_content_tw_" . $get('block_item_key') . "_" . uniqid())
155 154
                                             ->enabledToolbars($editor_toolbar)
156 155
                                             ->required()
@@ -274,6 +273,7 @@ class EsgResource extends Resource
274 273
                                                             ->default(1)->inline(),
275 274
                                                             FilamentLexicalEditor::make('col1_tw')
276 275
                                                                 ->id(fn ($get) => "col1_tw_" . $get('simple_table_rows_key') . "_" . uniqid())
276
+                                                                ->label(new \Illuminate\Support\HtmlString('<a href="' . asset('images/tool-bar.png') . '", target="_blank">工具列說明</a>'))
277 277
                                                                 ->enabledToolbars($editor_toolbar)
278 278
                                                                 ->required()
279 279
                                                                 ->columnSpanFull(),
@@ -305,6 +305,7 @@ class EsgResource extends Resource
305 305
                                                             ->default(1)->inline(),
306 306
                                                             FilamentLexicalEditor::make('col2_tw')
307 307
                                                                 ->id(fn ($get) => "col2_tw_" . $get('simple_table_rows_key') . "_" . uniqid())
308
+                                                                ->label(new \Illuminate\Support\HtmlString('<a href="' . asset('images/tool-bar.png') . '", target="_blank">工具列說明</a>'))
308 309
                                                                 ->enabledToolbars($editor_toolbar)
309 310
                                                                 ->required()
310 311
                                                                 ->columnSpanFull(),
@@ -336,6 +337,7 @@ class EsgResource extends Resource
336 337
                                                             ->default(1),
337 338
                                                             FilamentLexicalEditor::make('col3_tw')
338 339
                                                                 ->id(fn ($get) => "col3_tw_" . $get('simple_table_rows_key') . "_" . uniqid())
340
+                                                                ->label(new \Illuminate\Support\HtmlString('<a href="' . asset('images/tool-bar.png') . '", target="_blank">工具列說明</a>'))
339 341
                                                                 ->enabledToolbars($editor_toolbar)
340 342
                                                                 ->required()
341 343
                                                                 ->columnSpanFull(),
@@ -367,6 +369,7 @@ class EsgResource extends Resource
367 369
                                                             ->default(1)->inline(),
368 370
                                                             FilamentLexicalEditor::make('col4_tw')
369 371
                                                                 ->id(fn ($get) => "col4_tw_" . $get('simple_table_rows_key') . "_" . uniqid())
372
+                                                                ->label(new \Illuminate\Support\HtmlString('<a href="' . asset('images/tool-bar.png') . '", target="_blank">工具列說明</a>'))
370 373
                                                                 ->enabledToolbars($editor_toolbar)
371 374
                                                                 ->required()
372 375
                                                                 ->columnSpanFull(),

+ 2
- 1
app/Filament/Resources/NewsResource.php View File

@@ -212,7 +212,8 @@ class NewsResource extends Resource
212 212
                         ])->visible(fn (Get $get):bool => $get("paragraph_type") == 1),
213 213
                         Group::make()->schema([
214 214
                             FilamentLexicalEditor::make('text_content_tw')
215
-                                ->label('繁體中文內容')
215
+                                // ->label('繁體中文內容')
216
+                                ->label(new \Illuminate\Support\HtmlString('繁體中文內容  <a href="' . asset('images/tool-bar.png') . '", target="_blank">工具列說明</a>'))
216 217
                                 ->id(fn ($get) => "text_content_tw_" . $get('item_key') . "_" . uniqid())
217 218
                                 ->enabledToolbars([
218 219
                                     ToolbarItem::UNDO, ToolbarItem::REDO, ToolbarItem::NORMAL,