| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <div class="col card--ui" id="card--dashboard">
- <header id="title--section" class="d-flex align-items-center justify-content-between">
- <div class="title--section_name d-flex align-items-center justify-content-between" style="display:none !important" >
- <i class="ico--ui title_section utenti me-2"></i>
- <h2 class="primary">@if(!$add && !$update)Categorie @else Inserimento/modifica categoria @endif</h2>
- </div>
- @if(!$add && !$update)
- <div class="title--section_addButton text-right " wire:click="add()" style="cursor: pointer;">
- <div class="btn--ui entrata d-flex justify-items-between">
- <a href="#" wire:click="add()" style="color:white">AGGIUNGI</a>
- </div>
- </div>
- <a class="btn--ui lightGrey" href="/settings?type=anagrafica"><i class="fa-solid fa-arrow-left"></i></a><br>
- @endif
- </header>
- @if(!$add && !$update)
- <section id="resume-table">
- <div class="compare--chart_wrapper d-none"></div>
- <table class="table tablesaw tablesaw-stack" id="tablesaw-350" width="100%">
- <thead>
- <tr>
- <th scope="col">Nome</th>
- <th scope="col">...</th>
- </tr>
- </thead>
- <tbody id="checkall-target">
- @foreach($records as $record)
- <tr>
- <td>{{$record->name}}</td>
- <td>
- <button type="button" class="btn btn-outline-success btn-sm" wire:click="addLevel({{ $record->id }})">Aggiungi livello</button>
- <button type="button" class="btn" wire:click="edit({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Modifica"><i class="fa-regular fa-pen-to-square"></i></button>
- <button type="button" class="btn" onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()" wire:click="delete({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Elimina"><i class="fa-regular fa-trash-can"></i></button>
- </td>
- </tr>
- @if(count($record->childs))
- @include('livewire/category_child',['records' => $record->childs, 'indentation' => 1])
- @endif
- @endforeach
- </tbody>
- </table>
- </section>
- @else
- <div class="container">
- @if (session()->has('error'))
- <div class="alert alert-danger" role="alert">
- {{ session()->get('error') }}
- </div>
- @endif
- <div class="row">
- <div class="col">
- <form action="">
- @if($parent != '')
- <h3>Aggiungi livello a {{$parent}}</h3><br>
- @endif
- <div class="row mb-3">
- <div class="col">
- <div class="form--item">
- <label for="inputName" class="form-label">Nome</label>
- <input class="form-control js-keyupTitle @error('name') is-invalid @enderror" type="text" id="name" placeholder="Nome" wire:model="name">
- @error('name')
- <div class="invalid-feedback">{{ $message }}</div>
- @enderror
- </div>
- </div>
- </div>
- <div class="form--item">
- @if($add)
- <button type="submit" class="btn--ui" wire:click.prevent="store()">Salva</button>
- @endif
- @if($update)
- <button type="submit" class="btn--ui" wire:click.prevent="update()">Salva</button>
- @endif
- <button type="button" class="btn--ui lightGrey" wire:click="cancel()">Annulla</button>
- </div>
- </form>
- </div>
- </div>
- </div>
- @endif
- </div>
|