mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-10 06:24:45 +02:00
Move organization type sub questions to own pages
This commit is contained in:
parent
33cf8feb29
commit
e1a1a5e367
4 changed files with 69 additions and 32 deletions
|
@ -64,6 +64,26 @@ class OrganizationForm(RegistrarForm):
|
||||||
widget=forms.RadioSelect(attrs={"class":"usa-radio__input"}),
|
widget=forms.RadioSelect(attrs={"class":"usa-radio__input"}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class OrganizationFederalForm(RegistrarForm):
|
||||||
|
federal_type = forms.ChoiceField(
|
||||||
|
required=False,
|
||||||
|
choices=[
|
||||||
|
("Executive", "Executive"),
|
||||||
|
("Judicial", "Judicial"),
|
||||||
|
("Legislative", "Legislative"),
|
||||||
|
],
|
||||||
|
widget=forms.RadioSelect,
|
||||||
|
)
|
||||||
|
|
||||||
|
class OrganizationElectionForm(RegistrarForm):
|
||||||
|
is_election_board = forms.ChoiceField(
|
||||||
|
required=False,
|
||||||
|
choices=[
|
||||||
|
("Yes", "Yes"),
|
||||||
|
("No", "No"),
|
||||||
|
],
|
||||||
|
widget=forms.RadioSelect(),
|
||||||
|
)
|
||||||
|
|
||||||
class OrgContactForm(RegistrarForm):
|
class OrgContactForm(RegistrarForm):
|
||||||
organization_name = forms.CharField(label="Organization Name")
|
organization_name = forms.CharField(label="Organization Name")
|
||||||
|
@ -149,6 +169,8 @@ class ReviewForm(RegistrarForm):
|
||||||
# subclass
|
# subclass
|
||||||
FORMS = [
|
FORMS = [
|
||||||
("organization", OrganizationForm),
|
("organization", OrganizationForm),
|
||||||
|
("organization_federal", OrganizationFederalForm),
|
||||||
|
("organization_election", OrganizationElectionForm),
|
||||||
("org_contact", OrgContactForm),
|
("org_contact", OrgContactForm),
|
||||||
("authorizing_official", AuthorizingOfficialForm),
|
("authorizing_official", AuthorizingOfficialForm),
|
||||||
("current_sites", CurrentSitesForm),
|
("current_sites", CurrentSitesForm),
|
||||||
|
@ -166,6 +188,8 @@ FORMS = [
|
||||||
# match the first elements of the tuples in FORMS
|
# match the first elements of the tuples in FORMS
|
||||||
TEMPLATES = {
|
TEMPLATES = {
|
||||||
"organization": "application_organization.html",
|
"organization": "application_organization.html",
|
||||||
|
"organization_federal": "application_org_federal.html",
|
||||||
|
"organization_election": "application_org_election.html",
|
||||||
"org_contact": "application_org_contact.html",
|
"org_contact": "application_org_contact.html",
|
||||||
"authorizing_official": "application_authorizing_official.html",
|
"authorizing_official": "application_authorizing_official.html",
|
||||||
"current_sites": "application_current_sites.html",
|
"current_sites": "application_current_sites.html",
|
||||||
|
@ -183,6 +207,8 @@ TEMPLATES = {
|
||||||
# by the step names
|
# by the step names
|
||||||
TITLES = {
|
TITLES = {
|
||||||
"organization": "Type of organization",
|
"organization": "Type of organization",
|
||||||
|
"organization_federal": "Type of organization — Federal",
|
||||||
|
"organization_election": "Type of organization — Election board",
|
||||||
"org_contact": "Organization name and mailing address",
|
"org_contact": "Organization name and mailing address",
|
||||||
"authorizing_official": "Authorizing official",
|
"authorizing_official": "Authorizing official",
|
||||||
"current_sites": "Organization website",
|
"current_sites": "Organization website",
|
||||||
|
|
21
src/registrar/templates/application_org_election.html
Normal file
21
src/registrar/templates/application_org_election.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<!-- Test page -->
|
||||||
|
{% extends 'application_form.html' %}
|
||||||
|
{% load widget_tweaks %}
|
||||||
|
{% load dynamic_question_tags %}
|
||||||
|
|
||||||
|
{% block form_content %}
|
||||||
|
|
||||||
|
<form id="step__{{wizard.steps.current}}" class="usa-form usa-form--large" method="post">
|
||||||
|
{{ wizard.management_form }}
|
||||||
|
{% csrf_token %}
|
||||||
|
<h2>Is your organization an election office?</h2>
|
||||||
|
<fieldset id="election_board__fieldset" class="usa-fieldset">
|
||||||
|
{% radio_buttons_by_value wizard.form.is_election_board as choices %}
|
||||||
|
{% include "includes/radio_button.html" with choice=choices.Yes%}
|
||||||
|
{% include "includes/radio_button.html" with choice=choices.No%}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
{{ block.super }}
|
||||||
|
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
22
src/registrar/templates/application_org_federal.html
Normal file
22
src/registrar/templates/application_org_federal.html
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- Test page -->
|
||||||
|
{% extends 'application_form.html' %}
|
||||||
|
{% load widget_tweaks %}
|
||||||
|
{% load dynamic_question_tags %}
|
||||||
|
|
||||||
|
{% block form_content %}
|
||||||
|
|
||||||
|
<form id="step__{{wizard.steps.current}}" class="usa-form usa-form--large" method="post">
|
||||||
|
{{ wizard.management_form }}
|
||||||
|
{% csrf_token %}
|
||||||
|
<h2>Which federal branch is your organization in?</h2>
|
||||||
|
<fieldset id="federal_type__fieldset" class="usa-fieldset">
|
||||||
|
{% radio_buttons_by_value wizard.form.federal_type as federal_choices %}
|
||||||
|
{% include "includes/radio_button.html" with choice=federal_choices.Executive%}
|
||||||
|
{% include "includes/radio_button.html" with choice=federal_choices.Judicial%}
|
||||||
|
{% include "includes/radio_button.html" with choice=federal_choices.Legislative%}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
{{ block.super }}
|
||||||
|
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
|
@ -25,38 +25,6 @@
|
||||||
{% include "includes/radio_button.html" with choice=choices.Special_District tile="true" %}
|
{% include "includes/radio_button.html" with choice=choices.Special_District tile="true" %}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset id="federal_type__fieldset" {% trigger wizard.form.federal_type choices.Federal %} class="usa-fieldset">
|
|
||||||
<legend class="usa-legend">
|
|
||||||
<h2> Which federal branch does your organization belong to?</h2>
|
|
||||||
</legend>
|
|
||||||
<noscript>
|
|
||||||
Only required if you selected "Federal".
|
|
||||||
</noscript>
|
|
||||||
{% radio_buttons_by_value wizard.form.federal_type as federal_choices %}
|
|
||||||
{% include "includes/radio_button.html" with choice=federal_choices.Executive%}
|
|
||||||
{% include "includes/radio_button.html" with choice=federal_choices.Judicial%}
|
|
||||||
{% include "includes/radio_button.html" with choice=federal_choices.Legislative%}
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset id="is_election_board__fieldset" {% trigger wizard.form.is_election_board choices.Tribal choices.County choices.City choices.Special_District%} class="usa-fieldset">
|
|
||||||
<legend class="usa-legend">
|
|
||||||
<h2> Is your organization an election office?</h2>
|
|
||||||
</legend>
|
|
||||||
<noscript>
|
|
||||||
Only required if you selected "Tribal", "County", "City" or "Special District".
|
|
||||||
</noscript>
|
|
||||||
{% for radio in wizard.form.is_election_board %}
|
|
||||||
<div class="usa-radio">
|
|
||||||
{{radio.tag}}
|
|
||||||
<label for="{{radio.id_for_label}}" class="usa-radio__label">
|
|
||||||
{{ radio.choice_label }}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
<!-- {{ wizard.form.is_election_board|add_label_class:"usa-label" }} -->
|
|
||||||
<!-- {{ wizard.form.is_election_board|add_class:"usa-radio" }} -->
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue