adding dev tools links to admin navigation

This commit is contained in:
Alan Roberts 2024-08-09 16:30:01 -04:00
parent 00daa365a4
commit 924ca0b6a7
4 changed files with 9 additions and 1 deletions

View file

@ -33,10 +33,11 @@ from app.admin import bp
@login_required
@permission_required('change instance settings')
def admin_home():
current_mode = current_app.config['MODE']
return render_template('admin/home.html', title=_('Admin'), moderating_communities=moderating_communities(current_user.get_id()),
joined_communities=joined_communities(current_user.get_id()),
menu_topics=menu_topics(),
site=g.site)
site=g.site, current_mode=current_mode)
@bp.route('/site', methods=['GET', 'POST'])

View file

@ -15,4 +15,7 @@
<a href="{{ url_for('admin.newsletter') }}">{{ _('Newsletter') }}</a> |
<a href="{{ url_for('admin.admin_permissions') }}">{{ _('Permissions') }}</a> |
<a href="{{ url_for('admin.admin_activities') }}">{{ _('Activities') }}</a>
{% if current_mode == 'development' %}
| <a href="{{ url_for('dev.tools') }}">{{ _('Dev Tools') }}</a>
{% endif%}
</nav>

View file

@ -213,6 +213,9 @@
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_newsletter' }}" href="{{ url_for('admin.newsletter') }}">{{ _('Newsletter') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_activities' }}" href="{{ url_for('admin.admin_activities') }}">{{ _('Activities') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_permissions' }}" href="{{ url_for('admin.admin_permissions') }}">{{ _('Permissions') }}</a></li>
{% if current_mode == 'development' %}
<li><a class="dropdown-item{{ ' active' if active_child == 'dev_tools' }}" href="{{ url_for('dev.tools') }}">{{ _('Dev Tools') }}</a></li>
{% endif %}
</ul>
</li>
{% endif %}

View file

@ -4,6 +4,7 @@
{% extends "base.html" %}
{% endif %} %}
{% from 'bootstrap/form.html' import render_form %}
{% set active_child = 'dev_tools' %}
{% block app_content %}
<div class="row">