get_user_items.tpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {% extends app.template_style ~ "/layout/layout_1_col.tpl" %}
  2. {% macro widget_prototype(widget, remove_text) %}
  3. {% if widget.get('prototype') %}
  4. {% set form = widget.get('prototype') %}
  5. {% set name = widget.get('prototype').get('description') %}
  6. {% else %}
  7. {% set form = widget %}
  8. {% set name = widget.get('full_name') %}
  9. {% endif %}
  10. <div data-content="{{ name }}">
  11. {{ form_widget(form) }}
  12. </div>
  13. {% endmacro %}
  14. {% block content %}
  15. <script>
  16. $(function() {
  17. });
  18. </script>
  19. <div class="row">
  20. <div class="span10">
  21. <h2>Trayectoria</h2>
  22. <p>Explicaciones</p>
  23. <p>Las respuestas a este formulario son de carácter jurado.</p>
  24. <div id="list" class="trajectory">
  25. {% for subcategory in categories %}
  26. {% if subcategory.lvl == 0 %}
  27. {# <h3> {{ subcategory.title }} </h3>
  28. <hr /> #}
  29. {% else %}
  30. <h4>
  31. {{ subcategory.title }}
  32. {% if category_score[subcategory.id] %}
  33. <div class="label label-success">{{ category_score[subcategory.id] }}</div>
  34. {% endif %}
  35. </h4>
  36. {% endif %}
  37. {% for item in subcategory.items %}
  38. {# Items #}
  39. {{ item.title }} (item) - {{ 'CurriculumMaximumItem' | trans }} {{ item.maxRepeat }}
  40. <div class="row">
  41. {{ form_start(form_list[item.id]) }}
  42. <div id="items_{{ item.id }}" class="items span8" data-max="{{ item.maxRepeat }}" data-prototype="{{ form_widget(form_list[item.id].userItems.vars.prototype)|e }}" >
  43. {% for widget in form_list[item.id].userItems.children %}
  44. {{ _self.widget_prototype(widget, 'Remove item') }}
  45. {% endfor %}
  46. <ul>
  47. </ul>
  48. </div>
  49. {{ form_end(form_list[item.id]) }}
  50. </div>
  51. {% endfor %}
  52. {% endfor %}
  53. </div>
  54. </div>
  55. </div>
  56. {% endblock %}