{% comment %} Overrides django-oauth-toolkit's default consent screen. Template resolution is by INSTALLED_APPS order, so `terno_dbi.oauth` must appear *before* `oauth2_provider` or DOT's own template wins and this file is silently ignored. Three things this says that the default does not: 1. **Which organisation** the grant is for, and a picker when there is more than one. Each organisation has its own databases and permissions, so this is a real decision, not a formality. 2. **Read versus write**, separated. "Change table descriptions" and "run queries" should not read as one undifferentiated list. 3. **When write will be withheld.** A non-admin's write scopes are stripped at mint time regardless of what they click. Saying so here is more honest than letting them approve something that will not happen. {% endcomment %} {% load i18n %} {% blocktrans with app=application.name %}Connect {{ app }}{% endblocktrans %} — Terno
{% if not error %} {% comment %} Name and subdomain are identical on auto-provisioned orgs, and the model's __str__ renders "name - subdomain" — so {{ organisation }} shows "fugj - fugj". Use the name alone. NB: {# ... #} is single-line only. A multi-line one is not a comment at all — Django renders it verbatim, which is how a developer note ended up on the live consent screen. Use {% comment %} for anything that wraps. {% endcomment %} {% with org_name=organisation.name|default:organisation.subdomain app_name=application.name|default:_("this application") %}

{% blocktrans %}Connect {{ app_name }} to Terno?{% endblocktrans %}

{% trans "It will be able to act on your behalf using the access below." %}

{% csrf_token %} {% for field in form %}{% if field.is_hidden %}{{ field }}{% endif %}{% endfor %} {% if organisation_choices %}

{% trans "Each organisation has its own databases. To use another one later, add Terno a second time and pick it there." %}

{% elif organisation %}
{% trans "Organisation" %} {{ org_name }}
{% endif %} {% if read_scopes %}

{% trans "Read access" %}

{% endif %} {% if write_scopes %}

{% trans "Write access" %}

{% endif %} {% if write_scopes and not user_can_write %}

{% blocktrans %}Write access was requested, but you are not an administrator of {{ org_name }}. If you continue, the connection will be read-only.{% endblocktrans %} {% trans "An administrator can grant write access in Terno." %}

{% endif %} {% if form.errors or form.non_field_errors %}
{{ form.errors }}{{ form.non_field_errors }}
{% endif %}

{% trans "You can disconnect at any time from your Terno account settings." %}

{% endwith %} {% else %}

{% trans "Something went wrong" %}

{{ error.error }}

{{ error.description }}

{% trans "Close this window and try connecting again from the app." %}

{% endif %}