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 Geiderac879487c157
diff --git a/docs/changelog.rst b/docs/changelog.rst
index d337d0949..e7d97c713 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -19,7 +19,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_`
.. _#216: https://github.com/wger-project/wger/issues/216
@@ -33,6 +33,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
@@ -375,4 +376,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.