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.

101 lines
6.1 KiB

5 years ago
  1. {% set pregunta2=seccion.PreguntasId[preguntasIndex+1]%}
  2. {% set pregunta3=seccion.PreguntasId[preguntasIndex+2]%}
  3. {% if pregunta.alias starts with 'xaxis' or pregunta.alias starts with 'yaxis' %}
  4. {%else%}
  5. <table id='table{{loop.index}}'class="table">
  6. <thead class="thead-dark">
  7. <tr>
  8. <th scope="col">Stakeholder</th>
  9. <th scope="col">Effect of the Business on the Stakeholders</th>
  10. <th scope="col">Effects of Stakeholders on the Business</th>
  11. <th scope="col">Actions</th>
  12. </tr>
  13. </thead>
  14. <tbody>
  15. {% if respuesta[pregunta.alias] is defined and respuesta[pregunta.alias] is not empty%}
  16. {% set respuestasarray=respuesta[pregunta.alias]|json_decode%}
  17. {% for indexArray in 0..respuestasarray|length-1 %}
  18. <tr>
  19. <td>
  20. {% if respuestas is empty %}
  21. <input type="text" class="form-control" id="{{ pregunta.alias }}-{{ indexArray }}" name="{{ pregunta.alias }}[]" placeholder="{{ pregunta.placeholder|trans({}) }} {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}">
  22. {% else %}
  23. {% set encontrada = false %}
  24. {% if respuesta[pregunta.alias] is defined and respuestasarray[indexArray] is defined%}
  25. {% set encontrada=true %}
  26. {% endif %}
  27. {% if encontrada %}
  28. <input type="text" class="form-control" id="{{ pregunta.alias }}-{{ indexArray }}" name="{{ pregunta.alias }}[]" placeholder="{{ pregunta.placeholder|trans({}) }}" value="{{ respuestasarray[indexArray] }}" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}>
  29. {% else %}
  30. <input type="text" class="form-control" id="{{ pregunta.alias }}-{{ indexArray }}" name="{{ pregunta.alias }}[]" placeholder="{{ pregunta.placeholder|trans({}) }} {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}">
  31. {% endif %}
  32. {% endif %}
  33. </td>
  34. {% if respuesta[pregunta2.alias] is defined%}
  35. {% set respuestasrange1=respuesta[pregunta2.alias]|json_decode%}
  36. {% endif %}
  37. <td>
  38. {% if respuestas is empty %}
  39. <input id="{{ pregunta2.alias }}-{{ indexArray }}" name="{{ pregunta2.alias }}[]" type="text" class="slider form-control" {{ pregunta2.TipoPreguntaOptions|raw }} style="display: none;"/>
  40. {% else %}
  41. {% set encontrada = false %}
  42. {% if respuesta[pregunta2.alias] is defined and respuestasrange1[indexArray] is defined%}
  43. {% set encontrada=true %}
  44. {%endif%}
  45. {% if encontrada is defined and encontrada %}
  46. <input id="{{ pregunta2.alias }}-{{indexArray }}" name="{{ pregunta2.alias }}[]" type="text" class="slider form-control" {{ pregunta2.TipoPreguntaOptions|raw }} data-slider-value="{{respuestasrange1[indexArray]}}" data-value="{{respuestasrange1[indexArray]}}" value="{{respuestasrange1[indexArray]}}" style="display: none;"/>
  47. {% else %}
  48. <input id="{{ pregunta2.alias }}-{{ indexArray }}" name="{{ pregunta2.alias }}[]" type="text" class="slider form-control" {{ pregunta2.TipoPreguntaOptions|raw }} style="display: none;"/>
  49. {% endif %}
  50. {% endif %}</td>
  51. {% if respuesta[pregunta3.alias] is defined%}
  52. {% set respuestasrange2=respuesta[pregunta3.alias]|json_decode%}
  53. {% endif %}
  54. <td> {% if respuestas is empty %}
  55. <input id="{{ pregunta3.alias }}-{{indexArray }}" name="{{ pregunta3.alias }}[]" type="text" class="slider form-control" {{ pregunta3.TipoPreguntaOptions|raw }} style="display: none;"/>
  56. {% else %}
  57. {% set encontrada = false %}
  58. {% if respuesta[pregunta3.alias] is defined and respuestasrange2[indexArray] is defined%}
  59. {% set encontrada=true %}
  60. {% endif %}
  61. {% if encontrada is defined and encontrada %}
  62. <input id="{{ pregunta3.alias }}-{{indexArray }}" name="{{ pregunta3.alias }}[]" type="text" class="slider form-control" {{ pregunta3.TipoPreguntaOptions|raw }} data-slider-value="{{respuestasrange2[indexArray]}}" data-value="{{respuestasrange2[indexArray]}}" value="{{respuestasrange2[indexArray]}}" style="display: none;"/>
  63. {% else %}
  64. <input id="{{ pregunta3.alias }}-{{ indexArray }}" name="{{ pregunta3.alias }}[]" type="text" class="slider form-control" {{ pregunta3.TipoPreguntaOptions|raw }} style="display: none;"/>
  65. {% endif %}
  66. {% endif %}</td>
  67. <td><button type="button" class="btn btn-warning delete-row" onclick="$(this).parents('tr').remove();">Delete Row</button></td>
  68. </tr>
  69. {% endfor %}
  70. {% else %}
  71. <tr>
  72. <td>
  73. <input type="text" class="form-control" id="{{ pregunta.alias }}-0" name="{{ pregunta.alias }}[]" placeholder="{{ pregunta.placeholder|trans({}) }} {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}">
  74. </td>
  75. {% if respuesta[pregunta2.alias] is defined%}
  76. {% set respuestasrange1=respuesta[pregunta2.alias]|json_decode%}
  77. {% endif %}
  78. <td>
  79. <input id="{{ pregunta2.alias }}-0" name="{{ pregunta2.alias }}[]" type="text" class="slider form-control" {{ pregunta2.TipoPreguntaOptions|raw }} style="display: none;"/>
  80. {% if respuesta[pregunta3.alias] is defined%}
  81. {% set respuestasrange2=respuesta[pregunta3.alias]|json_decode%}
  82. {% endif %}
  83. <td>
  84. <input id="{{ pregunta3.alias }}-0" name="{{ pregunta3.alias }}[]" type="text" class="slider form-control" {{ pregunta3.TipoPreguntaOptions|raw }} style="display: none;"/></td>
  85. <td><button type="button" class="btn btn-warning delete-row" onclick="$(this).parents('tr').remove();">Delete Row</button></td>
  86. </tr>
  87. {% endif %}
  88. </tbody>
  89. </table>
  90. <button type="button" class="btn btn-info add-row" onclick="addRow($(this).prev())">Add Row</button>
  91. {% endif %}