|
|
@@ -0,0 +1,148 @@
|
|
|
+<style>
|
|
|
+ .btn-primary,
|
|
|
+ .bg-primary,
|
|
|
+ .text-primary,
|
|
|
+ .border-primary .card-primary {
|
|
|
+ background-color: #1F7A8C !important;
|
|
|
+ color: #fff !important;
|
|
|
+ border-color: #1F7A8C !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn-danger,
|
|
|
+ .bg-danger,
|
|
|
+ .text-danger,
|
|
|
+ .border-danger {
|
|
|
+ background-color: #023047 !important;
|
|
|
+ color: #fff !important;
|
|
|
+ border-color: #023047 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn-success,
|
|
|
+ .bg-success,
|
|
|
+ .text-success,
|
|
|
+ .border-success {
|
|
|
+ background-color: white !important;
|
|
|
+ color: #023047 !important;
|
|
|
+ border-color: #023047 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .pagination {
|
|
|
+ background-color: white !important;
|
|
|
+ color: #023047 !important;
|
|
|
+ border-color: #023047 !important;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<div class="m-3">
|
|
|
+
|
|
|
+ <div class="row mb-3">
|
|
|
+ <div class="col-6">
|
|
|
+ <h2>{{$title}}</h2>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-6 text-right">
|
|
|
+ @if(!$add && !$update)
|
|
|
+ <button wire:click="add()" type="button" class="btn btn-block btn-success float-right"
|
|
|
+ style="max-width:150px">Aggiungi</button><br>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @if(!$add && !$update)
|
|
|
+
|
|
|
+ <div>
|
|
|
+
|
|
|
+ <div class="card">
|
|
|
+
|
|
|
+ <div class="card-header">
|
|
|
+
|
|
|
+ <div class="card-tools">
|
|
|
+ <div class="input-group input-group-sm" style="width: 300px;">
|
|
|
+ <input type="text" name="search" wire:model="search" class="form-control float-right"
|
|
|
+ placeholder="Cerca">
|
|
|
+
|
|
|
+ <div class="input-group-append">
|
|
|
+ <button type="submit" class="btn btn-default">
|
|
|
+ <i class="fas fa-search"></i>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="card-body table-responsive p-0">
|
|
|
+ <table class="table table-hover text-nowrap">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Nome</th>
|
|
|
+ <th style="width:150px"> </th>
|
|
|
+ <th style="width:150px"> </th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach($records as $record)
|
|
|
+ <tr>
|
|
|
+ <td>{{$record->name}}</td>
|
|
|
+ <td><button wire:click="edit({{ $record->id }})" type="button"
|
|
|
+ class="btn btn-primary btn-block"><i class="fa fa-edit"></i> Modifica</button>
|
|
|
+ </td>
|
|
|
+ <td><button onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()"
|
|
|
+ wire:click="delete({{ $record->id }})" type="button"
|
|
|
+ class="btn btn-danger btn-block"><i class="fa fa-trash"></i> Elimina</button>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
+ </tbody>
|
|
|
+
|
|
|
+ </table>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="card-footer clearfix">
|
|
|
+
|
|
|
+ <ul class="pagination pagination-sm m-0 float-right">
|
|
|
+
|
|
|
+ {{ $records->links() }}
|
|
|
+
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @else
|
|
|
+
|
|
|
+ <div class="card card-primary">
|
|
|
+
|
|
|
+ <form>
|
|
|
+
|
|
|
+ <div class="card-header">
|
|
|
+ <h3 class="card-title"><b>Inserimento/Modifica</b></h3>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="card-body">
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="name">Nome</label>
|
|
|
+ <input class="form-control @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 class="card-footer">
|
|
|
+ @if($add)
|
|
|
+ <button type="submit" class="btn btn-primary" wire:click.prevent="store()">Salva</button>
|
|
|
+ @endif
|
|
|
+ @if($update)
|
|
|
+ <button type="submit" class="btn btn-primary" wire:click.prevent="update()">Salva</button>
|
|
|
+ @endif
|
|
|
+ <button type="submit" class="btn btn-default" wire:click.prevent="cancel()">Annulla</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @endif
|
|
|
+
|
|
|
+</div>
|