{% extends 'creme_core/bricks/base/base.html' %} {% load i18n creme_bricks creme_perms creme_widgets %} {% load url from creme_core_tags %} {% block brick_extra_class %}billing-lines-brick{% endblock %} {% block brick_extra_attributes %} data-type-currency="{{object.currency.local_symbol}}" data-type-global-discount="{{object.discount}}" {% endblock %} {% block brick_header_actions %} {% with edit_perm=user|has_perm_to_change:object %} {% brick_header_action id='billing-line-saveall' url='billing__multi_save_lines'|url:object.id label=_('Save all lines') icon='ok' enabled=edit_perm loading=_('Saving…') %} {% brick_header_action id='billing-line-addonfly' __ctype_id=ct_id __prefix=formset.prefix __count=item_count label=_('Add a line on the fly') type='add' enabled=edit_perm %} {% block brick_line_header_actions %}{% endblock %} {% endwith %} {% endblock %} {% block brick_content %} {% with edit_perm=user|has_perm_to_change:object %} {% widget_icon name='reorder' as reorder_icon %} {% translate 'Reset' context 'billing-lines' as reset_label %}
{% csrf_token %} {{formset.management_form}} {% for form in formset %}
{% include line_edit_form_template %}
{{reorder_icon.render}}
{% empty %}
{% block empty_msg %}EMPTY{% endblock %}
{% endfor %} {% if formset %}
{% with formset.empty_form as form %}
{{form.user}} {{form.DELETE}} {{form.cremeentity_ptr}}
{% brick_action id='billing-line-clearonfly' __ctype_id=ct_id __prefix=formset.prefix __count=item_count type='delete' label=_('Flag for delete') icon_size='small' enabled=edit_perm %}
{% include 'billing/bricks/frags/line-fields.html' %}
{% endwith %} {% endif %}
{% endwith %} {% endblock %}