templates/mantenimiento/informes/index.html.twig line 1

Open in your IDE?
  1. {% extends 'navbar.html.twig' %}
  2. {% block title %}Historial{% endblock %}
  3. {% block content_user %}
  4.     <span class="h5">Historial de Tareas</span>
  5.     <br>
  6.     <hr>
  7.     {{ form_start(form, { 'attr' : { 'novalidate' : 'novalidate'}}) }}
  8.                 <div class="form-row pt-2">
  9.                     <div class="col col-lg-3">
  10.                         {{ form_label(form.from, 'Desde') }}
  11.                         {{ form_widget(form.from, { 'attr' : { 'class' : 'form-control form-control inherit'} }) }}
  12.                         {{ form_errors(form.from) }}
  13.                     </div>
  14.                     <div class="col col-lg-3">
  15.                         {{ form_label(form.to, 'Hasta') }}
  16.                         {{ form_widget(form.to, { 'attr' : { 'class' : 'form-control form-control inherit'} }) }}
  17.                         {{ form_errors(form.to) }}
  18.                     </div>
  19.                     <div class="col col-lg-4">
  20.                         {{ form_label(form.equipo) }}
  21.                         {{ form_widget(form.equipo, { 'attr' : { 'class' : 'form-control form-control inherit form-select'} }) }}
  22.                         {{ form_errors(form.equipo) }}
  23.                     </div>
  24.                     <div class="col col-lg-2 px-2 mt-4 pt-4">
  25.                         {{ form_widget(form.cargar, { 'attr' : { 'class' : 'btn btn-success btn-block'} }) }}
  26.                     </div>
  27.                 </div>
  28.     {{ form_end(form) }}
  29.     <hr>
  30.     {% if history is defined %}
  31.         <table id="example" class="table table-striped table-bordered table-hover">
  32.             <thead>
  33.                 <tr>
  34.                     <th>Equipo</th>
  35.                     <th>Fecha</th>
  36.                     <th>Departamento</th>
  37.                     <th>Tarea Realizada</th>
  38.                     <th></th>
  39.                 </tr>
  40.             </thead>
  41.             <tbody>
  42.             {% for diagrama_tarea in history %}
  43.                 <tr>
  44.                     <td>{{ diagrama_tarea.nomequipo }}</td>
  45.                     <td data-sort="{{ diagrama_tarea.fecha|date('Y-m-d') }}">{{ diagrama_tarea.fecha ? diagrama_tarea.fecha|date('d/m/Y') : '' }}</td>
  46.                     <td>{{ diagrama_tarea.nomdepto }}</td>
  47.                     <td>{{ diagrama_tarea.observacionResponsable }}</td>
  48.                     <td>
  49.                         <a href="{{ path('app_mantenimiento_diagrama_tarea_show', {'id': diagrama_tarea.id}) }}"><i class="bi bi-eye" style="font-size: 1rem;"></i></a>
  50.                     </td>
  51.                 </tr>
  52.             {% endfor %}
  53.             </tbody>
  54.         </table>
  55.     {% endif %}
  56. {% endblock %}
  57. {% block javascripts_footer %}
  58.     
  59.     {{ parent() }}
  60.     <script type="text/javascript">
  61.         $('.btn-delete').click(function(event) {
  62.                                                 event.preventDefault();
  63.                                                 let a = $(this);
  64.                                                 if (confirm('Seguro eliminar el diagrama NÂș ' + a.data('nro') + '?'))
  65.                                                     $.post(a.attr('href'),
  66.                                                            function(data) {
  67.                                                                             if (data.ok)
  68.                                                                             {
  69.                                                                                 window.location.reload();
  70.                                                                             }
  71.                                                                             else
  72.                                                                             {
  73.                                                                                 alert(data.msg);
  74.                                                                             }
  75.                                                            });
  76.         });
  77.         $('#example').DataTable({
  78.                                     fixedHeader: true,
  79.                                     paging: true,
  80.                                     responsive: true,
  81.                                     order: [[ 0, 'desc' ]],
  82.                                     language: {
  83.                                         url: '{{ asset('i18n/spanish.json') }}'
  84.                                     }
  85.                                 });
  86.     </script>
  87. {% endblock %}