Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs #483

Merged
merged 5 commits into from
May 23, 2024
Merged

docs #483

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions config/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@

':_divider_',

'Page:newspaper' => [
['slug' => 'page-class', 'label' => 'Create class'],
['slug' => 'page-instance', 'label' => 'Make instance'],
'Menu:bars-3' => [
['slug' => 'menu', 'label' => 'Menu'],
],

'Appearance:photo' => [
['slug' => 'appearance-index', 'label' => 'Basics'],
['slug' => 'appearance-layout_builder', 'label' => 'LayoutBuilder'],
['slug' => 'appearance-assets', 'label' => 'AssetsManager'],
],

'Models Resources:document-duplicate' => [
['slug' => 'resources-index', 'label' => 'Basics'],
['slug' => 'resources-fields', 'label' => 'Fields'],
Expand All @@ -31,11 +37,11 @@
['slug' => 'resources-metrics', 'label' => 'Metrics'],
['slug' => 'resources-events', 'label' => 'Events'],
['slug' => 'resources-authorization', 'label' => 'Authorization'],
//['slug' => 'resources-routes', 'label' => 'Routes'],
],

'Menu:bars-3' => [
['slug' => 'menu', 'label' => 'Menu'],
'Page:newspaper' => [
['slug' => 'page-class', 'label' => 'Create class'],
['slug' => 'page-instance', 'label' => 'Make instance'],
],

'Fields:table-cells' => [
Expand Down Expand Up @@ -150,12 +156,6 @@
['slug' => 'action_button', 'label' => 'ActionButton'],
],

'Appearance:photo' => [
['slug' => 'appearance-index', 'label' => 'Basics'],
['slug' => 'appearance-layout_builder', 'label' => 'LayoutBuilder'],
['slug' => 'appearance-assets', 'label' => 'AssetsManager'],
],

'UI components:code-bracket-square' => [
['slug' => 'ui-index', 'label' => 'Basics'],
['slug' => 'ui-alert', 'label' => 'Alert'],
Expand Down
5 changes: 3 additions & 2 deletions config/promo_menu_en.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

return [
'doc' => ['link' => '/docs?change-moonshine-locale=en', 'title' => 'Documentation'],
'demo' => ['link' => 'https://demo.moonshine-laravel.com', 'title' => 'Demo'],
'doc' => ['link' => '/docs?change-moonshine-locale=en', 'title' => 'Documentation', 'blank' => false],
'demo' => ['link' => 'https://demo.moonshine-laravel.com', 'title' => 'Demo', 'blank' => true],
'guide' => [
'link' => 'https://www.youtube.com/playlist?list=PLIDM0FwRatgQQmiwoAa6axuWZWB18Zlb6',
'title' => 'Video guide',
'blank' => true
],
];
9 changes: 5 additions & 4 deletions config/promo_menu_ru.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

return [
'doc' => ['link' => '/docs?change-moonshine-locale=ru', 'title' => 'Документация'],
'demo' => ['link' => 'https://demo.moonshine-laravel.com', 'title' => 'Демо'],
'doc' => ['link' => '/docs?change-moonshine-locale=ru', 'title' => 'Документация', 'blank' => false],
'demo' => ['link' => 'https://demo.moonshine-laravel.com', 'title' => 'Демо', 'blank' => true],
'guide' => [
'link' => 'https://youtube.com/playlist?list=PLTucyHptHtTnfDI18bZnYEgvJIFmW8fGy&si=DgnBSDcpP9FTAc8Q',
'title' => 'Видео-гайд',
'blank' => true
],
'tricks' => ['link' => 'https://cutcode.dev/articles/moonshine-tips-tricks', 'title' => 'Блог'],
'consult' => ['link' => 'https://forms.gle/U41uLZzXBCibmwbE7', 'title' => 'Консультация'],
'tricks' => ['link' => 'https://cutcode.dev/articles/moonshine-tips-tricks', 'title' => 'Блог', 'blank' => true],
'consult' => ['link' => 'https://forms.gle/U41uLZzXBCibmwbE7', 'title' => 'Консультация', 'blank' => true],
];
8 changes: 4 additions & 4 deletions resources/views/home-en.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function gtag(){dataLayer.push(arguments);}
<a
href="{{ $menu['link'] }}"
class="font-semibold text-white hover:text-pink"
target="_blank"
@if($menu['blank']) target="_blank" @endif
>
{{ $menu['title'] }}
</a>
Expand Down Expand Up @@ -138,7 +138,7 @@ class="font-semibold text-white hover:text-pink"
<path d="M12.307 1.145 1.645 11.805a.677.677 0 0 1-.95 0 .676.676 0 0 1 0-.95L11.355.196c.26-.26.69-.26.95 0a.676.676 0 0 1 0 .95h.002Z" />
</svg>
</a>
<a href="{{ config('promo_menu_' . app()->getLocale() . '.doc.link') }}" class="btn btn-outline btn-pink" target="_blank">
<a href="{{ config('promo_menu_' . app()->getLocale() . '.doc.link') }}" class="btn btn-outline btn-pink">
Documentation
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-pink" fill="currentColor" viewBox="0 0 21 20">
<path
Expand Down Expand Up @@ -1031,7 +1031,7 @@ public function fields(): array
<a
href="{{ $menu['link'] }}"
class="font-semibold text-white hover:text-pink"
target="_blank"
@if($menu['blank']) target="_blank" @endif
>
{{ $menu['title'] }}
</a>
Expand Down Expand Up @@ -1116,7 +1116,7 @@ class="bg-body fixed inset-0 z-[9999] overflow-auto"
<a
href="{{ $menu['link'] }}"
class="text-md font-semibold text-white hover:text-pink"
target="_blank"
@if($menu['blank']) target="_blank" @endif
>
{{ $menu['title'] }}
</a>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/home-ru.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function gtag(){dataLayer.push(arguments);}
<a
href="{{ $menu['link'] }}"
class="font-semibold text-white hover:text-pink"
target="_blank"
@if($menu['blank']) target="_blank" @endif
>
{{ $menu['title'] }}
</a>
Expand Down Expand Up @@ -134,7 +134,7 @@ class="font-semibold text-white hover:text-pink"
<path d="M12.307 1.145 1.645 11.805a.677.677 0 0 1-.95 0 .676.676 0 0 1 0-.95L11.355.196c.26-.26.69-.26.95 0a.676.676 0 0 1 0 .95h.002Z" />
</svg>
</a>
<a href="{{ config('promo_menu_' . app()->getLocale() . '.doc.link') }}" class="btn btn-outline btn-pink" target="_blank">
<a href="{{ config('promo_menu_' . app()->getLocale() . '.doc.link') }}" class="btn btn-outline btn-pink">
Документация
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-pink" fill="currentColor" viewBox="0 0 21 20">
<path
Expand Down Expand Up @@ -1048,7 +1048,7 @@ public function fields(): array
<a
href="{{ $menu['link'] }}"
class="font-semibold text-white hover:text-pink"
target="_blank"
@if($menu['blank']) target="_blank" @endif
>
{{ $menu['title'] }}
</a>
Expand Down Expand Up @@ -1127,7 +1127,7 @@ class="bg-body fixed inset-0 z-[9999] overflow-auto"
<a
href="{{ $menu['link'] }}"
class="text-md font-semibold text-white hover:text-pink"
target="_blank"
@if($menu['blank']) target="_blank" @endif
>
{{ $menu['title'] }}
</a>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/pages/en/advanced/commands.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
]"
>

@include('pages.en.shared.alert_select_item_console')

<x-sub-title id="install">Install</x-sub-title>

<x-p>
Expand Down
17 changes: 17 additions & 0 deletions resources/views/pages/en/appearance/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
['url' => '#theme', 'label' => 'Main theme'],
['url' => '#colors', 'label' => 'Color scheme'],
['url' => '#color-manager', 'label' => 'Color manager'],
['url' => '#favicons', 'label' => 'Favicons'],
['url' => '#minimalistic', 'label' => 'Minimalistic theme'],
]
]">
Expand Down Expand Up @@ -241,6 +242,22 @@ public function boot(): void
moonshineColors()->successBg('#000000', dark: true);
</x-code>

