Commit 89d4c392 authored by David Haynes's avatar David Haynes 🙆
Browse files

Some code cleaning/moving/:dhaynes:ing

- great job though @mrodgers, like what you did
- merge incoming
parent c344522e
......@@ -145,38 +145,6 @@ class SignupForm(forms.ModelForm):
except RegisteredUser.DoesNotExist:
return
def __init__(self, request, *args, **kwargs):
# Necessary to call request in forms.py, is otherwise restricted to views.py and models.py
self.request = request
super(SignupForm, self).__init__(*args, **kwargs)
self.helper = FormHelper(form=self)
self.helper.form_method = 'POST'
self.helper.form_class = 'form-horizontal'
self.helper.label_class = 'col-md-4'
self.helper.field_class = 'col-md-6'
self.helper.layout = Layout(
Fieldset(
'',
HTML("""<p>In order to succesfully provide this service, users must be manually approved. This prevents misuse of the URL shortener. Please indicate below if you are interested.</p><br>"""),
Div(
Div(
'username',
'full_name',
'organization',
'description',
'tos_box',
css_class='well',
),
StrictButton('Submit',css_class='btn btn-primary btn-md col-md-6', type='submit'),
css_class='col-md-6',
)
)
,
)
username = forms.CharField(
required=True,
label='Mason NetID (Required)',
......@@ -208,7 +176,7 @@ class SignupForm(forms.ModelForm):
)
tos_box = forms.BooleanField(
required=True,
#Need to add a Terms of Service Page and replace the href below
# Need to add a Terms of Service Page and replace the href below
label = mark_safe('Do you accept the <a href="#" target="_blank">Terms of Service</a>?'),
)
......@@ -222,6 +190,34 @@ class SignupForm(forms.ModelForm):
self.add_error('username', "This is not your NetID!")
return data_username
def __init__(self, request, *args, **kwargs):
# Necessary to call request in forms.py, is otherwise restricted to views.py and models.py
self.request = request
super(SignupForm, self).__init__(*args, **kwargs)
self.helper = FormHelper(form=self)
self.helper.form_method = 'POST'
self.helper.form_class = 'form-horizontal'
self.helper.label_class = 'col-md-4'
self.helper.field_class = 'col-md-6'
self.helper.layout = Layout(
Fieldset(
'',
Div(
Div(
'username',
'full_name',
'organization',
'description',
'tos_box',
css_class='well',
),
StrictButton('Submit',css_class='btn btn-primary btn-md col-md-4', type='submit'),
css_class='col-md-6',
),
)
)
class Meta:
model = RegisteredUser
fields = '__all__'
{% extends 'layouts/base.html' %}
{% load crispy_forms_tags %}
{% crispy SignupForm SignupForm.helper %}
{% block title %}
Go - Apply
......@@ -12,13 +11,25 @@ Go - Apply
<div class="row">
<div class="col-md-12">
<h1><strong>Apply</strong></h1>
<h1><strong>Apply to Go</strong></h1>
</div>
</div>
</div>
<p>
In order to prevent abuse of the URL Shortner, users must be manually approved.
<br></br>
You will need to list the organization you represent and, while optional, we would like
<br />
to know why you would like to use Go and
some examples where you would use this service.
<br></br>
Please indicate below if you are interested.
</p>
<br />
<legend></legend>
{% crispy form %}
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment