Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Correctly select checkboxes for translated content

Roland Geiderfa054da7563b
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 30a5a1772..1f1413073 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -20,7 +20,7 @@ New features:
* Remove hard-coded CC licence from documentation and website `#247`_
-Other improvements and bugfixes: `#279`_, `#275`_, `#270`_, `#258`_, `#257`_, `#269`_
+Other improvements and bugfixes: `#279`_, `#275`_, `#270`_, `#258`_, `#257`_, `#269`_, `#296_`
.. _#188: https://github.com/wger-project/wger/issues/188
@@ -35,6 +35,7 @@ Other improvements and bugfixes: `#279`_, `#275`_, `#270`_, `#258`_, `#257`_, `#
.. _#275: https://github.com/wger-project/wger/issues/275
.. _#279: https://github.com/wger-project/wger/issues/279
.. _#282: https://github.com/wger-project/wger/issues/282
+.. _#296: https://github.com/wger-project/wger/issues/296
.. _@alelevinas: https://github.com/alelevinas
.. _@alokhan: https://github.com/alokhan
@@ -377,4 +378,4 @@ New features and bugfixes:
* Simple weight chart
* Nutrition plan manager
* Simple PDF output
- * Initial data with nutritional values from the USDA
\ No newline at end of file
+ * Initial data with nutritional values from the USDA
diff --git a/wger/utils/widgets.py b/wger/utils/widgets.py
index be8f62f12..338b49894 100644
--- a/wger/utils/widgets.py
+++ b/wger/utils/widgets.py
@@ -24,7 +24,7 @@ from django.forms.widgets import (
SelectMultiple,
TextInput,
ChoiceFieldRenderer,
- ChoiceInput)
+ CheckboxChoiceInput)
from django.forms import fields
@@ -144,9 +144,9 @@ class ExerciseAjaxSelect(SelectMultiple):
return ''
-class CheckboxChoiceInputTranslated(ChoiceInput):
+class CheckboxChoiceInputTranslated(CheckboxChoiceInput):
'''
- Overwritten ChoiceInput
+ Overwritten CheckboxChoiceInput
This only translated the text for the select widgets
'''
@@ -158,9 +158,9 @@ class CheckboxChoiceInputTranslated(ChoiceInput):
super(CheckboxChoiceInputTranslated, self).__init__(name, value, attrs, choice, index)
-class CheckboxChoiceInputTranslatedOriginal(ChoiceInput):
+class CheckboxChoiceInputTranslatedOriginal(CheckboxChoiceInput):
'''
- Overwritten ChoiceInput
+ Overwritten CheckboxChoiceInput
This only translated the text for the select widgets, showing the original
string as well.