Merge pull request #1879 from cisagov/dk/1839-domain-request-form

Issue #1839: domain request form layout changes
This commit is contained in:
Alysia Broddrick 2024-03-13 16:15:58 -07:00 committed by GitHub
commit 50960ee23d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 86 additions and 44 deletions

View file

@ -1,5 +1,6 @@
from datetime import date from datetime import date
import logging import logging
import copy
from django import forms from django import forms
from django.db.models.functions import Concat, Coalesce from django.db.models.functions import Concat, Coalesce
@ -850,18 +851,21 @@ class DomainInformationAdmin(ListHeaderAdmin):
search_help_text = "Search by domain." search_help_text = "Search by domain."
fieldsets = [ fieldsets = [
(None, {"fields": ["creator", "domain_request", "notes"]}), (None, {"fields": ["creator", "submitter", "domain_request", "notes"]}),
(".gov domain", {"fields": ["domain"]}),
("Contacts", {"fields": ["authorizing_official", "other_contacts", "no_other_contacts_rationale"]}),
("Background info", {"fields": ["anything_else"]}),
( (
"Type of organization", "Type of organization",
{ {
"fields": [ "fields": [
"organization_type", "organization_type",
"is_election_board",
"federal_type",
"federal_agency",
"tribe_name",
"federally_recognized_tribe", "federally_recognized_tribe",
"state_recognized_tribe", "state_recognized_tribe",
"tribe_name",
"federal_agency",
"federal_type",
"is_election_board",
"about_your_organization", "about_your_organization",
] ]
}, },
@ -871,28 +875,15 @@ class DomainInformationAdmin(ListHeaderAdmin):
{ {
"fields": [ "fields": [
"organization_name", "organization_name",
"state_territory",
"address_line1", "address_line1",
"address_line2", "address_line2",
"city", "city",
"state_territory",
"zipcode", "zipcode",
"urbanization", "urbanization",
] ]
}, },
), ),
("Authorizing official", {"fields": ["authorizing_official"]}),
(".gov domain", {"fields": ["domain"]}),
("Your contact information", {"fields": ["submitter"]}),
("Other employees from your organization?", {"fields": ["other_contacts"]}),
(
"No other employees from your organization?",
{"fields": ["no_other_contacts_rationale"]},
),
("Anything else?", {"fields": ["anything_else"]}),
(
"Requirements for operating a .gov domain",
{"fields": ["is_policy_acknowledged"]},
),
] ]
# Read only that we'll leverage for CISA Analysts # Read only that we'll leverage for CISA Analysts
@ -1052,18 +1043,34 @@ class DomainRequestAdmin(ListHeaderAdmin):
search_help_text = "Search by domain or submitter." search_help_text = "Search by domain or submitter."
fieldsets = [ fieldsets = [
(None, {"fields": ["status", "rejection_reason", "investigator", "creator", "approved_domain", "notes"]}), (
None,
{
"fields": [
"status",
"rejection_reason",
"investigator",
"creator",
"submitter",
"approved_domain",
"notes",
]
},
),
(".gov domain", {"fields": ["requested_domain", "alternative_domains"]}),
("Contacts", {"fields": ["authorizing_official", "other_contacts", "no_other_contacts_rationale"]}),
("Background info", {"fields": ["purpose", "anything_else", "current_websites"]}),
( (
"Type of organization", "Type of organization",
{ {
"fields": [ "fields": [
"organization_type", "organization_type",
"is_election_board",
"federal_type",
"federal_agency",
"tribe_name",
"federally_recognized_tribe", "federally_recognized_tribe",
"state_recognized_tribe", "state_recognized_tribe",
"tribe_name",
"federal_agency",
"federal_type",
"is_election_board",
"about_your_organization", "about_your_organization",
] ]
}, },
@ -1073,30 +1080,15 @@ class DomainRequestAdmin(ListHeaderAdmin):
{ {
"fields": [ "fields": [
"organization_name", "organization_name",
"state_territory",
"address_line1", "address_line1",
"address_line2", "address_line2",
"city", "city",
"state_territory",
"zipcode", "zipcode",
"urbanization", "urbanization",
] ]
}, },
), ),
("Authorizing official", {"fields": ["authorizing_official"]}),
("Current websites", {"fields": ["current_websites"]}),
(".gov domain", {"fields": ["requested_domain", "alternative_domains"]}),
("Purpose of your domain", {"fields": ["purpose"]}),
("Your contact information", {"fields": ["submitter"]}),
("Other employees from your organization?", {"fields": ["other_contacts"]}),
(
"No other employees from your organization?",
{"fields": ["no_other_contacts_rationale"]},
),
("Anything else?", {"fields": ["anything_else"]}),
(
"Requirements for operating a .gov domain",
{"fields": ["is_policy_acknowledged"]},
),
] ]
# Read only that we'll leverage for CISA Analysts # Read only that we'll leverage for CISA Analysts
@ -1328,7 +1320,13 @@ class DomainInformationInline(admin.StackedInline):
model = models.DomainInformation model = models.DomainInformation
fieldsets = DomainInformationAdmin.fieldsets fieldsets = copy.deepcopy(DomainInformationAdmin.fieldsets)
# remove .gov domain from fieldset
for index, (title, f) in enumerate(fieldsets):
if title == ".gov domain":
del fieldsets[index]
break
analyst_readonly_fields = DomainInformationAdmin.analyst_readonly_fields analyst_readonly_fields = DomainInformationAdmin.analyst_readonly_fields
# For each filter_horizontal, init in admin js extendFilterHorizontalWidgets # For each filter_horizontal, init in admin js extendFilterHorizontalWidgets
# to activate the edit/delete/view buttons # to activate the edit/delete/view buttons

