Self hosted FLOSS fitness/workout, nutrition and weight tracker
Add user notes for the sets
Roland Geidere9d4bb3c3559
diff --git a/docs/changelog.rst b/docs/changelog.rstindex 6a29afe34..f13c0ab4b 100644--- a/docs/changelog.rst+++ b/docs/changelog.rst@@ -14,7 +14,8 @@ Upgrade steps from 2.0:π Features:-* New gallery where users can upload pictures to track their progress `#572`_,+* New gallery where users can upload pictures to track their progress `#572`_+* Add comment filed to set for user notes `#702`_π Bug Fixes:@@ -29,11 +30,14 @@ Upgrade steps from 2.0:+ /workout/- ``comment`` was renamed to name- field ``description`` was added, for longer descriptions+ + /set/+ - field ``comment`` added, for user notes* `#666`_, `#656`_ (thanks `@jackmulligan-ire`_), `#716`_.. _#572: https://github.com/wger-project/wger/issues/572.. _#656: https://github.com/wger-project/wger/issues/656.. _#666: https://github.com/wger-project/wger/issues/666+.. _#702: https://github.com/wger-project/wger/issues/702.. _#716: https://github.com/wger-project/wger/issues/716.. _@jackmulligan-ire: https://github.com/jackmulligan-irediff --git a/wger/core/templates/tags/render_day.html b/wger/core/templates/tags/render_day.htmlindex dca3fad4e..1e443566f 100644--- a/wger/core/templates/tags/render_day.html+++ b/wger/core/templates/tags/render_day.html@@ -93,6 +93,9 @@{% endif %}</td><td style="border-left-width: 0px;">+ {% if set.obj.comment %}+ <p class="text-muted">{{ set.obj.comment }}</p>+ {% endif %}<div class="exercise-list">{% for exercise in set.exercise_list %}<div id="exercise-{{ exercise.obj.id }}" class="ajax-set-edit-target">diff --git a/wger/manager/api/serializers.py b/wger/manager/api/serializers.pyindex 938408dbf..ef428f41c 100644--- a/wger/manager/api/serializers.py+++ b/wger/manager/api/serializers.py@@ -106,7 +106,7 @@ class SetSerializer(serializers.ModelSerializer):class Meta:model = Set- fields = ['id', 'exerciseday', 'sets', 'order']+ fields = ['id', 'exerciseday', 'sets', 'order', 'comment']class SettingSerializer(serializers.ModelSerializer):diff --git a/wger/manager/models/set.py b/wger/manager/models/set.pyindex 37890f853..a2b06fced 100644--- a/wger/manager/models/set.py+++ b/wger/manager/models/set.py@@ -57,6 +57,8 @@ class Set(models.Model):default=DEFAULT_SETS,)+ comment = models.CharField(max_length=200, verbose_name=_('Comment'), blank=True)+# Metaclass to set some other propertiesclass Meta:ordering = [diff --git a/wger/manager/templates/set/add.html b/wger/manager/templates/set/add.htmlindex 1ac7bc889..e32573d86 100644--- a/wger/manager/templates/set/add.html+++ b/wger/manager/templates/set/add.html@@ -31,6 +31,7 @@ function wgerCustomPageInit(){% csrf_token %}{{ form.exercises|as_crispy_field }}+ {{ form.comment|as_crispy_field }}<div class="form-group"><label for="id_sets" class="control-label">