Task #9532 Handle the UI of the login and Signup pages
Task #9535 Handle the UI of the Checkout Page
This commit is contained in:
parent
4a0987766d
commit
94dac8110e
29 changed files with 1046 additions and 637 deletions
|
|
@ -15,16 +15,32 @@ class DomainNameField(forms.CharField):
|
|||
def __init__(self, *args, **kwargs):
|
||||
super(DomainNameField, self).__init__(*args, **kwargs)
|
||||
|
||||
class InitialRequestForm(forms.Form):
|
||||
class MainModelForm(ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(MainModelForm, self).__init__(*args, **kwargs)
|
||||
for visible in self.visible_fields():
|
||||
visible.field.widget.attrs['class'] = 'form-control'
|
||||
|
||||
class MainForm(forms.Form):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(MainForm, self).__init__(*args, **kwargs)
|
||||
for visible in self.visible_fields():
|
||||
if (isinstance(visible.field.widget, forms.TextInput)):
|
||||
visible.field.widget.attrs['class'] = 'form-control'
|
||||
elif (isinstance(visible.field.widget, forms.CheckboxInput)):
|
||||
visible.field.widget.attrs['class'] = 'custom-control-input'
|
||||
|
||||
|
||||
class InitialRequestForm(MainForm):
|
||||
cores = forms.IntegerField(label='CPU', min_value=1, max_value=48, initial=1)
|
||||
memory = forms.IntegerField(label='RAM', min_value=2, max_value=200, initial=2)
|
||||
storage = forms.IntegerField(label='Storage', min_value=100, max_value=10000, initial=100)
|
||||
pricing_name = forms.CharField(required=True)
|
||||
|
||||
class RequestHostedVMForm(InitialRequestForm):
|
||||
matrix_domain = DomainNameField(required=True)
|
||||
homeserver_domain = DomainNameField(required=True)
|
||||
webclient_domain = DomainNameField(required=True)
|
||||
matrix_domain = DomainNameField(required=True, widget=forms.TextInput(attrs={'placeholder': 'Matrix Domain *'}))
|
||||
homeserver_domain = DomainNameField(required=True, widget=forms.TextInput(attrs={'placeholder': 'Homeserver Domain *'}))
|
||||
webclient_domain = DomainNameField(required=True, widget=forms.TextInput(attrs={'placeholder': 'Webclient Domain *'}))
|
||||
is_open_registration = forms.BooleanField(required=False, initial=False)
|
||||
|
||||
def clean(self):
|
||||
|
|
@ -41,7 +57,7 @@ class RequestHostedVMForm(InitialRequestForm):
|
|||
return self.cleaned_data
|
||||
|
||||
|
||||
class BillingAddressForm(ModelForm):
|
||||
class BillingAddressForm(MainModelForm):
|
||||
class Meta:
|
||||
model = BillingAddress
|
||||
fields = ['full_name', 'street',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue