{% extends "package/edit_base.html" %} {% block subtitle -%} {{ ui.subtitle_item(_('Collaborators')) }} {{- super() }} {%- endblock %} {%- block breadcrumb_content -%} {{ super() }} {{ ui.breadcrumb(_('Collaborators'), href=h.url_for(pkg.type ~ '.collaborators_read', id=pkg.name), active=true) }} {%- endblock %} {% block content_action -%} {{ ui.content_action(_('Add Collaborators'), href=h.url_for('dataset.new_collaborator', id=pkg_dict.name), icon='plus') 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'])%} {%- call ui.util.call(ui.section, title=_("Collaborators")) -%} {%- call ui.util.call(ui.table, striped=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(_("Edit role"), style="secondary", size="sm", href=h.url_for('dataset.new_collaborator', id=pkg_dict.name, user_id=user_id)) }} {{ ui.modal_handle(_('Delete'), style="danger", size="sm", id=modal_id, aria={"description": _('Delete this collaborator from the dataset')}) }} {%- 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 %} {%- endcall %} {% endblock %}