<x-sub-title id="favicons">Favicons</x-sub-title>

<x-p>
To change <em>favicons</em> in the <strong>MoonShine</strong> admin panel,
you need to override the corresponding template.
</x-p>

<x-p>
To do this, copy the file <code>vendor/moonshine/moonshine/resources/views/layouts/shared/favicon.blade.php</code>
in <code>resources/views/vendor/moonshine/layouts/shared/favicon.blade.php</code>.
</x-p>

<x-p>
Then change the file links in this template to point to your own favicons.
</x-p>

<x-sub-title id="minimalistic">Minimalistic theme</x-sub-title>

<x-p>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/pages/en/appearance/layout_builder.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
php artisan moonshine:publish
</x-code>

@include('pages.en.shared.alert_select_item_console')

<x-p>
After publishing <em>Layout</em>, the <code>MoonShineLayout.php</code> class will appear in the <code>app/MoonShine</code> directory.
</x-p>
Expand Down
1 change: 0 additions & 1 deletion resources/views/pages/en/fields/belongs_to.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

@include('pages.en.fields.shared.relation_make', ['field' => 'BelongsTo', 'label' => 'Country'])


<x-moonshine::alert type="warning" icon="heroicons.information-circle">
When using the <em>BelongsTo</em> field to sort or filter positions, you must use the method
<code>setColumn()</code> set a field in a database table or override a method
Expand Down
4 changes: 4 additions & 0 deletions resources/views/pages/en/fields/hidden_ids.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
HiddenIds::make('index-table')
</x-code>

