src/templates/ReclutaProceso/testPreguntasShowBody.html.twig line 1

Open in your IDE?
  1. {% extends "@crud\\crud\\show.html.twig" %}
  2. {% block stylesheets %}
  3.     {{ parent() }}
  4.     <link type="text/css" rel="stylesheet" href="{{ asset('ace/css/jquery.treetable.css') }}">
  5.     <link type="text/css" rel="stylesheet" href="{{ asset('ace/css/jquery.treetable.theme.default.css') }}">
  6.     <!--link type="text/css" rel="stylesheet" href="{{ asset('style/jquery-ui.css') }}"-->
  7. {% endblock %}
  8. {% block javascripts %}
  9.     {{ parent() }}
  10.     <script src="{{ asset('ace/js/jquery.treetable.js') }}" type="text/javascript"></script>
  11. {% endblock %}
  12. {% block jquery %}
  13.     {{ parent() }}
  14.     <script type="text/javascript">
  15.         $(function()
  16.         {
  17.             $('#table_test_psicologico').treetable({ expandable: true, indent: 10 });    
  18.         });
  19.         
  20.     </script>    
  21. {% endblock %}
  22. {% block show_details %}
  23.     <div class="panel panel-default">
  24.         <div class="panel-heading">
  25.             <h4 class="panel-title green">
  26.                 <a id="atab-1" aria-expanded="true" class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#datosTest">
  27.                     <i class="bigger-160 ace-icon fa fa-user " data-icon-hide="ace-icon fa fa-angle-down" data-icon-show="ace-icon fa fa-angle-right"></i>
  28.                     &nbsp;Resultado del test psicológico
  29.                 </a>
  30.             </h4>
  31.         </div>
  32.         <div id='datosTest' class="panel-collapse collapse in" aria-expanded="true">
  33.             <a class="btnExpand" onclick="jQuery('#table_test_psicologico').treetable('expandAll'); return false;">
  34.                 <button class="btn btn-white btn-inverse btn-bold btn-round" title="{% trans %}botones.expandir{% endtrans %}">
  35.                     <img src="{{ asset('images/icon/expandir.png') }}" width="16px"><span class="hidden-xs">&nbsp;{% trans %}botones.expandir{% endtrans %}</span>
  36.                 </button>
  37.             </a>
  38.             <a class="btnExpand" onclick="jQuery('#table_test_psicologico').treetable('collapseAll'); return false;">
  39.                 <button class="btn btn-white btn-inverse btn-bold btn-round" title="{% trans %}botones.recoger{% endtrans %}">
  40.                     <img src="{{ asset('images/icon/recoger.png') }}" width="16px"><span class="hidden-xs">&nbsp;{% trans %}botones.recoger{% endtrans %}</span>
  41.                 </button>
  42.             </a>
  43.             <a class="btnExpand" href="{{ path('excel_respuestas_test', {'id': entity.id}) }}">
  44.                 <button class="btn btn-white btn-inverse btn-bold btn-round" title="Exportar a excel">
  45.                     <img src="{{ asset('images/icon/icono_excel_32.png') }}" width="16px"><span class="hidden-xs">&nbsp;Exportar a excel</span>
  46.                 </button>
  47.             </a>
  48.             <table id="table_test_psicologico" class="table table-striped table-bordered table-hover">
  49.                 <thead>
  50.                     <tr>
  51.                         <th style="width: 150px">
  52.                             Tipo
  53.                         </th>
  54.                         <th>
  55.                             Nombre
  56.                         </th>
  57.                         <th>
  58.                             Valor
  59.                         </th>
  60.                         <th style="width: 130px">
  61.                             Riesgo Bajo
  62.                         </th>
  63.                         <th style="width: 130px">
  64.                             Riesgo Medio
  65.                         </th>
  66.                         <th style="width: 130px">
  67.                             Riesgo Alto
  68.                         </th>
  69.                         {% if is_granted('ROLE_PSICOLOGO_JEFE') %}
  70.                             <th style="width: 105px">
  71.                                 Tipo Pregunta
  72.                             </th>
  73.                         {% endif %}
  74.                     </tr>
  75.                 </thead>
  76.                 <tbody>
  77.                     {% for sistemaId, sistema in preguntas %}
  78.                         <tr id="S-{{ sistemaId }}" parentId="" data-tt-id="S-{{ sistemaId }}" data-tt-parent-id="" style="font-size: 16px; font-weight: bold">
  79.                             <td>
  80.                                 SISTEMA
  81.                             </td>
  82.                             <td>
  83.                                 {{ sistema.nombre }}    
  84.                             </td>
  85.                             {% if is_granted('ROLE_PSICOLOGO_JEFE') %}
  86.                                 <td colspan="5"></td>
  87.                             {% else %}
  88.                                 <td colspan="4"></td>
  89.                             {% endif %}
  90.                         </tr>
  91.                         {% if sistema.ejes is defined %}
  92.                             {% for ejeId, eje in sistema.ejes %}
  93.                                 <tr id="E-{{ ejeId }}" parentId="S-{{ sistemaId }}" data-tt-id="E-{{ ejeId }}" data-tt-parent-id="S-{{ sistemaId }}" style="background:orange">
  94.                                     <td>
  95.                                         EJE
  96.                                     </td>
  97.                                     <td style="font-size: 14px;">
  98.                                         {{ eje.nombre }}    
  99.                                     </td>
  100.                                     {% if is_granted('ROLE_PSICOLOGO_JEFE') %}
  101.                                         <td colspan="5"></td>
  102.                                     {% else %}
  103.                                         <td colspan="4"></td>
  104.                                     {% endif %}
  105.                                 </tr>
  106.                                 {% if eje.criterios is defined %}
  107.                                     {% for criterioId, criterio in eje.criterios %}
  108.                                         <tr id="C-{{ criterioId }}" parentId="E-{{ ejeId }}" data-tt-id="C-{{ criterioId }}" data-tt-parent-id="E-{{ ejeId }}">
  109.                                             <td>
  110.                                                 CRITERIO
  111.                                             </td>
  112.                                             <td style="font-size: 12px; font-weight: bold">
  113.                                                 {{ criterio.criterio.nombre }}
  114.                                             </td>
  115.                                             <td>
  116.                                                 {{ criterio.suma }}
  117.                                             </td>
  118.                                             <td {% if criterio.suma < criterio.criterio.riesgoMedioDesde %}style="background-color: green;color: #fff; font-size: 14px""{% endif %}>
  119.                                                 {{ criterio.criterio.riesgoBajoDesde }}&nbsp;a&nbsp;{{ criterio.criterio.riesgoBajoHasta }}
  120.                                             </td>
  121.                                             <td {% if criterio.suma >= criterio.criterio.riesgoMedioDesde and criterio.suma <= criterio.criterio.riesgoMedioHasta %}style="background-color: yellow; font-size: 14px""{% endif %}>
  122.                                                 {{ criterio.criterio.riesgoMedioDesde }}&nbsp;a&nbsp;{{ criterio.criterio.riesgoMedioHasta }}
  123.                                             </td>
  124.                                             <td {% if criterio.suma > criterio.criterio.riesgoMedioHasta %}style="background-color: red;color: #fff; font-size: 14px"{% endif %}>
  125.                                                 {{ criterio.criterio.riesgoAltoDesde }}&nbsp;a&nbsp;{{ criterio.criterio.riesgoAltoHasta }}
  126.                                             </td>
  127.                                             {% if is_granted('ROLE_PSICOLOGO_JEFE') %}
  128.                                                 <td></td>
  129.                                             {% endif %}
  130.                                         </tr>
  131.                                         {% if is_granted('ROLE_PSICOLOGO_JEFE') and criterio.preguntas is defined %}
  132.                                             {% for pregunta in criterio.preguntas %}
  133.                                                 <tr id="P-{{ pregunta.pregunta.id }}" parentId="C-{{ criterioId }}" data-tt-id="P-{{ pregunta.pregunta.id }}" data-tt-parent-id="C-{{ criterioId }}">
  134.                                                     <td>
  135.                                                         PREGUNTA
  136.                                                     </td>
  137.                                                     <td style="font-size: 12px;">
  138.                                                         {{ pregunta.pregunta.nombre }}
  139.                                                     </td>
  140.                                                     <td>
  141.                                                         {{ pregunta.txt }}
  142.                                                     </td>
  143.                                                     <td colspan="3"></td>
  144.                                                     <td>
  145.                                                         {% if pregunta.pregunta.tipo=='directo' %}Directa{% else %}Inversa{% endif %}
  146.                                                     </td>
  147.                                                 </tr>
  148.                                             {% endfor %}
  149.                                         {% endif %}
  150.                                     {% endfor %}
  151.                                 {% endif %}
  152.                             {% endfor %}
  153.                         {% endif %}
  154.                     {% endfor%}
  155.                 </tbody>
  156.             </table>
  157.             <hr>
  158.             <table class="table table-striped table-bordered table-hover">
  159.                 <thead>
  160.                     <tr>
  161.                         <th style="text-align: center;">Sistema</th>
  162.                         <th style="text-align: center;">Preguntas</th>
  163.                         <th style="text-align: center;">Porciento</th>
  164.                         <th style="text-align: center;">Respuestas</th>
  165.                         <th style="text-align: center;">Resultado</th>
  166.                     </tr>
  167.                 </thead>
  168.                 <tbody>
  169.                     {% for sistemaId, sistema in preguntas %}
  170.                         <tr>
  171.                             <td style="text-align: right; width: 20%">{{ sistema.nombre }}</td>
  172.                             <td style="text-align: right;width: 20%">{{ sistema.cant_preguntas }}</td>
  173.                             <td style="text-align: right;width: 20%">{{ sistema.porciento }}%</td>
  174.                             <td style="text-align: right;width:20%">{{ sistema.suma_respuestas }}</td>
  175.                             <td style="text-align: right;width: 20%">{{ sistema.resultado }}%</td>
  176.                         </tr>
  177.                     {% endfor %}
  178.                     <tr>
  179.                         <th colspan="4" style="text-align: right;font-size: 20px;">Total</th>  
  180.                         {% if total <=60%}
  181.                         <td style="text-align: right;background-color: green; color: #fff; font-size: 20px">{{ total }}%<br/>RIESGO BAJO</td>
  182.                         {% endif %}
  183.                         {% if total >60 and total<=80%}
  184.                         <td style="text-align: right;background-color: yellow; color: #000; font-size: 20px">{{ total }}%<br/>RIESGO MEDIO</td>
  185.                         {% endif %}
  186.                         {% if total >80%}
  187.                         <td style="text-align: right;background-color: red; color: #fff; font-size: 20px">{{ total }}%<br/>RIESGO ALTO</td>
  188.                         {% endif %}
  189.                     </tr>
  190.                 <tbody>
  191.             </table>
  192.         </div>
  193.     </div>
  194.     
  195. {% endblock show_details %}
  196. {% block actions %}
  197. {% endblock actions %}
  198. {% block showdata %}
  199.     {{ render(controller('App\\Crud\\Controller\\crudPlainController::showAction', {'rol': 'all', 'routeClassName':'recluta', 'id':entity.recluta, 'parentRouteClassName':'ANY' })) }}
  200. {% endblock %} 
  201.                 
  202.