added empty page button stack

This commit is contained in:
Cihan Şentürk 2025-07-30 13:18:32 +03:00 committed by GitHub
parent 7b1eaf30fc
commit a4f48d2342
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 2 deletions

View File

@ -483,6 +483,7 @@ abstract class Index extends Component
'text' => trans('general.title.new', ['type' => trans_choice($this->textPage ?? 'general.' . $prefix, 1)]), 'text' => trans('general.title.new', ['type' => trans_choice($this->textPage ?? 'general.' . $prefix, 1)]),
'description' => trans('general.empty.actions.new', ['type' => strtolower(trans_choice($this->textPage ?? 'general.' . $prefix, 1))]), 'description' => trans('general.empty.actions.new', ['type' => strtolower(trans_choice($this->textPage ?? 'general.' . $prefix, 1))]),
'active_badge' => true, 'active_badge' => true,
'stack' => 'create_button',
]; ];
} }
@ -494,6 +495,7 @@ abstract class Index extends Component
'url' => route($this->importRoute, $this->importRouteParameters), 'url' => route($this->importRoute, $this->importRouteParameters),
'text' => trans('import.title', ['type' => trans_choice($this->textPage ?? 'general.' . $prefix, 2)]), 'text' => trans('import.title', ['type' => trans_choice($this->textPage ?? 'general.' . $prefix, 2)]),
'description' => trans('general.empty.actions.import', ['type' => strtolower(trans_choice($this->textPage ?? 'general.' . $prefix, 2))]), 'description' => trans('general.empty.actions.import', ['type' => strtolower(trans_choice($this->textPage ?? 'general.' . $prefix, 2))]),
'stack' => 'import_button',
]; ];
} }

View File

@ -297,6 +297,7 @@ class EmptyPage extends Component
'text' => trans('general.title.new', ['type' => $title]), 'text' => trans('general.title.new', ['type' => $title]),
'description' => trans('general.empty.actions.new', ['type' => strtolower($title)]), 'description' => trans('general.empty.actions.new', ['type' => strtolower($title)]),
'active_badge' => true, 'active_badge' => true,
'stack' => 'create_button',
]; ];
} }
@ -317,6 +318,7 @@ class EmptyPage extends Component
'text' => trans('import.title', ['type' => $title]), 'text' => trans('import.title', ['type' => $title]),
'description' => trans('general.empty.actions.import', ['type' => strtolower($title)]), 'description' => trans('general.empty.actions.import', ['type' => strtolower($title)]),
'active_badge' => false, 'active_badge' => false,
'stack' => 'import_button',
]; ];
} }

View File

@ -17,6 +17,7 @@
@if ($checkPermissionCreate) @if ($checkPermissionCreate)
@can ($button['permission']) @can ($button['permission'])
@endif @endif
@stack($button['stack'] . '_start')
<li class="border-b p-2 hover:bg-gray-100"> <li class="border-b p-2 hover:bg-gray-100">
<x-link href="{{ $button['url']}}" class="flex items-center justify-between text-xs" override="class"> <x-link href="{{ $button['url']}}" class="flex items-center justify-between text-xs" override="class">
<div class="truncate"> <div class="truncate">
@ -39,6 +40,7 @@
<span class="material-icons text-gray-500 transform rtl:rotate-180">chevron_right</span> <span class="material-icons text-gray-500 transform rtl:rotate-180">chevron_right</span>
</x-link> </x-link>
</li> </li>
@stack($button['stack'] . '_end')
@if ($checkPermissionCreate) @if ($checkPermissionCreate)
@endcan @endcan
@endif @endif

View File

@ -173,14 +173,16 @@
'permission' => 'create-banking-transactions', 'permission' => 'create-banking-transactions',
'text' => trans('general.title.new', ['type' => trans_choice('general.incomes', 1)]), 'text' => trans('general.title.new', ['type' => trans_choice('general.incomes', 1)]),
'description' => trans('general.empty.actions.new', ['type' => trans_choice('general.incomes', 1)]), 'description' => trans('general.empty.actions.new', ['type' => trans_choice('general.incomes', 1)]),
'active_badge' => false 'active_badge' => false,
'stack' => 'create_income_button',
], ],
[ [
'url' => route('transactions.create', ['type' => 'expense']), 'url' => route('transactions.create', ['type' => 'expense']),
'permission' => 'create-banking-transactions', 'permission' => 'create-banking-transactions',
'text' => trans('general.title.new', ['type' => trans_choice('general.expenses', 1)]), 'text' => trans('general.title.new', ['type' => trans_choice('general.expenses', 1)]),
'description' => trans('general.empty.actions.new', ['type' => trans_choice('general.expenses', 1)]), 'description' => trans('general.empty.actions.new', ['type' => trans_choice('general.expenses', 1)]),
'active_badge' => false 'active_badge' => false,
'stack' => 'create_expense_button',
], ],
]" ]"
/> />