- Subcategories can now be reordered within their category — up/down arrow
  buttons next to "Edytuj" in Admin > Kategorie. The order set there is used
  everywhere a subcategory list is shown (pickers, admin listings, etc.).
This commit is contained in:
2026-07-24 13:58:18 +02:00
parent 313e01ad24
commit 1df697afce
9 changed files with 149 additions and 7 deletions

View File

@@ -85,7 +85,7 @@ $tabGroups = [
<table class="table" style="margin:0;border-top:none">
<thead><tr><th>Podkategoria</th><th></th></tr></thead>
<tbody>
@foreach ($cat->subcategories as $sub)
@foreach ($cat->subcategories as $i => $sub)
<tr>
<td>
<div style="display:flex;flex-direction:column;gap:2px">
@@ -97,7 +97,9 @@ $tabGroups = [
</div>
</td>
<td>
<div style="display:flex;gap:6px;justify-content:flex-end">
<div style="display:flex;gap:6px;justify-content:flex-end;align-items:center">
<button class="btn btn-icon" type="button" wire:click="moveSubcategoryUp({{ $sub->id }})" @disabled($i === 0) style="padding:2px;width:24px;height:24px" title="Przesuń wyżej"><span class="material-symbols-outlined" style="font-size:16px">arrow_upward</span></button>
<button class="btn btn-icon" type="button" wire:click="moveSubcategoryDown({{ $sub->id }})" @disabled($i === $cat->subcategories->count() - 1) style="padding:2px;width:24px;height:24px" title="Przesuń niżej"><span class="material-symbols-outlined" style="font-size:16px">arrow_downward</span></button>
<button class="btn btn-ghost" type="button" wire:click="openSubcategoryEditForm({{ $sub->id }})">Edytuj</button>
<button class="btn btn-ghost" type="button" wire:click="removeSubcategory({{ $sub->id }})">Usuń</button>
</div>