{% twig_js name = 'CompetencyRow' %} {# renders the path of a competency/ability as a nested list #} {% macro renderSteps(steps, index, max) %} {% endmacro %} {# renders a competency/ability path along with its level #} {% macro renderPath(path) %} {{ path.level }} {{ _self.renderSteps(path.steps, 0, path.steps|length) }} {% endmacro %} {# using "_self" produces an error with twig.js... #} {% import 'HeVinciCompetencyBundle:Activity:competencyRow.html.twig' as util %} {% set pathCount = target.paths|length %} {{ target.name }} {# handle client side translation for dynamically added rows #} {% if target.translatedType is defined %} {{ target.translatedType }} {% else %} {{ target.type|trans({}, 'competency') }} {% endif %} {{ util.renderPath(target.paths[0]) }} {% if isEditMode is defined and isEditMode %} {% endif %} {% if pathCount > 1 %} {% for i in 1..pathCount - 1 %} {{ util.renderPath(target.paths[i]) }} {% endfor %} {% endif %}