{% import 'macro/accordion.html' as accordion %} {{ accordion.header('Database', 'database', 'admin', expanded=open_database, icon='database-2-line') }} <h5 class="border-bottom">Status</h5> {% if database_exception %}<div class="alert alert-danger" role="alert">An exception occured while loading this page: {{ database_exception }}</div>{% endif %} {% if database_error %}<div class="alert alert-danger" role="alert"><strong>Error:</strong> {{ database_error }}.</div>{% endif %} {% if database_needs_upgrade %} <div class="alert alert-warning" role="alert"> <p>Your database needs to be upgraded.</p> <hr> <div class="text-end"> <a href="{{ url_for('admin.upgrade_database') }}" class="btn btn-warning" role="button"><i class="ri-arrow-up-double-line"></i> Upgrade the database</a> </div> </div> {% endif %} <p>The database file is: <code>{{ config['DATABASE_PATH'] }}</code> at version <span class="badge rounded-pill text-bg-light border fw-normal"><i class="ri-hashtag"></i>{{ database_version }}</span></p> <p> <a href="{{ url_for('admin.download_database') }}" class="btn btn-primary" role="button"><i class="ri-download-line"></i> Download the database file</a> </p> {% if database_counters %} <h5 class="border-bottom">Records</h5> <div class="d-flex justify-content-start"> <ul class="list-group me-2"> {% for counter in database_counters %} {% if not (loop.index % 5) %} </ul> <ul class="list-group"> {% endif %} <li class="list-group-item d-flex justify-content-between align-items-start"> <span><i class="ri-{{ counter.icon }}"></i> {{ counter.name }}</span> <span class="badge text-bg-primary rounded-pill ms-2">{{ counter.count }}</span> </li> {% endfor %} </ul> </div> {% endif %} {{ accordion.footer() }} {{ accordion.header('Database danger zone', 'database-danger', 'admin', danger=true, class='text-end') }} {% if error %}<div class="alert alert-danger text-start" role="alert"><strong>Error:</strong> {{ error }}.</div>{% endif %} <a href="{{ url_for('admin.import_database') }}" class="btn btn-warning" role="button"><i class="ri-upload-line"></i> Import a database file</a> <a href="{{ url_for('admin.drop_database') }}" class="btn btn-danger" role="button"><i class="ri-close-line"></i> Drop the database</a> <a href="{{ url_for('admin.delete_database') }}" class="btn btn-danger" role="button"><i class="ri-delete-bin-2-line"></i> Delete the database file</a> {{ accordion.footer() }}