From fa054da7563b3b24a19eaae5826794afe123bc15 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Mon, 13 Jun 2016 15:54:52 +0200 Subject: [PATCH] Correctly select checkboxes for translated content Fixes #296 --- docs/changelog.rst | 5 +++-- wger/utils/widgets.py | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) 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.