diff --git a/README.md b/README.md
index 26ca75014..16a29fee6 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,7 @@ For a live system, refer to the project's site:
|
- {{ day.days_of_week.text }} – {{ day.obj.description }}
+
{% if editable %}
-
-
-
-
-
{% endif %}
+
+ {{ day.obj.description }}+ {{ day.days_of_week.text }} |
|
|---|---|
| + |
#{{ forloop.counter }}
{% if editable %}
- |
| {% translate "Add exercises to this workout day" %} | |
- {% translate "Goal" %}: {{workout.comment}} -
-{% endif %} - {% for day in workout.canonical_representation.day_list %}{{ workout.description }}
{% endif %} {% for day in workout.canonical_representation.day_list %} diff --git a/wger/manager/tests/test_copy_workout.py b/wger/manager/tests/test_copy_workout.py index f1a55550f..da34ecfd2 100644 --- a/wger/manager/tests/test_copy_workout.py +++ b/wger/manager/tests/test_copy_workout.py @@ -47,7 +47,7 @@ class CopyWorkoutTestCase(WgerTestCase): # Copy the workout count_before = Workout.objects.count() self.client.post(reverse('manager:workout:copy', kwargs={'pk': '3'}), - {'comment': 'A copied workout'}) + {'name': 'A copied workout'}) count_after = Workout.objects.count() if not owner: diff --git a/wger/manager/tests/test_workout.py b/wger/manager/tests/test_workout.py index 217cac9c8..6fbcf7780 100644 --- a/wger/manager/tests/test_workout.py +++ b/wger/manager/tests/test_workout.py @@ -150,7 +150,7 @@ class EditWorkoutTestCase(WgerEditTestCase): pk = 3 user_success = 'test' user_fail = 'admin' - data = {'comment': 'A new comment'} + data = {'name': 'A new comment'} class WorkoutOverviewTestCase(WgerTestCase): @@ -192,7 +192,7 @@ class WorkoutModelTestCase(WgerTestCase): self.assertEqual('{0}'.format(workout), '{0} ({1})'.format('Workout', datetime.date.today())) - workout.comment = 'my description' + workout.name = 'my description' self.assertEqual('{0}'.format(workout), 'my description') @@ -204,4 +204,4 @@ class WorkoutApiTestCase(api_base_test.ApiBaseResourceTestCase): resource = Workout private_resource = True special_endpoints = ('canonical_representation',) - data = {'comment': 'A new comment'} + data = {'name': 'A new comment'} diff --git a/wger/manager/views/pdf.py b/wger/manager/views/pdf.py index 735868244..2e6b59161 100644 --- a/wger/manager/views/pdf.py +++ b/wger/manager/views/pdf.py @@ -93,11 +93,14 @@ def workout_log(request, id, images=False, comments=False, uidb64=None, token=No elements.append(Spacer(10 * cm, 0.5 * cm)) # Set the title - p = Paragraph('| {% translate "Meal" %} | -{% translate "Contents" %} | -{% translate "Energy" %} | -{% translate "Protein" %} | -{% translate "Carbohydrates" %} | -{% translate "Fat" %} | -||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - | {% translate 'kcal' %} / {% translate 'kJ' %} | -{% trans_weight_unit 'g' owner_user %} | -{% trans_weight_unit 'g' owner_user %} | -{% trans_weight_unit 'g' owner_user %} | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
-
- {% translate "Nr."%} {{ forloop.counter }}
- {% if meal.time %} – {{meal.time|time:"H:i"}}{% endif %}
-
+
+
-
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - | {{meal.get_nutritional_values.energy|floatformat:1}} / - {{meal.get_nutritional_values.energy_kilojoule|floatformat:1}} | -{{meal.get_nutritional_values.protein|floatformat:1}} | -{{meal.get_nutritional_values.carbohydrates|floatformat:1}} | -{{meal.get_nutritional_values.fat|floatformat:1}} | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - - {% translate "No meals for this plan." %} - {% translate "Add one now." %} - - | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - {% translate "Log this Plan" %} | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - - {% translate "Add a new meal" %} - - | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% translate "Macronutrients" %} | {% translate "Total" %} | @@ -208,42 +235,44 @@ function wgerCustomModalInit() {% endif %}|||||
|---|---|---|---|---|---|---|
| {% translate "Energy" %} | -{{nutritional_data.total.energy|floatformat:0}} {% translate "kcal" %} / - {{nutritional_data.total.energy_kilojoule|floatformat:0}} {% translate "kJ" %} | +{{ nutritional_data.total.energy|floatformat:0 }} {% translate "kcal" %} + / + {{ nutritional_data.total.energy_kilojoule|floatformat:0 }} {% translate "kJ" %} | ||||
| {% translate "Protein" %} | -{{nutritional_data.total.protein|floatformat:1}} {% trans_weight_unit 'g' owner_user %} | -{{nutritional_data.percent.protein|floatformat:1}} % | -{{nutritional_data.per_kg.protein|floatformat:2}} | +{{ nutritional_data.total.protein|floatformat:1 }} {% trans_weight_unit 'g' owner_user %} | +{{ nutritional_data.percent.protein|floatformat:1 }} % | +{{ nutritional_data.per_kg.protein|floatformat:2 }} |
| {% translate "Carbohydrates" %} | -{{nutritional_data.total.carbohydrates|floatformat:1}} {% trans_weight_unit 'g' owner_user %} | -{{nutritional_data.percent.carbohydrates|floatformat:1}} % | -{{nutritional_data.per_kg.carbohydrates|floatformat:2}} | +{{ nutritional_data.total.carbohydrates|floatformat:1 }} {% trans_weight_unit 'g' owner_user %} | +{{ nutritional_data.percent.carbohydrates|floatformat:1 }} % + | +{{ nutritional_data.per_kg.carbohydrates|floatformat:2 }} |
| {% translate "Sugar content in carbohydrates" %} | -{{nutritional_data.total.carbohydrates_sugar|floatformat:1}} {% trans_weight_unit 'g' owner_user %} | +{{ nutritional_data.total.carbohydrates_sugar|floatformat:1 }} {% trans_weight_unit 'g' owner_user %} | ||||
| {% translate "Fat" %} | -{{nutritional_data.total.fat|floatformat:1}} {% trans_weight_unit 'g' owner_user %} | -{{nutritional_data.percent.fat|floatformat:1}} % | -{{nutritional_data.per_kg.fat|floatformat:2}} | +{{ nutritional_data.total.fat|floatformat:1 }} {% trans_weight_unit 'g' owner_user %} | +{{ nutritional_data.percent.fat|floatformat:1 }} % | +{{ nutritional_data.per_kg.fat|floatformat:2 }} |
| {% translate "Saturated fat content in fats" %} | -{{nutritional_data.total.fat_saturated|floatformat:1}} {% trans_weight_unit 'g' owner_user %} | +{{ nutritional_data.total.fat_saturated|floatformat:1 }} {% trans_weight_unit 'g' owner_user %} | ||||
| {% translate "Fibres" %} | -{{nutritional_data.total.fibres|floatformat}} {% trans_weight_unit 'g' owner_user %} | +{{ nutritional_data.total.fibres|floatformat }} {% trans_weight_unit 'g' owner_user %} | ||||
| {% translate "Sodium" %} | -{{nutritional_data.total.sodium|floatformat}} {% trans_weight_unit 'g' owner_user %} | +{{ nutritional_data.total.sodium|floatformat }} {% trans_weight_unit 'g' owner_user %} |
| {% translate "Date" %} | {% translate "Logged" %} | {% translate "Difference" %} | |
|---|---|---|---|
| @@ -295,7 +325,7 @@ function wgerCustomModalInit() | |||
| {% translate "nothing found" %} | @@ -304,18 +334,20 @@ function wgerCustomModalInit() {% if log_data %}|||
| - {% translate "View complete nutrition log" %} + {% translate "View complete nutrition log" %} | |||
- {% translate "Add custom diary entry" %} -
-{% endif %} + {% if is_owner %} ++ {% translate "Add custom diary entry" %} +
+ {% endif %} {% endblock %} @@ -323,42 +355,45 @@ function wgerCustomModalInit() {# Side bar #} {# #} {% block sidebar %} -| {% translate "Energy" %} | -{{nutritional_data.total.energy|floatformat:0}} {% translate "kcal" %} | +{{ nutritional_data.total.energy|floatformat:0 }} {% translate "kcal" %} |
|---|---|---|
| {% translate "Goal" %} | -- {{owner_user.userprofile.calories}} {% translate "kcal" %} | -|
| {% translate "Goal" %} | ++ {{ owner_user.userprofile.calories }} {% translate "kcal" %} + | +
{% blocktranslate %}You have selected that this nutritional plan has a - goal amount of calories. Use the calculator or enter the value yourself.{% endblocktranslate %} - {% translate "That's done here" %} -
-{% endif %} + {% if is_owner and plan.has_goal_calories %} +{% blocktranslate %}You have selected that this nutritional plan has a + goal amount of calories. Use the calculator or enter the value + yourself.{% endblocktranslate %} + {% translate "That's done here" %} +
+ {% endif %} -{% if language.short_name != 'en' and is_owner %} -- {% translate "If you find the ingredient list too short, you might want to activate the preference to also show English ingredients." %} - {% translate "That's done here" %}. -
-{% endif %} + {% if language.short_name != 'en' and is_owner %} ++ {% translate "If you find the ingredient list too short, you might want to activate the preference to also show English ingredients." %} + {% translate "That's done here" %}. +
+ {% endif %} {% endblock %} @@ -367,31 +402,35 @@ function wgerCustomModalInit() {# Options #} {# #} {% block options %} -