From bb64fb87c150f0828520f7abfa15bd3b0afa11eb Mon Sep 17 00:00:00 2001 From: wasswa-derick Date: Wed, 29 Aug 2018 14:33:21 +0300 Subject: [PATCH] [ft] Add buttons to trigger exportation and importations * Create the export url action handler * Implement export and import workouts functionality * Test export and import workouts functions * Resolve flake8 errors * Remove unused modules * Remove unnecessary blank lines * Correct imports and structure of the try statements [Delivers #159236209] --- wger/manager/templates/workout/overview.html | 42 ++++ wger/manager/tests/test_workout.py | 202 +++++++++++++++++++ wger/manager/urls.py | 3 + wger/manager/views/workout.py | 195 +++++++++++++++++- 4 files changed, 441 insertions(+), 1 deletion(-) diff --git a/wger/manager/templates/workout/overview.html b/wger/manager/templates/workout/overview.html index 28900b42..c3443f16 100644 --- a/wger/manager/templates/workout/overview.html +++ b/wger/manager/templates/workout/overview.html @@ -36,6 +36,48 @@

{{ workout }}

{% endblock %} + +{% block sidebar %} +

{% trans "Export Workouts" %}

+
+
+ {% if workouts|length < 1 %} + + {% else %} + + + + {% endif %} +
+
+ +
+

{% trans "Import Workouts" %}

+
+ {% csrf_token %} +
+
+ +
+ +
+ +
+
+
+ +{% if messages %} +
{{ message }}
+{% endif %} + +{% endblock %} + {% block options %}