Add api and administration links to navigations

This commit is contained in:
Patrick Jentsch 2024-12-06 10:14:45 +01:00
parent 713a7645db
commit 1372c86609
2 changed files with 29 additions and 8 deletions

View File

@ -56,5 +56,24 @@
Log out
</a>
</li>
{% if current_user.can('USE_API') or current_user.is_administrator %}
<li class="divider" tabindex="-1"></li>
{% endif %}
{% if current_user.can('USE_API') %}
<li>
<a href="{{ url_for('apifairy.docs') }}">
<i class="material-icons left">api</i>
API
</a>
</li>
{% endif %}
{% if current_user.is_administrator %}
<li {% if request.path == url_for('admin.admin') %}class="active"{% endif %}>
<a href="{{ url_for('admin.admin') }}">
<i class="material-icons left">admin_panel_settings</i>
Administration
</a>
</li>
{% endif %}
</ul>
{% endif %}

View File

@ -105,19 +105,21 @@
</li>
{% endif %}
{% if current_user.is_authenticated and current_user.can('ADMINISTRATE') %}
{# administration section #}
{% if current_user.can('USE_API') or current_user.is_administrator %}
<li><div class="divider"></div></li>
<li><a class="subheader">Administration</a></li>
{% endif %}
{# corpora #}
{% if current_user.can('USE_API') %}
{# API #}
<li>
<a class="waves-effect" href="{{ url_for('admin.corpora') }}"><i class="nopaque-icons">I</i>Corpora</a>
<a class="waves-effect" href="{{ url_for('apifairy.docs') }}"><i class="material-icons">api</i>API</a>
</li>
{% endif %}
{# users #}
<li>
<a class="waves-effect" href="{{ url_for('admin.users') }}"><i class="material-icons">manage_accounts</i>Users</a>
{% if current_user.is_administrator %}
{# Administration #}
<li {% if request.path == url_for('admin.admin') %}class="active"{% endif %}>
<a class="waves-effect" href="{{ url_for('admin.admin') }}"><i class="material-icons">admin_panel_settings</i>Administration</a>
</li>
{% endif %}
</ul>