mirror of
https://github.com/sstent/foodplanner.git
synced 2026-01-25 19:21:37 +00:00
added alembic database migrations, json import/export
This commit is contained in:
35
templates/admin/imports.html
Normal file
35
templates/admin/imports.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "admin/index.html" %}
|
||||
|
||||
{% block admin_content %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Import/Export All Data</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
This section allows you to export all your data (foods, meals, plans, etc.) into a single JSON file.
|
||||
You can also import this data back, which will overwrite any existing data.
|
||||
This is useful for backups or migrating to a new instance.
|
||||
</p>
|
||||
|
||||
<div class="mb-3">
|
||||
<a href="/export/all" class="btn btn-primary" download="meal_planner_backup.json">
|
||||
<i class="bi bi-download"></i> Export All Data
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h5>Import Data</h5>
|
||||
<form id="import-form" action="/import/all" method="post" enctype="multipart/form-data">
|
||||
<div class="mb-3">
|
||||
<label for="import-file" class="form-label">Select JSON file to import</label>
|
||||
<input class="form-control" type="file" id="import-file" name="file" accept=".json">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="bi bi-upload"></i> Import and Overwrite
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user