{% extends 'creme_core/bricks/base/paginated-table.html' %} {% load i18n creme_bricks creme_widgets %} {% load uca_sort url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} creme_config-roles-brick{% endblock %} {% block brick_header_title %} {% brick_header_title title=_('{count} Role') plural=_('{count} Roles') empty=verbose_name icon='contact' %} {% endblock %} {% block brick_header_actions %} {% brick_header_action id='add' url='creme_config__create_role'|url label=_('New role') enabled=user.is_superuser %} {% endblock %} {% block brick_table_columns %} {% brick_table_column_for_field ctype=objects_ctype field='name' status='primary nowrap' class='role-name' %} {% brick_table_column title=_('Allowed applications') status='nowrap' class='role-apps' %} {% brick_table_column title=_('Administrated applications') status='nowrap' class='role-admin-apps' %} {% brick_table_column title=_('Creation credentials') status='nowrap' class='role-creation-creds' %} {% brick_table_column title=_('Export credentials') status='nowrap' class='role-export-creds' %} {% brick_table_column title=_('Entities credentials') status='nowrap' class='role-creds' %} {% brick_table_column title=_('Actions') status='action' colspan=3 %} {% endblock %} {% block brick_table_rows %} {% with admin_perm=user.is_superuser %}{% url 'creme_config__remove_role_credentials' as rm_creds_url %} {% for role in page.object_list %} {{role.name}} {% widget_enumerator role.get_allowed_apps_verbose threshold=2 summary=_('{count} applications') empty=_('No allowed application') %} {% widget_enumerator role.get_admin_4_apps_verbose threshold=2 summary=_('{count} applications') empty=_('No administrated application') %} {% widget_enumerator role.creatable_ctypes.all|uca_sort threshold=2 summary=_('{count} types of entity') empty=_('No creation credential') %} {% widget_enumerator role.exportable_ctypes.all|uca_sort threshold=2 summary=_('{count} types of entity') empty=_('No export credential') %} {% brick_action id='edit' url='creme_config__add_credentials_to_role'|url:role.id icon='add' label=_('New credentials') display='both' enabled=admin_perm %} {% brick_table_action id='edit' url='creme_config__edit_role'|url:role.id label=_('Edit this role') enabled=admin_perm %} {% brick_table_action id='edit' url='creme_config__delete_role'|url:role.id label=_('Delete') icon='delete' enabled=admin_perm %} {% brick_table_action id='add' url='creme_config__clone_role'|url:role.id label=_('Clone this role') icon='clone' enabled=admin_perm %} {% endfor %} {% endwith %} {% endblock %} {% block brick_table_empty %} {% translate 'No role for the moment' %} {% endblock %}