Add purpose view

This commit is contained in:
igorkorenfeld 2022-11-03 17:00:26 -04:00
parent d8ae0d9753
commit fab3e1b292
No known key found for this signature in database
GPG key ID: 826947A4B867F659
2 changed files with 44 additions and 0 deletions

View file

@ -65,12 +65,20 @@ class ContactForm(forms.Form):
organization_name = forms.CharField(label="Organization Name")
street_address = forms.CharField(label="Street address")
class PurposeForm(forms.Form):
purpose_field = forms.CharField(label="Purpose", widget=forms.Textarea(
attrs={ 'class':'usa-textarea usa-character-count__field',
'id':'with-hint',
'aria-describedby':'instructions',
'maxlength':'500',
}))
# List of forms in our wizard. Each entry is a tuple of a name and a form
# subclass
FORMS = [
("organization", OrganizationForm),
("contact", ContactForm),
("purpose", PurposeForm),
]
# Dict to match up the right template with the right step. Keys here must
@ -78,6 +86,7 @@ FORMS = [
TEMPLATES = {
"organization": "application_organization.html",
"contact": "application_contact.html",
"purpose": "application_purpose.html",
}
# We need to pass our page titles as context to the templates, indexed
@ -85,6 +94,7 @@ TEMPLATES = {
TITLES = {
"organization": "About your organization",
"contact": "Your organization's contact information",
"purpose": "Purpose of your domain",
}

View file

@ -0,0 +1,34 @@
<!-- Test page -->
{% extends 'application_form.html' %}
{% load widget_tweaks %}
{% block title %}Apply for a .gov domain - Puprose{% endblock %}
{% block form_content %}
<h1>Purpose of your domain</h1>
<p id="instructions">Explain how you plan to use this domain. Will you use it for a website and/or email? Are you moving your website from another top-level domain (like .com or .org)?Read about <a href="#">activities that are prohibited on .gov domains.</a></p>
<p>All fields are required unless they are marked optional.</p>
<form class="usa-form usa-form--large" method="post">
<div class="usa-form-group">
{{ wizard.management_form }}
{% csrf_token %}
<div class="usa-character-count">
{{ wizard.form.purpose_field|add_label_class:"usa-label" }}
{{ wizard.form.purpose_field}}
<span class="usa-character-count__message" id="with-hint-textarea-info with-hint-textarea-hint"> You can enter up to 500 characters </span>
</div>
<!-- {{ wizard.form.purpose_field|add_class:"usa-textarea usa-character-count__field"|attr:"aria-describedby:instructions"|attr:"maxlength=50" }} -->
</div>
{% if wizard.steps.prev %}
<button name="wizard_goto_step" type="submit" class="usa-button usa-button--base" value="{{ wizard.steps.prev }}">Previous</button>
{% endif %}
<button type="submit" class="usa-button">Next</button>
</form>
{% endblock %}