<x-moonshine::alert type="warning" icon="heroicons.information-circle">
The table must contain the <x-link link="{{ to_page('fields-id') }}">ID</x-link> field.
</x-moonshine::alert>

<x-sub-title id="use">Use</x-sub-title>

<x-code language="php">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<x-moonshine::alert class="my-4" type="warning" icon="heroicons.information-circle">
To select the appropriate item, you must use the <code>space</code> key.
</x-moonshine::alert>
2 changes: 2 additions & 0 deletions resources/views/pages/ru/advanced/commands.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
]"
>

@include('pages.ru.shared.alert_select_item_console')

<x-sub-title id="install">Install</x-sub-title>

<x-p>
Expand Down
17 changes: 17 additions & 0 deletions resources/views/pages/ru/appearance/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
['url' => '#theme', 'label' => 'Основная тема'],
['url' => '#colors', 'label' => 'Цветовая схема'],
['url' => '#color-manager', 'label' => 'Менеджер цветов'],
['url' => '#favicons', 'label' => 'Favicons'],
['url' => '#minimalistic', 'label' => 'Минимальная тема'],
]
]">
Expand Down Expand Up @@ -241,6 +242,22 @@ public function boot(): void
moonshineColors()->successBg('#000000', dark: true);
</x-code>

<x-sub-title id="favicons">Favicons</x-sub-title>

<x-p>
Чтобы изменить <em>favicons</em> в админ-панели <strong>MoonShine</strong>,
вам необходимо переопределить соответствующий шаблон.
</x-p>

<x-p>
Для этого скопируйте файл <code>vendor/moonshine/moonshine/resources/views/layouts/shared/favicon.blade.php</code>
в <code>resources/views/vendor/moonshine/layouts/shared/favicon.blade.php</code>.
</x-p>

<x-p>
Затем измените ссылки на файлы в этом шаблоне, чтобы они указывали на ваши собственные favicons.
</x-p>

<x-sub-title id="minimalistic">Минимальная тема</x-sub-title>

<x-p>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/pages/ru/appearance/layout_builder.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
php artisan moonshine:publish
</x-code>

@include('pages.ru.shared.alert_select_item_console')

<x-p>
После публикации <em>Layout</em>, в директории <code>app/MoonShine</code> появится класс <code>MoonShineLayout.php</code>.
</x-p>
Expand Down
1 change: 0 additions & 1 deletion resources/views/pages/ru/fields/belongs_to.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

@include('pages.ru.fields.shared.relation_make', ['field' => 'BelongsTo', 'label' => 'Country'])


<x-moonshine::alert type="warning" icon="heroicons.information-circle">
При использовании поля <em>BelongsTo</em> для сортировки или фильтрации позиций необходимо через метод
<code>setColumn()</code> задать поле в таблице базы данных или переопределить метод
Expand Down
4 changes: 4 additions & 0 deletions resources/views/pages/ru/fields/hidden_ids.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
В качестве параметра метод <code>make()</code> принимает название компонента.
</x-p>

<x-moonshine::alert type="warning" icon="heroicons.information-circle">
В таблице должно присутствовать поле <x-link link="{{ to_page('fields-id') }}">ID</x-link>.
</x-moonshine::alert>

<x-code language="php">
HiddenIds::make('index-table')
</x-code>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<x-moonshine::alert class="my-4" type="warning" icon="heroicons.information-circle">
Для выбора соответствующего пункта необходимо использовать клавишу <code>пробел</code>.
</x-moonshine::alert>
Loading