{% extends 'creme_core/bricks/base/table.html' %} {% load i18n creme_bricks creme_ctype %} {% load has_perm_to mult url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} commercial-components-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Objective') plural=_('{count} Objectives') empty=_('Objectives') count=components|length %} {% endblock %} {% block brick_header_actions %} {% has_perm_to change object as has_perm %} {% brick_header_action id='add' url='commercial__create_component'|url:object.id label=_('New objective') enabled=has_perm %} {% endblock %} {% block brick_content %} {% has_perm_to change object as has_perm %} {% if components %} {# {% url 'creme_core__delete_related_to_entity' ct_id as delete_url %} #} {% ctype_for_model components.0 as comp_ctype %}{% url 'creme_core__delete_related_to_entity' comp_ctype.id as delete_url %} {% for component in components %} {% endfor %} {% else %} {% endif %}
{% if component.deep > 0 %}  ➘ {{component}} {% else %} {{component}} {% endif %} {% translate "Success rate" %} : {{component.success_rate}}% {% if component.ctype %} ({{component.ctype}}{% if component.filter %} / {{component.filter}}{% endif %}) {% endif %} {% brick_table_action id='add' url='commercial__create_child_component'|url:component.id label=_('New sub-objective') enabled=has_perm %} {% brick_table_action id='add' url='commercial__create_parent_component'|url:component.id label=_('New parent objective') enabled=has_perm %} {% brick_table_action id='delete' url=delete_url __id=component.id enabled=has_perm %}
{% translate 'No objective for the moment' %}
{% endblock %}