{% extends "package/edit_base.html" %} {% block subtitle -%} {{ ui.subtitle_item(_('Collaborators')) }} {{- super() }} {%- endblock %} {% block content_action -%} {{ ui.content_action(_('Add Collaborators'), href=h.url_for('dataset.new_collaborator', id=pkg_dict.name), icon='plus-square') if h.check_access('package_collaborator_create', {'id': pkg_dict.id}) }} {{ super() }} {%- endblock %} {% block primary_content_inner %} {% set collaborators = h.get_collaborators(pkg_dict['id'])%} {% set count = collaborators|length %} {% set collaborators_count = ungettext('{count} collaborator', '{count} collaborators', count).format(count=count) %}

{{ collaborators_count }}

{%- call ui.util.call(ui.table, hover=true, bordered=true) -%} {{ _('User') }} {{ _('Role') }} {% for user_id, capacity in collaborators %} {{ h.linked_user(user_id, maxlength=20) }} {{ capacity }} {%- set modal_id = ui.util.id() -%} {%- call ui.util.call(ui.button_group) -%} {{ ui.button(ui.tooltip(ui.icon("wrench"), tooltip=_('Edit role')), style="secondary", size="sm", href=h.url_for('dataset.new_collaborator', id=pkg_dict.name, user_id=user_id), aria={"label": _('Edit role')}) }} {{ ui.modal_handle(ui.tooltip(ui.icon("times"), tooltip=_('Delete collaborator')), style="danger", size="sm", id=modal_id, aria={"description": _('Delete this collaborator from the dataset'), "label": _('Delete collaborator')}) }} {%- endcall %} {{ ui.confirm_modal(_('Are you sure you want to delete this collaborator?'), id=modal_id, href=h.url_for('dataset.collaborator_delete', id=pkg_dict.name, user_id=user_id)) }} {% endfor %} {%- endcall %} {% endblock %}