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.
56 lines
3.8 KiB
56 lines
3.8 KiB
<div class="form-row {{ pregunta.alias }} {{ pregunta.class }}">
|
|
<div class="form-holder">
|
|
{% if pregunta.preTitulo is not empty %}
|
|
<div class="{{ tarea[0].getProcesosId.alias }}_pretitulo">{{ pregunta.preTitulo|trans({})|raw }}</div>
|
|
{% endif %}
|
|
<label for="{{ pregunta.alias }}" class="{{ tarea[0].getProcesosId.alias }}_nombre">{{ pregunta.nombre|trans({})|raw }}</label>
|
|
{% if pregunta.descripcion is not empty %}
|
|
<div class="{{ tarea[0].getProcesosId.alias }}_descripcion">{{ pregunta.descripcion|trans({})|raw }}</div>
|
|
{% else %}
|
|
<div class="{{ tarea[0].getProcesosId.alias }}_descripcion no-contenido">{{ pregunta.descripcion|trans({})|raw }}</div>
|
|
{% endif %}
|
|
{% 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 respuestas is empty %}
|
|
<input type="text" class="form-control" id="{{ pregunta.alias }}" name="{{ pregunta.alias }}" placeholder="{{ pregunta.placeholder|trans({}) }}" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}{% if pregunta.isRequired %} required {% endif %}><span id="elfinder_button" class="btn btn-primary elfinder_button" >{{ 'Search'|trans({}) }}</span>
|
|
{% else %}
|
|
{% set encontrada = false %}
|
|
{% if respuesta[pregunta.alias] is defined %}
|
|
{% set encontrada=true %}
|
|
<input type="text" class="form-control" id="{{ pregunta.alias }}" name="{{ pregunta.alias }}" placeholder="{{ pregunta.placeholder|trans({}) }}" value="{{ respuesta[pregunta.alias] }}" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}{% if pregunta.isRequired %} required {% endif %}><span id="elfinder_button" class="btn btn-primary elfinder_button" >{{ 'Search'|trans({}) }}</span>
|
|
{% endif %}
|
|
{% if not encontrada %}
|
|
<input type="text" class="form-control" id="{{ pregunta.alias }}" name="{{ pregunta.alias }}" placeholder="{{ pregunta.placeholder|trans({}) }}" {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}{% if pregunta.isRequired %} required {% endif %}><span id="elfinder_button" class="btn btn-primary elfinder_button" >{{ 'Search'|trans({}) }}</span>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
<script>
|
|
$('.elfinder_button').on('click',function(event) {
|
|
$('#current').val($(this).prev('input').attr('id'));
|
|
|
|
event.preventDefault();
|
|
$('<div id="editor" />').dialogelfinder({
|
|
url: '{{ path('ef_connect', { 'instance': 'default', 'homeFolder': app.user.id } ) }}',
|
|
lang: '{{ app.request.attributes.get('_locale') }}',
|
|
commandsOptions: {
|
|
quicklook: {
|
|
googleDocsMimes: ['image/png', 'image/tiff', 'image/jpg']
|
|
}
|
|
},
|
|
getFileCallback: function(file) {
|
|
$('#editor').dialogelfinder('close');
|
|
$('#editor').closest('.elfinder').val(file.path);
|
|
console.log(file.url);
|
|
var x=$('#current').val()
|
|
$('#'+x).val(file.url);
|
|
}
|
|
}).elfinder('instance');
|
|
});
|
|
</script>
|
|
</div>
|