Merge "Add asterisk mark for the required field on CreateNamespaceForm"

This commit is contained in:
Zuul 2019-06-21 10:59:29 +00:00 committed by Gerrit Code Review
commit 0b7e231ea5

View File

@ -34,7 +34,6 @@ from openstack_dashboard.dashboards.admin.metadata_defs \
class CreateNamespaceForm(forms.SelfHandlingForm): class CreateNamespaceForm(forms.SelfHandlingForm):
source_type = forms.ChoiceField( source_type = forms.ChoiceField(
label=_('Namespace Definition Source'), label=_('Namespace Definition Source'),
required=False,
choices=[('file', _('Metadata Definition File')), choices=[('file', _('Metadata Definition File')),
('raw', _('Direct Input'))], ('raw', _('Direct Input'))],
widget=forms.ThemableSelectWidget( widget=forms.ThemableSelectWidget(
@ -45,6 +44,7 @@ class CreateNamespaceForm(forms.SelfHandlingForm):
help_text=_("A local metadata definition file to upload."), help_text=_("A local metadata definition file to upload."),
widget=forms.FileInput( widget=forms.FileInput(
attrs={'class': 'switched', 'data-switch-on': 'source', attrs={'class': 'switched', 'data-switch-on': 'source',
'data-required-when-shown': 'true',
'data-source-file': _('Metadata Definition File')}), 'data-source-file': _('Metadata Definition File')}),
required=False) required=False)
@ -53,6 +53,7 @@ class CreateNamespaceForm(forms.SelfHandlingForm):
help_text=_('The JSON formatted contents of a namespace.'), help_text=_('The JSON formatted contents of a namespace.'),
widget=forms.widgets.Textarea( widget=forms.widgets.Textarea(
attrs={'class': 'switched', 'data-switch-on': 'source', attrs={'class': 'switched', 'data-switch-on': 'source',
'data-required-when-shown': 'true',
'data-source-raw': _('Namespace JSON')}), 'data-source-raw': _('Namespace JSON')}),
required=False) required=False)