{% extends "package/edit_base.html" %} {% block subtitle -%} {{- ui.subtitle_item(_('Edit Collaborator') if user else _('Add Collaborator')) }} {{- super() }} {%- endblock %} {%- block content_action -%} {{ ui.content_action(_('Back to all collaborators'), href=h.url_for('dataset.collaborators_read', id=pkg_dict.name), style="secondary", icon="arrow-left") }} {{ super() }} {%- endblock %} {% block primary_content_inner %}

{% block page_heading %}{{ _('Edit Collaborator') if user else _('Add Collaborator') }}{% endblock %}

{% block form %} {%- call ui.util.call(ui.form, method="POST") -%}
{% if not user %}

{{ _('If you wish to add an existing user, search for their username below.') }}

{% endif %}
{% if user %} {% else %} {% endif %}
{{ ui.select(name='capacity', label=_('Role'), options=capacities, selected=user_capacity) }} {%- call ui.util.call(ui.form_actions) -%} {% if user %} {{ ui.button(_('Delete'), href=h.url_for('dataset.collaborator_delete', id=pkg_dict.id, user_id=user.name), style="danger", data={"module": "confirm-action", "module-content": _('Are you sure you want to delete this collaborator?')}) }} {{ ui.button(_('Update Collaborator'), type="submit", attrs={"name": "submit"}) }} {% else %} {{ ui.button(_('Add Collaborator'), type="submit", attrs={"name": "submit"}) }} {% endif %} {%- endcall %} {%- endcall %} {% endblock %} {% endblock %} {% block secondary_content %} {{ super() }} {%- call ui.util.call(ui.sidebar_section, icon="info-circle", title=_('What are the available roles?')) -%} {% if h.check_config_permission('allow_admin_collaborators') %} {% trans %}

Admin: In addition to managing the dataset, admins can add and remove collaborators from a dataset.

{% endtrans %} {% endif %} {% trans %}

Editor: Editors can edit the dataset and its resources, as well accessing the dataset if private.

Member: Members can access the dataset if private, but not edit it.

{% endtrans %} {%- endcall %} {% endblock %}