allegato.blade.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <div class="tab-pane fade mt-3" id="tab7" role="tabpanel" aria-labelledby="tab7-tab" wire:ignore.self>
  2. <div class="row">
  3. <div class="col">
  4. <div class="card card-primary">
  5. <div class="card-header">
  6. <h3 class="card-title">Allegati</h3>
  7. </div>
  8. <div class="card-body">
  9. <div class="row">
  10. <table class="table table-hover text-nowrap">
  11. <thead>
  12. <tr>
  13. <th>Nome</th>
  14. <th>Tipologia</th>
  15. <th>Visibile in stampa</th>
  16. <th style="width:100px">&nbsp;</th>
  17. <th style="width:100px">&nbsp;</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. @foreach ($allegatiImmagini as $allegato)
  22. <tr>
  23. <td>{{ $allegato->name }}</td>
  24. <td>{{ $this->getAllegatoType($allegato->gallery_type) }}
  25. </td>
  26. <td>{{ $allegato->is_visible ? 'SI' : 'NO' }}</td>
  27. @if (!$this->validated)
  28. <td><a wire:click.prevent="editAllegato({{ $allegato->id }})" data-toggle="modal"
  29. data-target="#allegatiModal" class="btn btn-primary btn-block"
  30. style="background-color: orange;border-color: orange;"><i
  31. class="fa fa-edit"></i></i></a></td>
  32. <td><button onclick="confirm('Sei sicuro?') || event.stopImmediatePropagation()"
  33. wire:click.prevent="removeAllegato({{ $allegato->id }})" type="button"
  34. class="btn btn-success btn-block"><i class="fa fa-trash"></i>&nbsp;</button>
  35. </td>
  36. @endif
  37. </tr>
  38. @if ($allegato->files != '')
  39. @php
  40. $files = explode('|', $allegato->files);
  41. $chunks = array_chunk($files, 3);
  42. @endphp
  43. @foreach ($chunks as $fileChunk)
  44. <tr>
  45. <td colspan="5" style="border-top:0px solid;">
  46. @foreach ($fileChunk as $a)
  47. <a href="{{ url('/storage/' . $a) }}" target="_blank">{{ $a }}</a>&nbsp;&nbsp;&nbsp;
  48. @endforeach
  49. </td>
  50. </tr>
  51. @endforeach
  52. @endif
  53. @endforeach
  54. </tbody>
  55. </table>
  56. @if (!$this->validated)
  57. <a class="btn btn-primary " wire:click.prevent="addAllegato(0)" data-toggle="modal"
  58. data-target="#allegatiModal">Aggiungi</a>
  59. @endif
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>