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.

55 lines
3.8 KiB

5 years ago
  1. <div class="form-row {{ pregunta.alias }} {{ pregunta.class }}">
  2. <div class="form-holder">
  3. {% if pregunta.preTitulo is not empty %}
  4. <div class="{{ tarea[0].getProcesosId.alias }}_pretitulo">{{ pregunta.preTitulo|trans({})|raw }}</div>
  5. {% endif %}
  6. <label for="{{ pregunta.alias }}" class="{{ tarea[0].getProcesosId.alias }}_nombre">{{ pregunta.nombre|trans({})|raw }}</label>
  7. {% if pregunta.descripcion is not empty %}
  8. <div class="{{ tarea[0].getProcesosId.alias }}_descripcion">{{ pregunta.descripcion|trans({})|raw }}</div>
  9. {% else %}
  10. <div class="{{ tarea[0].getProcesosId.alias }}_descripcion no-contenido">{{ pregunta.descripcion|trans({})|raw }}</div>
  11. {% endif %}
  12. {% if casoestudio is defined and casoestudio is not empty %}
  13. {% if respuestaca[pregunta.alias] is defined %}
  14. <a class="btn btn-primary btn-sm casoestudiobtn" data-toggle="collapse" data-target="#casoestudio{{ pregunta.id }}">{{ 'Caso de estudio'|trans({}) }}</a>
  15. <div id="casoestudio{{ pregunta.id }}" class="collapse casoestudiodiv">
  16. <pre>{{ respuestaca[pregunta.alias]|raw }}</pre>
  17. </div>
  18. {% endif %}
  19. {% endif %}
  20. {% if respuestas is empty %}
  21. <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>
  22. {% else %}
  23. {% set encontrada = false %}
  24. {% if respuesta[pregunta.alias] is defined %}
  25. {% set encontrada=true %}
  26. <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>
  27. {% endif %}
  28. {% if not encontrada %}
  29. <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>
  30. {% endif %}
  31. {% endif %}
  32. </div>
  33. <script>
  34. $('.elfinder_button').on('click',function(event) {
  35. $('#current').val($(this).prev('input').attr('id'));
  36. event.preventDefault();
  37. $('<div id="editor" />').dialogelfinder({
  38. url: '{{ path('ef_connect', { 'instance': 'default', 'homeFolder': app.user.id } ) }}',
  39. lang: '{{ app.request.attributes.get('_locale') }}',
  40. commandsOptions: {
  41. quicklook: {
  42. googleDocsMimes: ['image/png', 'image/tiff', 'image/jpg']
  43. }
  44. },
  45. getFileCallback: function(file) {
  46. $('#editor').dialogelfinder('close');
  47. $('#editor').closest('.elfinder').val(file.path);
  48. console.log(file.url);
  49. var x=$('#current').val()
  50. $('#'+x).val(file.url);
  51. }
  52. }).elfinder('instance');
  53. });
  54. </script>
  55. </div>