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.
 
 
 
 
 

102 lines
6.1 KiB

{% set pregunta2=seccion.PreguntasId[preguntasIndex+1]%}
{% set pregunta3=seccion.PreguntasId[preguntasIndex+2]%}
{% if pregunta.alias starts with 'xaxis' or pregunta.alias starts with 'yaxis' %}
{%else%}
<table id='table{{loop.index}}'class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Stakeholder</th>
<th scope="col">Effect of the Business on the Stakeholders</th>
<th scope="col">Effects of Stakeholders on the Business</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% if respuesta[pregunta.alias] is defined and respuesta[pregunta.alias] is not empty%}
{% set respuestasarray=respuesta[pregunta.alias]|json_decode%}
{% for indexArray in 0..respuestasarray|length-1 %}
<tr>
<td>
{% if respuestas is empty %}
<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 %}">
{% else %}
{% set encontrada = false %}
{% if respuesta[pregunta.alias] is defined and respuestasarray[indexArray] is defined%}
{% set encontrada=true %}
{% endif %}
{% if encontrada %}
<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 %}>
{% else %}
<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 %}">
{% endif %}
{% endif %}
</td>
{% if respuesta[pregunta2.alias] is defined%}
{% set respuestasrange1=respuesta[pregunta2.alias]|json_decode%}
{% endif %}
<td>
{% if respuestas is empty %}
<input id="{{ pregunta2.alias }}-{{ indexArray }}" name="{{ pregunta2.alias }}[]" type="text" class="slider form-control" {{ pregunta2.TipoPreguntaOptions|raw }} style="display: none;"/>
{% else %}
{% set encontrada = false %}
{% if respuesta[pregunta2.alias] is defined and respuestasrange1[indexArray] is defined%}
{% set encontrada=true %}
{%endif%}
{% if encontrada is defined and encontrada %}
<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;"/>
{% else %}
<input id="{{ pregunta2.alias }}-{{ indexArray }}" name="{{ pregunta2.alias }}[]" type="text" class="slider form-control" {{ pregunta2.TipoPreguntaOptions|raw }} style="display: none;"/>
{% endif %}
{% endif %}</td>
{% if respuesta[pregunta3.alias] is defined%}
{% set respuestasrange2=respuesta[pregunta3.alias]|json_decode%}
{% endif %}
<td> {% if respuestas is empty %}
<input id="{{ pregunta3.alias }}-{{indexArray }}" name="{{ pregunta3.alias }}[]" type="text" class="slider form-control" {{ pregunta3.TipoPreguntaOptions|raw }} style="display: none;"/>
{% else %}
{% set encontrada = false %}
{% if respuesta[pregunta3.alias] is defined and respuestasrange2[indexArray] is defined%}
{% set encontrada=true %}
{% endif %}
{% if encontrada is defined and encontrada %}
<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;"/>
{% else %}
<input id="{{ pregunta3.alias }}-{{ indexArray }}" name="{{ pregunta3.alias }}[]" type="text" class="slider form-control" {{ pregunta3.TipoPreguntaOptions|raw }} style="display: none;"/>
{% endif %}
{% endif %}</td>
<td><button type="button" class="btn btn-warning delete-row" onclick="$(this).parents('tr').remove();">Delete Row</button></td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>
<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 %}">
</td>
{% if respuesta[pregunta2.alias] is defined%}
{% set respuestasrange1=respuesta[pregunta2.alias]|json_decode%}
{% endif %}
<td>
<input id="{{ pregunta2.alias }}-0" name="{{ pregunta2.alias }}[]" type="text" class="slider form-control" {{ pregunta2.TipoPreguntaOptions|raw }} style="display: none;"/>
{% if respuesta[pregunta3.alias] is defined%}
{% set respuestasrange2=respuesta[pregunta3.alias]|json_decode%}
{% endif %}
<td>
<input id="{{ pregunta3.alias }}-0" name="{{ pregunta3.alias }}[]" type="text" class="slider form-control" {{ pregunta3.TipoPreguntaOptions|raw }} style="display: none;"/></td>
<td><button type="button" class="btn btn-warning delete-row" onclick="$(this).parents('tr').remove();">Delete Row</button></td>
</tr>
{% endif %}
</tbody>
</table>
<button type="button" class="btn btn-info add-row" onclick="addRow($(this).prev())">Add Row</button>
{% endif %}