View file

@ -143,6 +143,10 @@ h1, h2, h3,
font-weight: font-weight('bold'); font-weight: font-weight('bold');
} }
div#content > h2 {
font-size: 1.3rem;
}
.module h3 { .module h3 {
padding: 0; padding: 0;
color: var(--link-fg); color: var(--link-fg);

View file

@ -0,0 +1,40 @@
# Generated by Django 4.2.10 on 2024-03-13 21:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("registrar", "0075_create_groups_v08"),
]
operations = [
migrations.AlterField(
model_name="domainrequest",
name="current_websites",
field=models.ManyToManyField(
blank=True, related_name="current+", to="registrar.website", verbose_name="Current websites"
),
),
migrations.AlterField(
model_name="domainrequest",
name="other_contacts",
field=models.ManyToManyField(
blank=True,
related_name="contact_domain_requests",
to="registrar.contact",
verbose_name="Other employees",
),
),
migrations.AlterField(
model_name="domaininformation",
name="other_contacts",
field=models.ManyToManyField(
blank=True,
related_name="contact_domain_requests_information",
to="registrar.contact",
verbose_name="Other employees",
),
),
]

View file

@ -183,7 +183,7 @@ class DomainInformation(TimeStampedModel):
"registrar.Contact", "registrar.Contact",
blank=True, blank=True,
related_name="contact_domain_requests_information", related_name="contact_domain_requests_information",
verbose_name="contacts", verbose_name="Other employees",
) )
no_other_contacts_rationale = models.TextField( no_other_contacts_rationale = models.TextField(

View file

@ -505,7 +505,7 @@ class DomainRequest(TimeStampedModel):
"registrar.Website", "registrar.Website",
blank=True, blank=True,
related_name="current+", related_name="current+",
verbose_name="websites", verbose_name="Current websites",
) )
approved_domain = models.OneToOneField( approved_domain = models.OneToOneField(
@ -551,7 +551,7 @@ class DomainRequest(TimeStampedModel):
"registrar.Contact", "registrar.Contact",
blank=True, blank=True,
related_name="contact_domain_requests", related_name="contact_domain_requests",
verbose_name="contacts", verbose_name="Other employees",
) )
no_other_contacts_rationale = models.TextField( no_other_contacts_rationale = models.TextField(