mpeltriaux
8f40162974
* writes test for sharing using the API * fixes bug on frontend form where an exception occured on generating a new API token if no token existed, yet * adds permission constraint (default group) for using the api in general * fixes default-group-only behaviour for sharing-API, so users can only add new users and not removing them, as long as they do not have any other group membership like registration or conservation office * changes 'ksptoken' to 'Ksptoken' to match CGI standard for http header keys
33 lines
1.3 KiB
HTML
33 lines
1.3 KiB
HTML
{% extends 'base.html' %}
|
|
{% load i18n fontawesome_5 %}
|
|
|
|
{% block body %}
|
|
<div class="container">
|
|
<h3>{% trans 'API settings' %}</h3>
|
|
<div class="table-container">
|
|
<table class="table table-hover">
|
|
<tr>
|
|
<th scope="row">{% trans 'Current token' %}</th>
|
|
<td>{{ user.api_token.token }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">{% trans 'Authenticated by admins' %}</th>
|
|
{% if user.api_token is None %}
|
|
<td></td>
|
|
{% elif user.api_token.is_active %}
|
|
<td class="text-success" title="{% trans 'Token has been verified and can be used' %}">{% fa5_icon 'check-circle' %}</td>
|
|
{% else %}
|
|
<td class="text-primary" title="{% trans 'Token waiting for verification' %}">{% fa5_icon 'hourglass-half' %}</td>
|
|
{% endif %}
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">{% trans 'Valid until' %}</th>
|
|
<td>{{ user.api_token.valid_until|default_if_none:"-" }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
{% include 'form/table/generic_table_form.html' %}
|
|
|
|
{% endblock %} |