From c2d287c2622cd7849826e6fdad7653bfa6fb8e02 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 24 Apr 2019 22:19:31 -0400 Subject: [PATCH] Update ChoiceForm to be full height Signed-off-by: Roberto Rosario --- HISTORY.rst | 1 + docs/releases/3.2.rst | 1 + mayan/apps/common/forms.py | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 93a0e9bcb2..73d9427ae6 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -146,6 +146,7 @@ * Rename form template 'form_class' to 'form_css_classes'. * Add support for adding form button aside from the default submit and cancel. +* Update ChoiceForm to be full height. 3.1.11 (2019-04-XX) =================== diff --git a/docs/releases/3.2.rst b/docs/releases/3.2.rst index 53ff0eae91..1da32ba85a 100644 --- a/docs/releases/3.2.rst +++ b/docs/releases/3.2.rst @@ -178,6 +178,7 @@ Other changes * Rename form template 'form_class' to 'form_css_classes'. * Add support for adding form button aside from the default submit and cancel. +* Update ChoiceForm to be full height. Removals -------- diff --git a/mayan/apps/common/forms.py b/mayan/apps/common/forms.py index d5b873101d..0ca07b6797 100644 --- a/mayan/apps/common/forms.py +++ b/mayan/apps/common/forms.py @@ -34,10 +34,14 @@ class ChoiceForm(forms.Form): self.fields['selection'].help_text = help_text self.fields['selection'].widget.disabled_choices = disabled_choices self.fields['selection'].widget.attrs.update( - {'size': 14, 'class': 'choice_form'} + { + 'class': 'full-height', 'data-height-difference': '450' + } ) - selection = forms.MultipleChoiceField(widget=DisableableSelectWidget()) + selection = forms.MultipleChoiceField( + required=False, widget=DisableableSelectWidget() + ) class FormOptions(object):