|
@@ -28,6 +28,7 @@
|
|
|
<table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
|
|
<table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
|
|
+ <th style="text-align:center" scope="col"><input type="checkbox" class="checkAll"></th>
|
|
|
<th scope="col">Anno</th>
|
|
<th scope="col">Anno</th>
|
|
|
<th scope="col">Nome</th>
|
|
<th scope="col">Nome</th>
|
|
|
<th scope="col">Livello</th>
|
|
<th scope="col">Livello</th>
|
|
@@ -41,6 +42,7 @@
|
|
|
<tbody id="checkall-target">
|
|
<tbody id="checkall-target">
|
|
|
@foreach($records as $record)
|
|
@foreach($records as $record)
|
|
|
<tr>
|
|
<tr>
|
|
|
|
|
+ <td style="text-align:center"><input type="checkbox" class="chkCourse" name="{{$record->id}}"></td>
|
|
|
<td>{{$record->year}}</td>
|
|
<td>{{$record->year}}</td>
|
|
|
<td>{{$record->name}}</td>
|
|
<td>{{$record->name}}</td>
|
|
|
<td>{{$record->level->name ?? ""}}</td>
|
|
<td>{{$record->level->name ?? ""}}</td>
|
|
@@ -51,7 +53,7 @@
|
|
|
<td>
|
|
<td>
|
|
|
<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" 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>
|
|
<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>
|
|
|
- <button type="button" class="btn" wire:click="duplicate({{ $record->id }})" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Duplica"><i class="fa-regular fa-copy"></i></button>
|
|
|
|
|
|
|
+ <button type="button" class="btn" wire:click="duplicate({{ $record->id }}, false)" data-bs-toggle="popover" data-bs-trigger="hover focus" data-bs-placement="bottom" data-bs-content="Duplica"><i class="fa-regular fa-copy"></i></button>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
@endforeach
|
|
@endforeach
|
|
@@ -378,24 +380,51 @@
|
|
|
},
|
|
},
|
|
|
top1C :'search',
|
|
top1C :'search',
|
|
|
},
|
|
},
|
|
|
|
|
+ "columnDefs": [ {
|
|
|
|
|
+ "targets": 0,
|
|
|
|
|
+ "orderable": false
|
|
|
|
|
+ } ],
|
|
|
pagingType: 'numbers',
|
|
pagingType: 'numbers',
|
|
|
"language": {
|
|
"language": {
|
|
|
"url": "/assets/js/Italian.json"
|
|
"url": "/assets/js/Italian.json"
|
|
|
},
|
|
},
|
|
|
"fnInitComplete": function (oSettings, json) {
|
|
"fnInitComplete": function (oSettings, json) {
|
|
|
- var html = ' <a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a>';
|
|
|
|
|
|
|
+ var html = ' <a href="#" class="addData btn--ui"><i class="fa-solid fa-plus"></i></a> <a href="#" class="duplicateData btn--ui"><i class="fa-solid fa-copy"></i></a>';
|
|
|
$(".dt-search").append(html);
|
|
$(".dt-search").append(html);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
$('#tablesaw-350 thead tr th').addClass('col');
|
|
$('#tablesaw-350 thead tr th').addClass('col');
|
|
|
$('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
|
|
$('#tablesaw-350 thead tr th').css("background-color", "#f6f8fa");
|
|
|
|
|
|
|
|
|
|
+ var courses = [];
|
|
|
|
|
+ $(".chkCourse").click(function(){
|
|
|
|
|
+ var id = $(this).attr('name');
|
|
|
|
|
+ if(!courses.includes(id)){
|
|
|
|
|
+ courses.push(id);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ courses.splice(courses.indexOf(id), 1); //deleting
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(courses);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
|
- $(document).on("click",".addData",function() {
|
|
|
|
|
- $(".title--section_addButton").trigger("click")
|
|
|
|
|
|
|
+ $(document).on("click",".duplicateData",function() {
|
|
|
|
|
+ @this.duplicateMultiple(courses);
|
|
|
});
|
|
});
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ var all = false;
|
|
|
|
|
+ $(".checkAll").click(function(){
|
|
|
|
|
+ all = !all;
|
|
|
|
|
+ courses = [];
|
|
|
|
|
+ $('.chkCourse').each(function(){
|
|
|
|
|
+ $(this).prop('checked', all);
|
|
|
|
|
+ if (all)
|
|
|
|
|
+ courses.push($(this).attr('name'));
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(courses);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|