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.
58 lines
5.7 KiB
58 lines
5.7 KiB
<div class="form-row {{ pregunta.alias }} {{ pregunta.class }}">
|
|
<div class="form-holder">
|
|
{% if casoestudio is defined and casoestudio is not empty %}
|
|
{% if respuestaca[pregunta.alias] is defined %}
|
|
<a class="btn btn-primary btn-sm casoestudiobtn" data-toggle="collapse" data-target="#casoestudio{{ pregunta.id }}">{{ 'Caso de estudio'|trans({}) }}</a>
|
|
<div id="casoestudio{{ pregunta.id }}" class="collapse casoestudiodiv">
|
|
<pre>{{ respuestaca[pregunta.alias]|raw }}</pre>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if pregunta.preTitulo is not empty %}
|
|
<div class="{{ tarea[0].getProcesosId.alias }}_pretitulo">{{ pregunta.preTitulo|trans({})|raw }}</div>
|
|
{% endif %}
|
|
{% set options = pregunta.TipoPreguntaOptions|split(',') %}
|
|
{% for option in options %}
|
|
{% set currentoption=loop.index %}
|
|
<div class="switch switch-blue">
|
|
<span>{{ option }}</span>
|
|
<label for="{{ pregunta.alias }}">
|
|
{% if respuestas is empty %}
|
|
<input type="hidden" id="{{ pregunta.alias ~ currentoption}}" name="{{ pregunta.alias }}[]" value="off" checked/>
|
|
<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>
|
|
<label for="{{ pregunta.alias ~ currentoption }}-off" class="switch-label switch-label-off">OFF</label>
|
|
<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" >
|
|
<label for="{{ pregunta.alias ~ currentoption}}-on" class="switch-label switch-label-on">ON</label>
|
|
<span class="switch-selection"></span>
|
|
{% else %}
|
|
{% set encontrada = false %}
|
|
{% for respuesta in respuestas %}
|
|
{% if respuesta.preguntas.id == pregunta.id %}
|
|
{% set encontrada=true %}
|
|
<input type="hidden" id="{{ pregunta.alias ~ currentoption}}" name="{{ pregunta.alias }}[]" value="{{ respuesta.valor|json_decode[currentoption]}}"/>
|
|
|
|
<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 %}>
|
|
<label for="{{ pregunta.alias }}-off" class="switch-label switch-label-off">OFF</label>
|
|
<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 %}>
|
|
<label for="{{ pregunta.alias ~ currentoption }}-on" class="switch-label switch-label-on">ON</label>
|
|
<span class="switch-selection"></span>
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if not encontrada %}
|
|
<input type="hidden" id="{{ pregunta.alias ~ currentoption}}" name="{{ pregunta.alias }}[]" value="off" checked/>
|
|
<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>
|
|
<label for="{{ pregunta.alias ~ currentoption }}-off" class="switch-label switch-label-off">OFF</label>
|
|
<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" >
|
|
<label for="{{ pregunta.alias ~ currentoption}}-on" class="switch-label switch-label-on">ON</label>
|
|
<span class="switch-selection"></span>
|
|
{% endif %}
|
|
{% endif %}
|
|
<span class="control-label__text">{{ pregunta.nombre|trans({})|raw }}</span></label>
|
|
{% if pregunta.descripcion is not empty %}
|
|
<div class="{{ tarea[0].getProcesosId.alias }}_descripcion">{{ pregunta.descripcion|trans({})|raw }}</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|