Merge "Horizon selects are now themable: DynamicTypedChoiceField"
This commit is contained in:
@@ -37,6 +37,7 @@ from horizon.forms.fields import ThemableCheckboxInput # noqa
|
||||
from horizon.forms.fields import ThemableCheckboxSelectMultiple # noqa
|
||||
from horizon.forms.fields import ThemableChoiceField # noqa
|
||||
from horizon.forms.fields import ThemableDynamicChoiceField # noqa
|
||||
from horizon.forms.fields import ThemableDynamicTypedChoiceField # noqa
|
||||
from horizon.forms.fields import ThemableSelectWidget # noqa
|
||||
from horizon.forms.views import ModalFormMixin # noqa
|
||||
from horizon.forms.views import ModalFormView # noqa
|
||||
|
@@ -335,6 +335,12 @@ class DynamicTypedChoiceField(DynamicChoiceField, fields.TypedChoiceField):
|
||||
pass
|
||||
|
||||
|
||||
class ThemableDynamicTypedChoiceField(ThemableDynamicChoiceField,
|
||||
fields.TypedChoiceField):
|
||||
"""Simple mix of ``ThemableDynamicChoiceField`` & ``TypedChoiceField``."""
|
||||
pass
|
||||
|
||||
|
||||
class ThemableCheckboxInput(widgets.CheckboxInput):
|
||||
"""A subclass of the ``Checkbox`` widget which renders extra markup to
|
||||
allow a custom checkbox experience.
|
||||
|
@@ -30,10 +30,11 @@ ALLOCATE_URL = "horizon:project:access_and_security:floating_ips:allocate"
|
||||
|
||||
|
||||
class AssociateIPAction(workflows.Action):
|
||||
ip_id = forms.DynamicTypedChoiceField(label=_("IP Address"),
|
||||
coerce=filters.get_int_or_uuid,
|
||||
empty_value=None,
|
||||
add_item_link=ALLOCATE_URL)
|
||||
ip_id = forms.ThemableDynamicTypedChoiceField(
|
||||
label=_("IP Address"),
|
||||
coerce=filters.get_int_or_uuid,
|
||||
empty_value=None,
|
||||
add_item_link=ALLOCATE_URL)
|
||||
instance_id = forms.ThemableChoiceField(label=_("Instance"))
|
||||
|
||||
class Meta(object):
|
||||
|
Reference in New Issue
Block a user