diff --git a/app/Filament/Admin/Pages/UserGuide.php b/app/Filament/Admin/Pages/UserGuide.php new file mode 100644 index 0000000..e2c461d --- /dev/null +++ b/app/Filament/Admin/Pages/UserGuide.php @@ -0,0 +1,65 @@ +getFirstGuide(); + + if ($firstGuide) { + $this->selectedGuide = $firstGuide['slug']; + } + } + + public static function getNavigationLabel(): string + { + return __('user-guide.navigation_label'); + } + + public function getTitle(): string + { + return __('user-guide.title'); + } + + public function getGuides(): array + { + $guideService = app(GuideService::class); + return $guideService->getAllGuides(); + } + + public function getSelectedGuideContent(): ?array + { + if (!$this->selectedGuide) { + return null; + } + + $guideService = app(GuideService::class); + return $guideService->getGuide($this->selectedGuide); + } + + public function selectGuide(string $slug): void + { + $guideService = app(GuideService::class); + + if ($guideService->guideExists($slug)) { + $this->selectedGuide = $slug; + } + } +} + diff --git a/app/Services/GuideService.php b/app/Services/GuideService.php new file mode 100644 index 0000000..19819d6 --- /dev/null +++ b/app/Services/GuideService.php @@ -0,0 +1,108 @@ +guidePath = resource_path('views/guide'); + } + + /** + * Tüm markdown dosyalarını son güncellenme tarihine göre sıralı olarak getir + * + * @return array + */ + public function getAllGuides(): array + { + if (!File::exists($this->guidePath)) { + return []; + } + + $files = File::glob($this->guidePath . '/*.md'); + + $guides = []; + + foreach ($files as $file) { + $filename = File::basename($file); + $name = Str::before($filename, '.md'); + $modifiedTime = File::lastModified($file); + + $guides[] = [ + 'filename' => $filename, + 'name' => $name, + 'slug' => Str::slug($name), + 'path' => $file, + 'modified_time' => $modifiedTime, + 'modified_date' => date('Y-m-d H:i:s', $modifiedTime), + ]; + } + + // Son güncellenenden ilk güncellenene göre sırala + usort($guides, function ($a, $b) { + return $b['modified_time'] <=> $a['modified_time']; + }); + + return $guides; + } + + /** + * Belirli bir guide dosyasını getir + * + * @param string $slug + * @return array|null + */ + public function getGuide(string $slug): ?array + { + $guides = $this->getAllGuides(); + + foreach ($guides as $guide) { + if ($guide['slug'] === $slug) { + $guide['content'] = File::get($guide['path']); + return $guide; + } + } + + return null; + } + + /** + * İlk guide'ı getir (varsayılan olarak gösterilecek) + * + * @return array|null + */ + public function getFirstGuide(): ?array + { + $guides = $this->getAllGuides(); + + if (empty($guides)) { + return null; + } + + $firstGuide = $guides[0]; + $firstGuide['content'] = File::get($firstGuide['path']); + + return $firstGuide; + } + + /** + * Guide dosyasının var olup olmadığını kontrol et + * + * @param string $slug + * @return bool + */ + public function guideExists(string $slug): bool + { + return $this->getGuide($slug) !== null; + } +} + diff --git a/lang/en/placeholder-picker.php b/lang/en/placeholder-picker.php index 4ceb7e7..b4ed6e5 100644 --- a/lang/en/placeholder-picker.php +++ b/lang/en/placeholder-picker.php @@ -4,6 +4,8 @@ return [ 'title' => 'Placeholder Variables', 'click_to_insert' => 'Click to insert into editor', 'special_placeholders' => 'Special Placeholders', + 'search_placeholder' => 'Search placeholders...', + 'no_results' => 'No results found', // Placeholder Types 'type_text' => 'Text', diff --git a/lang/en/user-guide.php b/lang/en/user-guide.php new file mode 100644 index 0000000..1427ab0 --- /dev/null +++ b/lang/en/user-guide.php @@ -0,0 +1,15 @@ + 'User Guide', + 'navigation_label' => 'User Guide', + + 'menu_title' => 'Guides', + 'search_placeholder' => 'Search guides...', + 'no_guides' => 'No guide files found yet.', + 'no_guide_selected' => 'No Guide Selected', + 'select_guide_from_menu' => 'Please select a guide from the left menu.', + 'last_updated' => 'Last updated', + 'no_results' => 'No results found.', +]; + diff --git a/lang/tr/placeholder-picker.php b/lang/tr/placeholder-picker.php index dd95440..29a2d86 100644 --- a/lang/tr/placeholder-picker.php +++ b/lang/tr/placeholder-picker.php @@ -4,6 +4,8 @@ return [ 'title' => 'Placeholder Değişkenleri', 'click_to_insert' => 'Tıklayarak editöre ekle', 'special_placeholders' => 'Özel Placeholder\'lar', + 'search_placeholder' => 'Placeholder ara...', + 'no_results' => 'Arama sonucu bulunamadı', // Placeholder Tipleri 'type_text' => 'Metin', diff --git a/lang/tr/user-guide.php b/lang/tr/user-guide.php new file mode 100644 index 0000000..027a86e --- /dev/null +++ b/lang/tr/user-guide.php @@ -0,0 +1,15 @@ + 'Kullanıcı Kılavuzu', + 'navigation_label' => 'Kullanıcı Kılavuzu', + + 'menu_title' => 'Kılavuzlar', + 'search_placeholder' => 'Kılavuz ara...', + 'no_guides' => 'Henüz kılavuz dosyası bulunmamaktadır.', + 'no_guide_selected' => 'Kılavuz Seçilmedi', + 'select_guide_from_menu' => 'Lütfen sol menüden bir kılavuz seçin.', + 'last_updated' => 'Son güncelleme', + 'no_results' => 'Arama sonucu bulunamadı.', +]; + diff --git a/resources/views/components/placeholder-picker.blade.php b/resources/views/components/placeholder-picker.blade.php index 3191dab..02230ba 100644 --- a/resources/views/components/placeholder-picker.blade.php +++ b/resources/views/components/placeholder-picker.blade.php @@ -30,246 +30,358 @@ $fieldName = $fieldName ?? 'html_content'; @endphp -
+ + + {{ __('placeholder-picker.title') }} + + +
+ + + + + + + + + + + + +
+ - // Monaco Editor instance'ını bul - const editorContainer = document.querySelector('[data-field-name=\'{{ $fieldName }}\']'); - let monacoEditorInstance = null; - let currentValue = ''; - let cursorPosition = null; + +
+

+ {{ __('placeholder-picker.special_placeholders') }} +

+
+ + {menu} + + + {staticMenu} + +
+
- // Monaco Editor'dan cursor pozisyonunu al - if (editorContainer && window.monaco) { - const editorInstances = window.monaco.editor.getEditors(); - for (let editor of editorInstances) { - const container = editor.getContainerDomNode(); - if (container && container.closest && container.closest('[data-field-name=\'{{ $fieldName }}\']')) { - monacoEditorInstance = editor; - const model = editor.getModel(); - currentValue = model.getValue(); - const selection = editor.getSelection(); - if (selection) { - cursorPosition = model.getOffsetAt(selection.getStartPosition()); - } else { - cursorPosition = currentValue.length; - } - break; + +
+ +

{{ __('placeholder-picker.no_results') }}

+
+
+
+
+
+ + diff --git a/resources/views/filament/admin/pages/user-guide.blade.php b/resources/views/filament/admin/pages/user-guide.blade.php new file mode 100644 index 0000000..bb92313 --- /dev/null +++ b/resources/views/filament/admin/pages/user-guide.blade.php @@ -0,0 +1,221 @@ + +
+ {{-- Sol Navigation Bar --}} + + + {{-- Sağ İçerik Alanı --}} +
+ @if($selectedGuide && $this->getSelectedGuideContent()) + @php + $guide = $this->getSelectedGuideContent(); + @endphp + + + +
+

+ {{ \Illuminate\Support\Str::title(str_replace(['-', '_'], ' ', $guide['name'])) }} +

+ @if(isset($guide['modified_date'])) +

+ + {{ __('user-guide.last_updated') }}: + {{ \Carbon\Carbon::parse($guide['modified_date'])->locale(app()->getLocale())->format('d F Y, H:i') }} +

+ @endif +
+
+ + +
+ {!! \Illuminate\Support\Str::markdown($guide['content'], [ + 'html_input' => 'allow', + 'allow_unsafe_links' => false, + ]) !!} +
+
+
+ @else + + + {{ __('user-guide.title') }} + + + +
+ +

+ {{ __('user-guide.no_guide_selected') }} +

+

+ {{ __('user-guide.select_guide_from_menu') }} +

+
+
+
+ @endif +
+
+ + @push('styles') + + @endpush +
diff --git a/resources/views/guide/getting-started.md b/resources/views/guide/getting-started.md new file mode 100644 index 0000000..57d76a7 --- /dev/null +++ b/resources/views/guide/getting-started.md @@ -0,0 +1,37 @@ +# Başlangıç Kılavuzu + +Bu kılavuz, Citrus Platform'a başlangıç yapmak için gerekli adımları içerir. + +## Giriş + +Citrus Platform, modüler yapısı ve güçlü özellikleri ile modern web uygulamaları geliştirmenizi sağlar. + +## Kurulum + +### Gereksinimler + +- PHP 8.1 veya üzeri +- Composer +- MySQL/MariaDB +- Node.js ve NPM + +### Adımlar + +1. Projeyi klonlayın +2. Bağımlılıkları yükleyin: `composer install` +3. Ortam değişkenlerini ayarlayın: `.env` dosyasını düzenleyin +4. Veritabanını oluşturun: `php artisan migrate` +5. Uygulamayı başlatın: `php artisan serve` + +## İlk Adımlar + +Sisteme giriş yaptıktan sonra: + +- Dashboard'u keşfedin +- Kullanıcı yönetimini inceleyin +- Sayfa oluşturma özelliklerini test edin + +## Yardım + +Sorularınız için lütfen dokümantasyonu inceleyin veya destek ekibi ile iletişime geçin. +