{% twig_js name = 'ObjectiveRow' %} {% set type = type is defined ? type : 'objective' %} {% set framework = framework is defined ? framework : '-' %} {% set level = level is defined ? level : '-' %} {% set indent = indent is defined ? indent : 0 %} {% set collapsed = collapsed is defined ? collapsed : false %} {% set isLoaded = isLoaded is defined ? isLoaded : true %} {% set path = path is defined ? path : '' %} {% set childrenPath = path == '' ? id : path ~ '-' ~ id %} {% set hasCompetencies = hasCompetencies is defined ? hasCompetencies : (__children is defined and __children|length > 0) %} {% set hasAbilities = __abilities is defined and __abilities|length > 0 %} {% set hasChildren = hasCompetencies or hasAbilities %}
{% if hasCompetencies and __children is defined %} {% for competency in __children %} {% include 'HeVinciCompetencyBundle:Objective:objectiveRow.html.twig' with { id: competency.id, name: competency.name, path: childrenPath, framework: '-', level: '-', type: 'competency', indent: indent + 1, collapsed: true, hasCompetencies: competency.__children is defined and competency.__children|length > 0, __children: competency.__children is defined ? competency.__children : [], __abilities: competency.__abilities is defined ? competency.__abilities : [] } %} {% endfor %} {% endif %} {% if hasAbilities %} {% for ability in __abilities %} {% include 'HeVinciCompetencyBundle:Objective:objectiveRow.html.twig' with { id: ability.id, name: ability.name, path: childrenPath, framework: '-', level: ability.levelName, type: 'ability', indent: indent + 1, collapsed: true, hasCompetencies: false, __children: [], __abilities: [] } %} {% endfor %} {% endif %}