diff --git a/app.py b/app.py index e317d91..3106027 100644 --- a/app.py +++ b/app.py @@ -227,7 +227,19 @@ def get_person_name(person_id): @ app.route("/settings") @ login_required def settings(): + if htmx: + return render_block(app.jinja_env, 'settings.html', 'content') + return render_template('settings.html') + +@ app.route("/settings/tab/people") +@ login_required +def settings_people(): people = db.get_people() + return render_template('partials/settings/people.html', people=people) + +@ app.route("/settings/tab/exercises") +@ login_required +def settings_exercises(): exercises = db.get_all_exercises() all_attributes = db.exercises.get_attributes_by_category() categories_list = db.exercises.get_all_attribute_categories() @@ -237,10 +249,20 @@ def settings(): for cat, attrs in all_attributes.items(): formatted_options[cat] = [{"id": a['attribute_id'], "attribute_id": a['attribute_id'], "name": a['name'], "category_id": a['category_id']} for a in attrs] - if htmx: - return render_block(app.jinja_env, "settings.html", "content", - people=people, exercises=exercises, all_attributes=formatted_options, categories_list=categories_list), 200, {"HX-Trigger": "updatedPeople"} - return render_template('settings.html', people=people, exercises=exercises, all_attributes=formatted_options, categories_list=categories_list) + return render_template('partials/settings/exercises.html', + exercises=exercises, + all_attributes=formatted_options, + categories_list=categories_list) + +@ app.route("/settings/tab/export") +@ login_required +def settings_export(): + return render_template('partials/settings/export.html') + +@ app.route("/settings/tab/activity") +@ login_required +def settings_activity(): + return render_template('partials/settings/activity.html') @app.route("/settings/activity_logs") diff --git a/templates/partials/settings/activity.html b/templates/partials/settings/activity.html new file mode 100644 index 0000000..0a87ac1 --- /dev/null +++ b/templates/partials/settings/activity.html @@ -0,0 +1,14 @@ +
Review recent actions and administrative changes.
+Loading activity history...
+Manage available exercises and their categories.
+| + Exercise Name + | + +
+
+
+
+
+
+
+
+
+
+ |
+
|---|
Create a new exercise with specific muscle groups and equipment. +
+Add or edit muscle groups, equipment types, and other exercise + attributes.
+Export your data for backup or external analysis.
+Download all workout records, sets, and + performance data in CSV format.
+ + Download CSV + +Create a full SQL dump of your database including + schema and all records.
+ + Download SQL Script + +Add, edit or remove people from the tracker.
+| + Name + | +
+
+
+
+
+
+
+ |
+
|---|
Add, edit or remove people from the tracker.
-Loading users...
| - Name - | -
-
-
-
-
-
-
- |
-
|---|
Manage available exercises and their categories.
-| - Exercise Name - | - -
-
-
-
-
-
-
-
-
-
- |
-
|---|
Create a new exercise with specific muscle groups and equipment. -
-Add or edit muscle groups, equipment types, and other exercise - attributes.
-Loading exercises...
Export your data for backup or external analysis.
-Download all workout records, sets, and - performance data in CSV format.
- - Download CSV - -Create a full SQL dump of your database including - schema and all records.
- - Download SQL Script - -Loading data settings...
Review recent actions and administrative changes.
-Loading activity history...
-Loading activity history...