master
Aevann1 2022-01-14 02:14:55 +02:00
parent c2e5fd44dd
commit 66372d8a95
2 changed files with 7 additions and 7 deletions

View File

@ -36,12 +36,7 @@ def terms(v):
@app.get('/sidebar')
@auth_required
def sidebar(v):
if not path.exists(f'files/templates/sidebar_{site_name}.html'): abort(404)
with open(f'files/templates/sidebar_{site_name}.html', 'r') as f: sidebar = f.read()
return render_template('sidebar.html', sidebar=sidebar, v=v)
return render_template('sidebar.html', v=v)
@app.get("/stats")

View File

@ -14,7 +14,12 @@
<h1 class="text-muted text-uppercase">{{'SITE_NAME'|app_config}} Sidebar{% if v and v.admin_level > 2 %} <a href="/admin/sidebar" class="btn btn-link text-lowercase"><i class="far fa-fw fa-pencil"></i> Edit sidebar</a>{% endif %}</h5>
<div id="sidebar" class="my-3">
{{ sidebar | safe }}
{% include "sidebar_" + SITE_NAME + ".html" %}
</div>
</div>
<style>
.sidebar {
display:block!important;
}
</style>
{% endblock %}