Correctly select checkboxes for translated content

Fixes #296
This commit is contained in:
Roland Geider
2016-06-13 15:54:52 +02:00
parent b8450774b2
commit fa054da756
2 changed files with 8 additions and 7 deletions

View File

@@ -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
* Initial data with nutritional values from the USDA

View File

@@ -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.