causal_child.blade.php 1.8 KB

123456789101112131415161718192021222324252627282930
  1. @foreach($records as $record)
  2. @if($showHidden || (!$record->hidden && $record->hidden !== null))
  3. <tr class="record-level-{{ $indentation }}" style="padding-left: {{ $indentation * 20 }}px;">
  4. <td style="padding-left: {{ $indentation * 20 }}px;">
  5. {{ str_repeat('— ', $indentation) }}{{ $record->name }}
  6. </td>
  7. <td>{{ $record->type == 'IN' ? 'Entrata' : 'Uscita' }}</td>
  8. <td>
  9. <span class="badge tessera-badge {{ $record->enabled ? 'active' : 'suspended' }}">
  10. {{ $record->enabled ? 'attivo' : 'disattivo' }}
  11. </span>
  12. </td>
  13. <td>
  14. <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
  15. <button type="button" class="btn btn-outline-success btn-sm" wire:click="duplicate({{ $record->id }})">Duplica</button>
  16. <button type="button" class="btn btn-sm" wire:click="edit({{ $record->id }})"><i class="fa-regular fa-pen-to-square"></i></button>
  17. @if($record->hidden)
  18. <button type="button" class="btn btn-sm" wire:click="show({{ $record->id }})"><i class="fa-regular fa-eye"></i></button>
  19. @else
  20. <button type="button" class="btn btn-sm" onclick="confirm('Sei sicuro di voler nascondere questo elemento?') || event.stopImmediatePropagation()" wire:click="hide({{ $record->id }})"><i class="fa-regular fa-eye-slash"></i></button>
  21. @endif
  22. </td>
  23. </tr>
  24. @if(count($record->childs))
  25. @include('livewire/causal_child', ['records' => $record->childs, 'indentation' => $indentation + 1])
  26. @endif
  27. @endif
  28. @endforeach