{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks %} {% load has_perm_to url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} emails-sendings-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Sending') plural=_('{count} Sendings') empty=verbose_name icon='email' %} {% endblock %} {% block brick_header_actions %} {% has_perm_to change object as edit_perm %} {% brick_header_action id='add' url='emails__create_sending'|url:object.id label=_('New sending') enabled=edit_perm %} {% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='sending_date' status='primary' %} {% brick_table_column title=_('Type') %} {% brick_table_column title=_('State') %} {% brick_table_column title=_('Number of email(s)') %} {% brick_table_column title=_('Actions') status='action' colspan=2 %} {% endblock %} {% block brick_table_rows %} {% has_perm_to change object as edit_perm %}{% url 'creme_core__delete_related_to_entity' objects_ctype.id as delete_sending_url %} {% for sending in page.object_list %} {{sending.sending_date}} {{sending.get_type_display}} {{sending.get_state_display}} {{sending.mails_set.count}}{% with unsent_count=sending.unsent_mails.count %}{% if unsent_count %} / {% blocktranslate count count=unsent_count %}{{count}} not sent{% plural %}{{count}} not sent{% endblocktranslate %}{% endif %}{% endwith %} {% brick_table_action id='redirect' url=sending.get_absolute_url icon='view' label=_('Details') %} {% brick_table_action id='delete' url=delete_sending_url __id=sending.pk label=_('Delete this sending') enabled=edit_perm %} {% endfor %} {% endblock %} {% block brick_table_empty %} {% translate 'No sending for the moment' %} {% endblock %}