{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_widgets creme_bricks %} {% load and_op has_perm_to in url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} opportunities-quotes-brick{% endblock %} {% block brick_script %} {% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Proposed quote') plural=_('{count} Proposed quotes') empty=_('Proposed quotes') icon='invoice' %} {% endblock %} {% block brick_header_actions %} {% has_perm_to link object as link_perm %}{% has_perm_to create objects_ctype as create_perm %} {% url 'opportunities__generate_billing_doc' object.id objects_ctype.id as create_url %} {% brick_header_action id='update' url=create_url type='add' label=_('Generate a current quote') enabled=link_perm|and_op:create_perm %} {% brick_header_action id='add-relationships' icon='link' label=_('Link to a quote') enabled=link_perm __selector_url='opportunities__select_billing_objs_to_link'|url __subject_id=object.id __rtype_id=predicate_id __ctype_id=objects_ctype.id __multiple=True %} {% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='number' status='primary' %} {% brick_table_column_for_field ctype=objects_ctype field='name' status='nowrap' %} {% brick_table_column_for_field ctype=objects_ctype field='status' %} {% brick_table_column title=_('Current quote?') status='nowrap' %} {% brick_table_column title=_('Unlink') status='action' %} {% endblock %} {% block brick_table_rows %} {% with current_quote_ids=object.get_current_quote_ids %} {% has_perm_to link object as link_perm %}{% has_perm_to unlink object as unlink_perm %} {% url 'creme_core__delete_similar_relations' as delete_relation_url %} {% for quote in page.object_list %} {% with quote_is_current=quote.id|in:current_quote_ids %}