Licitator 1.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
5.7 KiB

5 years ago
  1. <div class="form-row {{ pregunta.alias }} {{ pregunta.class }}">
  2. <div class="form-holder">
  3. {% if casoestudio is defined and casoestudio is not empty %}
  4. {% if respuestaca[pregunta.alias] is defined %}
  5. <a class="btn btn-primary btn-sm casoestudiobtn" data-toggle="collapse" data-target="#casoestudio{{ pregunta.id }}">{{ 'Caso de estudio'|trans({}) }}</a>
  6. <div id="casoestudio{{ pregunta.id }}" class="collapse casoestudiodiv">
  7. <pre>{{ respuestaca[pregunta.alias]|raw }}</pre>
  8. </div>
  9. {% endif %}
  10. {% endif %}
  11. {% if pregunta.preTitulo is not empty %}
  12. <div class="{{ tarea[0].getProcesosId.alias }}_pretitulo">{{ pregunta.preTitulo|trans({})|raw }}</div>
  13. {% endif %}
  14. {% set options = pregunta.TipoPreguntaOptions|split(',') %}
  15. {% for option in options %}
  16. {% set currentoption=loop.index %}
  17. <div class="switch switch-blue">
  18. <span>{{ option }}</span>
  19. <label for="{{ pregunta.alias }}">
  20. {% if respuestas is empty %}
  21. <input type="hidden" id="{{ pregunta.alias ~ currentoption}}" name="{{ pregunta.alias }}[]" value="off" checked/>
  22. <input type="radio" id="{{ pregunta.alias ~ currentoption}}-off" class="switch-input" name="{{ pregunta.alias ~ currentoption}}-1" placeholder="{{ pregunta.placeholder|trans({}) }}" onclick="$('#{{ pregunta.alias ~ currentoption}}').val('off')" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %} value="off" data-sonata-icheck="false" checked>
  23. <label for="{{ pregunta.alias ~ currentoption }}-off" class="switch-label switch-label-off">OFF</label>
  24. <input type="radio" id="{{ pregunta.alias ~ currentoption }}-on" class="switch-input" name="{{ pregunta.alias ~ currentoption }}-1" placeholder="{{ pregunta.placeholder|trans({}) }}" onclick="$('#{{ pregunta.alias ~ currentoption}}').val('on')" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %} value="on" data-sonata-icheck="false" >
  25. <label for="{{ pregunta.alias ~ currentoption}}-on" class="switch-label switch-label-on">ON</label>
  26. <span class="switch-selection"></span>
  27. {% else %}
  28. {% set encontrada = false %}
  29. {% for respuesta in respuestas %}
  30. {% if respuesta.preguntas.id == pregunta.id %}
  31. {% set encontrada=true %}
  32. <input type="hidden" id="{{ pregunta.alias ~ currentoption}}" name="{{ pregunta.alias }}[]" value="{{ respuesta.valor|json_decode[currentoption]}}"/>
  33. <input type="radio" id="{{ pregunta.alias ~ currentoption }}-off" class="switch-input" name="{{ pregunta.alias ~ currentoption}}-1" placeholder="{{ pregunta.placeholder|trans({}) }}" onclick="$('#{{ pregunta.alias ~ currentoption}}').val('off')" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %} value="off" data-sonata-icheck="false" {% if 'off' == respuesta.valor|json_decode[currentoption] %}checked {% endif %}>
  34. <label for="{{ pregunta.alias }}-off" class="switch-label switch-label-off">OFF</label>
  35. <input type="radio" id="{{ pregunta.alias ~ currentoption }}-on" class="switch-input" name="{{ pregunta.alias ~ currentoption }}-1" placeholder="{{ pregunta.placeholder|trans({}) }}" onclick="$('#{{ pregunta.alias ~ currentoption }}').val('on')" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %} value="on" data-sonata-icheck="false" {% if 'on' == respuesta.valor|json_decode[currentoption] %}checked {% endif %}>
  36. <label for="{{ pregunta.alias ~ currentoption }}-on" class="switch-label switch-label-on">ON</label>
  37. <span class="switch-selection"></span>
  38. {% endif %}
  39. {% endfor %}
  40. {% if not encontrada %}
  41. <input type="hidden" id="{{ pregunta.alias ~ currentoption}}" name="{{ pregunta.alias }}[]" value="off" checked/>
  42. <input type="radio" id="{{ pregunta.alias ~ currentoption }}-off" class="switch-input" name="{{ pregunta.alias ~ currentoption}}-1" placeholder="{{ pregunta.placeholder|trans({}) }}" onclick="$('#{{ pregunta.alias ~ currentoption}}').val('off')" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %} value="off" data-sonata-icheck="false" checked>
  43. <label for="{{ pregunta.alias ~ currentoption }}-off" class="switch-label switch-label-off">OFF</label>
  44. <input type="radio" id="{{ pregunta.alias ~ currentoption }}-on" class="switch-input" name="{{ pregunta.alias ~ currentoption }}-1" placeholder="{{ pregunta.placeholder|trans({}) }}" onclick="$('#{{ pregunta.alias ~ currentoption }}').val('on')"{% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %} value="on" data-sonata-icheck="false" >
  45. <label for="{{ pregunta.alias ~ currentoption}}-on" class="switch-label switch-label-on">ON</label>
  46. <span class="switch-selection"></span>
  47. {% endif %}
  48. {% endif %}
  49. <span class="control-label__text">{{ pregunta.nombre|trans({})|raw }}</span></label>
  50. {% if pregunta.descripcion is not empty %}
  51. <div class="{{ tarea[0].getProcesosId.alias }}_descripcion">{{ pregunta.descripcion|trans({})|raw }}</div>
  52. {% endif %}
  53. </div>
  54. {% endfor %}
  55. </div>
  56. </div>