From 400232a10f51a72528ac8d44b2ec428ab1e9a4b4 Mon Sep 17 00:00:00 2001 From: Neil Martinsen-Burrell Date: Wed, 17 May 2023 13:59:34 -0500 Subject: [PATCH 01/37] Add public_site_url template tag --- ops/manifests/manifest-stable.yaml | 2 ++ ops/scripts/manifest-sandbox-template.yaml | 2 ++ src/.env-example | 1 + src/docker-compose.yml | 2 ++ src/registrar/config/settings.py | 7 +++++++ src/registrar/templates/application_purpose.html | 4 ++-- src/registrar/templatetags/url_helpers.py | 16 ++++++++++++++++ 7 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ops/manifests/manifest-stable.yaml b/ops/manifests/manifest-stable.yaml index 619e5fc7a..72726cd08 100644 --- a/ops/manifests/manifest-stable.yaml +++ b/ops/manifests/manifest-stable.yaml @@ -20,6 +20,8 @@ applications: DJANGO_BASE_URL: https://getgov-stable.app.cloud.gov # Tell Django how much stuff to log DJANGO_LOG_LEVEL: INFO + # Public site base URL + GETGOV_PUBLIC_SITE_URL: https://federalist-877ab29f-16f6-4f12-961c-96cf064cf070.sites.pages.cloud.gov/site/cisagov/getgov-home/ routes: - route: getgov-stable.app.cloud.gov services: diff --git a/ops/scripts/manifest-sandbox-template.yaml b/ops/scripts/manifest-sandbox-template.yaml index ba814b3d5..1bf979c9f 100644 --- a/ops/scripts/manifest-sandbox-template.yaml +++ b/ops/scripts/manifest-sandbox-template.yaml @@ -20,6 +20,8 @@ applications: DJANGO_BASE_URL: https://getgov-ENVIRONMENT.app.cloud.gov # Tell Django how much stuff to log DJANGO_LOG_LEVEL: INFO + # default public site location + GETGOV_PUBLIC_SITE_URL: https://beta.get.gov routes: - route: getgov-ENVIRONMENT.app.cloud.gov services: diff --git a/src/.env-example b/src/.env-example index 7100fc628..9b3f56409 100644 --- a/src/.env-example +++ b/src/.env-example @@ -1,2 +1,3 @@ DJANGO_SECRET_KEY="" DJANGO_SECRET_LOGIN_KEY="" +GETGOV_PUBLIC_SITE_URL="https://federalist-877ab29f-16f6-4f12-961c-96cf064cf070.sites.pages.cloud.gov/site/cisagov/getgov-home/" diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 4399c5b70..8b1111868 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -27,6 +27,8 @@ services: - DJANGO_DEBUG=True # Tell Django where it is being hosted - DJANGO_BASE_URL=http://localhost:8080 + # Public site URL link + - GETGOV_PUBLIC_SITE_URL="https://beta.get.gov" # Set a username for accessing the registry - REGISTRY_CL_ID=nothing # Set a password for accessing the registry diff --git a/src/registrar/config/settings.py b/src/registrar/config/settings.py index 9491b354a..41559ceba 100644 --- a/src/registrar/config/settings.py +++ b/src/registrar/config/settings.py @@ -62,6 +62,9 @@ secret_registry_key = b64decode(secret("REGISTRY_KEY", "")) secret_registry_key_passphrase = secret("REGISTRY_KEY_PASSPHRASE", "") secret_registry_hostname = secret("REGISTRY_HOSTNAME") +# this needs to exist or a warning will be generated +secret_getgov_public_site_url = secret("GETGOV_PUBLIC_SITE_URL") + # region: Basic Django Config-----------------------------------------------### # Build paths inside the project like this: BASE_DIR / "subdir". @@ -503,6 +506,10 @@ ROOT_URLCONF = "registrar.config.urls" # Must be relative and end with "/" STATIC_URL = "public/" +# Base URL of our separate static public website. Used by the +# {% public_site_url subdir/path %} template tag +GETGOV_PUBLIC_SITE_URL = secret_getgov_public_site_url + # endregion # region: Registry----------------------------------------------------------### diff --git a/src/registrar/templates/application_purpose.html b/src/registrar/templates/application_purpose.html index a28dc27b3..ca2ff7287 100644 --- a/src/registrar/templates/application_purpose.html +++ b/src/registrar/templates/application_purpose.html @@ -1,5 +1,5 @@ {% extends 'application_form.html' %} -{% load field_helpers %} +{% load field_helpers url_helpers %} {% block form_instructions %}

.Gov domain names are for use on the internet. Don’t register a .gov to simply reserve a @@ -8,7 +8,7 @@ domain name or for mainly internal use.

Describe the reason for your domain request. Explain how you plan to use this domain. Who is your intended audience? 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 activities that are prohibited on .gov domains.

+Read about activities that are prohibited on .gov domains.

{% endblock %} diff --git a/src/registrar/templatetags/url_helpers.py b/src/registrar/templatetags/url_helpers.py index 6201e61eb..7662a42d8 100644 --- a/src/registrar/templatetags/url_helpers.py +++ b/src/registrar/templatetags/url_helpers.py @@ -1,6 +1,10 @@ +from urllib.parse import urljoin + from django import template from django.urls import reverse +from django.conf import settings + register = template.Library() @@ -15,3 +19,15 @@ def startswith(text, starts): if isinstance(text, str): return text.startswith(starts) return False + + +@register.simple_tag +def public_site_url(url_path): + """Make a full URL for this path at our public site. + + The public site base url is set by a GETGOV_PUBLIC_SITE_URL environment + variable. + """ + base_url = settings.GETGOV_PUBLIC_SITE_URL + public_url = urljoin(base_url, url_path) + return public_url From 135192fd9f44fdd313c3583d5f986ce8df965e9e Mon Sep 17 00:00:00 2001 From: Neil Martinsen-Burrell Date: Wed, 17 May 2023 15:02:59 -0500 Subject: [PATCH 02/37] Add a unit test for new template tag --- src/docker-compose.yml | 2 +- src/registrar/templatetags/url_helpers.py | 6 ++++- src/registrar/tests/test_templatetags.py | 31 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/registrar/tests/test_templatetags.py diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 8b1111868..82642bc93 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -28,7 +28,7 @@ services: # Tell Django where it is being hosted - DJANGO_BASE_URL=http://localhost:8080 # Public site URL link - - GETGOV_PUBLIC_SITE_URL="https://beta.get.gov" + - GETGOV_PUBLIC_SITE_URL=https://beta.get.gov # Set a username for accessing the registry - REGISTRY_CL_ID=nothing # Set a password for accessing the registry diff --git a/src/registrar/templatetags/url_helpers.py b/src/registrar/templatetags/url_helpers.py index 7662a42d8..096d6f2f6 100644 --- a/src/registrar/templatetags/url_helpers.py +++ b/src/registrar/templatetags/url_helpers.py @@ -29,5 +29,9 @@ def public_site_url(url_path): variable. """ base_url = settings.GETGOV_PUBLIC_SITE_URL - public_url = urljoin(base_url, url_path) + # join the two halves with a single slash + public_url ="/".join([ + base_url.rstrip("/"), + url_path.lstrip("/") + ]) return public_url diff --git a/src/registrar/tests/test_templatetags.py b/src/registrar/tests/test_templatetags.py new file mode 100644 index 000000000..10a174be0 --- /dev/null +++ b/src/registrar/tests/test_templatetags.py @@ -0,0 +1,31 @@ +"""Test template tags.""" + +from django.conf import settings +from django.test import TestCase +from django.template import Context, Template + +class TestTemplateTags(TestCase): + + def _render_template(self, string, context=None): + """Helper method to render a template given as a string. + + Originally from https://stackoverflow.com/a/1690879 + """ + context = context or {} + context = Context(context) + return Template(string).render(context) + + def test_public_site_url(self): + result = self._render_template( + "{% load url_helpers %}{% public_site_url 'directory/page' %}" + ) + self.assertTrue(result.startswith(settings.GETGOV_PUBLIC_SITE_URL)) + self.assertTrue(result.endswith("/directory/page")) + + def test_public_site_url_leading_slash(self): + result = self._render_template( + "{% load url_helpers %}{% public_site_url '/directory/page' %}" + ) + self.assertTrue(result.startswith(settings.GETGOV_PUBLIC_SITE_URL)) + # slash-slash host slash directory slash page + self.assertEqual(result.count("/"), 4) From 125877c4af0e9bee51018292a9b33bd54cdc005b Mon Sep 17 00:00:00 2001 From: Neil Martinsen-Burrell Date: Wed, 17 May 2023 15:13:48 -0500 Subject: [PATCH 03/37] Fix linting errors --- src/registrar/templatetags/url_helpers.py | 7 +------ src/registrar/tests/test_templatetags.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/registrar/templatetags/url_helpers.py b/src/registrar/templatetags/url_helpers.py index 096d6f2f6..5b76c116f 100644 --- a/src/registrar/templatetags/url_helpers.py +++ b/src/registrar/templatetags/url_helpers.py @@ -1,5 +1,3 @@ -from urllib.parse import urljoin - from django import template from django.urls import reverse @@ -30,8 +28,5 @@ def public_site_url(url_path): """ base_url = settings.GETGOV_PUBLIC_SITE_URL # join the two halves with a single slash - public_url ="/".join([ - base_url.rstrip("/"), - url_path.lstrip("/") - ]) + public_url = "/".join([base_url.rstrip("/"), url_path.lstrip("/")]) return public_url diff --git a/src/registrar/tests/test_templatetags.py b/src/registrar/tests/test_templatetags.py index 10a174be0..681d823b7 100644 --- a/src/registrar/tests/test_templatetags.py +++ b/src/registrar/tests/test_templatetags.py @@ -4,8 +4,8 @@ from django.conf import settings from django.test import TestCase from django.template import Context, Template -class TestTemplateTags(TestCase): +class TestTemplateTags(TestCase): def _render_template(self, string, context=None): """Helper method to render a template given as a string. From efe418bf2ec986614ece7320fda57142736c3a66 Mon Sep 17 00:00:00 2001 From: Neil Martinsen-Burrell Date: Wed, 17 May 2023 15:25:21 -0500 Subject: [PATCH 04/37] Fix broken test with env default --- src/registrar/config/settings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/registrar/config/settings.py b/src/registrar/config/settings.py index 41559ceba..879948785 100644 --- a/src/registrar/config/settings.py +++ b/src/registrar/config/settings.py @@ -62,8 +62,7 @@ secret_registry_key = b64decode(secret("REGISTRY_KEY", "")) secret_registry_key_passphrase = secret("REGISTRY_KEY_PASSPHRASE", "") secret_registry_hostname = secret("REGISTRY_HOSTNAME") -# this needs to exist or a warning will be generated -secret_getgov_public_site_url = secret("GETGOV_PUBLIC_SITE_URL") +secret_getgov_public_site_url = secret("GETGOV_PUBLIC_SITE_URL", "") # region: Basic Django Config-----------------------------------------------### From 1511b5deca1abca41a39b822ccc2eeabb0837c47 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Thu, 18 May 2023 19:14:37 -0400 Subject: [PATCH 05/37] Upate summary item for user lists and edit button option --- .../templates/includes/summary_item.html | 120 +++++++++++------- 1 file changed, 74 insertions(+), 46 deletions(-) diff --git a/src/registrar/templates/includes/summary_item.html b/src/registrar/templates/includes/summary_item.html index c902f1980..170ec67cb 100644 --- a/src/registrar/templates/includes/summary_item.html +++ b/src/registrar/templates/includes/summary_item.html @@ -1,49 +1,77 @@ +{% load static url_helpers %} +

-

- {{ title }} -

- {% if address %} - {% include "includes/organization_address.html" with organization=value %} - {% elif contact %} - {% if list %} - {% if value|length == 1 %} - {% include "includes/contact.html" with contact=value|first %} - {% else %} -
    - {% for item in value %} -
  • -

    - Conatct {{forloop.counter}} -

    - {% include "includes/contact.html" with contact=item %}
  • - {% empty %} -
  • None
  • - {% endfor %}

- - {% endif %} - {% else %} - {% include "includes/contact.html" with contact=value %} - {% endif %} - {% elif list %} - {% if value|length == 1 %} -

{{ value | first }}

- {% else %} -
    - {% for item in value %} -
  • {{ item }}
  • - {% empty %} -
  • None
  • - {% endfor %}

- - {% endif %} - {% else %} -

- {{ value }} -

- {% endif %} - +
+
+

+ {{ title }} +

+ {% if address %} + {% include "includes/organization_address.html" with organization=value %} + {% elif contact %} + {% if list %} + {% if value|length == 1 %} + {% include "includes/contact.html" with contact=value|first %} + {% else %} +
    + {% for item in value %} +
  • +

    + Conatct {{forloop.counter}} +

    + {% include "includes/contact.html" with contact=item %}
  • + {% empty %} +
  • None
  • + {% endfor %}

+ + {% endif %} + {% else %} + {% include "includes/contact.html" with contact=value %} + {% endif %} + + {% elif list %} + {% if value|length == 1 %} +

{{ value | first }}

+ {% else %} +
    + {% for item in value %} +
  • {{ item }}
  • + {% empty %} +
  • None
  • + {% endfor %}

+ + {% endif %} + + {% elif users %} + {% if value|length == 1 %} +

{{ user.email }} ({{ value.first.role }})

+ {% else %} +
    + {% for item in value %} +
  • {{ user.email }} ({{ item.role }})
  • + {% endfor %} + {% endif %} + + {% else %} +

    + {{ value }} +

    + {% endif %} +
+ + {% if edit_link %} + + Edit {{ title }} + + {% endif %} + +
+
From 649be0f49c42f0b81e8b842d201d4ac378de47ff Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Thu, 18 May 2023 19:15:13 -0400 Subject: [PATCH 06/37] Add detail fields to domain overview page --- src/registrar/templates/domain_detail.html | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/registrar/templates/domain_detail.html b/src/registrar/templates/domain_detail.html index dd6faa1be..14ac10639 100644 --- a/src/registrar/templates/domain_detail.html +++ b/src/registrar/templates/domain_detail.html @@ -1,6 +1,33 @@ {% extends "domain_base.html" %} +{% load static url_helpers %} {% block domain_content %} {{ block.super }}

Active: {% if domain.is_active %}Yes{% else %}No{% endif %}

+ org type: {{domain.domain_info.organization_type}} + + {% url 'domain-nameservers' pk=domain.id as url %} + {% include "includes/summary_item.html" with title='DNS name servers' value=domain.nameservers list='true' edit_link=url %} + + {% url 'todo' as url %} + {% if domain.domain_info.organization_name %} + {% include "includes/summary_item.html" with title='Organization name and mailing address' value=domain.domain_info address='true' edit_link=url %} + {% endif %} + + {% if domain.domain_info.authorizing_official %} + {% url 'todo' as url %} + {% include "includes/summary_item.html" with title='Authorizing official' value=domain.domain_info.authorizing_official contact='true' edit_link=url %} + {% endif %} + + {% if domain.domain_info.submitter %} + {% url 'todo' as url %} + {% include "includes/summary_item.html" with title='Your contact information' value='---TODO---' edit_link=url %} + {% endif %} + + {% url 'todo' as url %} + {% include "includes/summary_item.html" with title='Security email' value=domain.domain_info.security_email edit_link=url %} + + {% url 'domain-users' pk=domain.id as url %} + {% include "includes/summary_item.html" with title='User management' users='true' value=domain.permissions.all edit_link=url %} + {% endblock %} {# domain_content #} From e277c3a64c346f4a7239639488b1c7decccb6927 Mon Sep 17 00:00:00 2001 From: Neil Martinsen-Burrell Date: Fri, 19 May 2023 10:52:16 -0500 Subject: [PATCH 07/37] Form to edit a domain's authorizing official --- src/registrar/config/urls.py | 5 +++ src/registrar/forms/__init__.py | 2 +- src/registrar/forms/domain.py | 40 +++++++++++++++++ src/registrar/models/contact.py | 3 ++ .../domain_authorizing_official.html | 43 ++++++++++++++++++ src/registrar/templates/domain_sidebar.html | 2 +- src/registrar/views/__init__.py | 1 + src/registrar/views/domain.py | 45 ++++++++++++++++++- 8 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 src/registrar/templates/domain_authorizing_official.html diff --git a/src/registrar/config/urls.py b/src/registrar/config/urls.py index 204e5ca92..1087a2f19 100644 --- a/src/registrar/config/urls.py +++ b/src/registrar/config/urls.py @@ -83,6 +83,11 @@ urlpatterns = [ views.DomainNameserversView.as_view(), name="domain-nameservers", ), + path( + "domain//authorizing-official", + views.DomainAuthorizingOfficialView.as_view(), + name="domain-authorizing-official", + ), path( "domain//users/add", views.DomainAddUserView.as_view(), diff --git a/src/registrar/forms/__init__.py b/src/registrar/forms/__init__.py index 6c1b5d8cf..8e35825aa 100644 --- a/src/registrar/forms/__init__.py +++ b/src/registrar/forms/__init__.py @@ -1,2 +1,2 @@ from .application_wizard import * -from .domain import DomainAddUserForm, NameserverFormset +from .domain import DomainAddUserForm, NameserverFormset, ContactForm diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index cca0bf5c9..1c8033a2b 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -3,6 +3,9 @@ from django import forms from django.forms import formset_factory +from phonenumber_field.widgets import RegionalPhoneNumberWidget + +from ..models import Contact class DomainAddUserForm(forms.Form): @@ -22,3 +25,40 @@ NameserverFormset = formset_factory( DomainNameserverForm, extra=1, ) + + +class ContactForm(forms.ModelForm): + + """Form for updating contacts.""" + + class Meta: + model = Contact + fields = ["first_name", "middle_name", "last_name", "title", "email", "phone"] + widgets = { + "first_name": forms.TextInput, + "middle_name": forms.TextInput, + "last_name": forms.TextInput, + "title": forms.TextInput, + "email": forms.EmailInput, + "phone": RegionalPhoneNumberWidget, + } + + # the database fields have blank=True so ModelForm doesn't create + # required fields by default. Use this list in __init__ to mark each + # of these fields as required + required = [ + "first_name", + "last_name", + "title", + "email", + "phone" + ] + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + # take off maxlength attribute for the phone number field + # which interferes with out input_with_errors template tag + self.fields['phone'].widget.attrs.pop('maxlength', None) + + for field_name in self.required: + self.fields[field_name].required = True diff --git a/src/registrar/models/contact.py b/src/registrar/models/contact.py index d5d32a7ae..cbfde7a23 100644 --- a/src/registrar/models/contact.py +++ b/src/registrar/models/contact.py @@ -20,6 +20,7 @@ class Contact(TimeStampedModel): null=True, blank=True, help_text="First name", + verbose_name="first name / given name", db_index=True, ) middle_name = models.TextField( @@ -31,12 +32,14 @@ class Contact(TimeStampedModel): null=True, blank=True, help_text="Last name", + verbose_name="last name / family name", db_index=True, ) title = models.TextField( null=True, blank=True, help_text="Title", + verbose_name="title or role in your organization", ) email = models.TextField( null=True, diff --git a/src/registrar/templates/domain_authorizing_official.html b/src/registrar/templates/domain_authorizing_official.html new file mode 100644 index 000000000..445db5707 --- /dev/null +++ b/src/registrar/templates/domain_authorizing_official.html @@ -0,0 +1,43 @@ +{% extends "domain_base.html" %} +{% load static field_helpers%} + +{% block title %}Domain authorizing official | {{ domain.name }} | {% endblock %} + +{% block domain_content %} + {# this is right after the messages block in the parent template #} + {% include "includes/form_errors.html" with form=form %} + +

Authorizing official

+ +

Your authorizing official is the person within your organization who can + authorize domain requests. This is generally the highest-ranking or + highest-elected official in your organization. Read more about who can serve + as an authorizing official.

+ + {% include "includes/required_fields.html" %} + +
+ {% csrf_token %} + + {% input_with_errors form.first_name %} + + {% input_with_errors form.middle_name %} + + {% input_with_errors form.last_name %} + + {% input_with_errors form.title %} + + {% input_with_errors form.email %} + + {% input_with_errors form.phone %} + + + + +
+ +{% endblock %} {# domain_content #} diff --git a/src/registrar/templates/domain_sidebar.html b/src/registrar/templates/domain_sidebar.html index c50cc59bd..ab259a4a7 100644 --- a/src/registrar/templates/domain_sidebar.html +++ b/src/registrar/templates/domain_sidebar.html @@ -31,7 +31,7 @@
  • - {% url 'todo' as url %} + {% url 'domain-authorizing-official' pk=domain.id as url %} diff --git a/src/registrar/views/__init__.py b/src/registrar/views/__init__.py index 9f7fe139e..2eae93370 100644 --- a/src/registrar/views/__init__.py +++ b/src/registrar/views/__init__.py @@ -1,6 +1,7 @@ from .application import * from .domain import ( DomainView, + DomainAuthorizingOfficialView, DomainNameserversView, DomainUsersView, DomainAddUserView, diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 8a9095de3..8b9186958 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -12,7 +12,7 @@ from django.views.generic.edit import DeleteView, FormMixin from registrar.models import Domain, DomainInvitation, User, UserDomainRole -from ..forms import DomainAddUserForm, NameserverFormset +from ..forms import DomainAddUserForm, NameserverFormset, ContactForm from ..utility.email import send_templated_email, EmailSendingError from .utility import DomainPermission @@ -29,6 +29,49 @@ class DomainView(DomainPermission, DetailView): context_object_name = "domain" +class DomainAuthorizingOfficialView(DomainPermission, FormMixin, DetailView): + + """Domain authorizing official editing view.""" + + model = Domain + template_name = "domain_authorizing_official.html" + context_object_name = "domain" + form_class = ContactForm + + def get_form_kwargs(self, *args, **kwargs): + """Add domain_info.authorizing_official instance to make a bound form.""" + form_kwargs = super().get_form_kwargs(*args, **kwargs) + form_kwargs["instance"] = self.get_object().domain_info.authorizing_official + return form_kwargs + + def get_success_url(self): + """Redirect to the overview page for the domain.""" + return reverse("domain-authorizing-official", kwargs={"pk": self.object.pk}) + + def post(self, request, *args, **kwargs): + """Form submission posts to this view. + + This post method harmonizes using DetailView and FormMixin together. + """ + self.object = self.get_object() + form = self.get_form() + if form.is_valid(): + return self.form_valid(form) + else: + return self.form_invalid(form) + + def form_valid(self, form): + """The form is valid, save the authorizing official.""" + domain = self.get_object() + form.save() + + messages.success( + self.request, "The authorizing official for this domain has been updated." + ) + # superclass has the redirect + return super().form_valid(form) + + class DomainNameserversView(DomainPermission, FormMixin, DetailView): """Domain nameserver editing view.""" From d99a6da82f695c6c7115af1cf0286f250c981482 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 19 May 2023 12:30:59 -0400 Subject: [PATCH 08/37] Fix formatting and remove aria tag --- src/registrar/templates/includes/summary_item.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/registrar/templates/includes/summary_item.html b/src/registrar/templates/includes/summary_item.html index 170ec67cb..bcf8b7ea1 100644 --- a/src/registrar/templates/includes/summary_item.html +++ b/src/registrar/templates/includes/summary_item.html @@ -43,7 +43,7 @@
  • {{ item }}
  • {% empty %}
  • None
  • - {% endfor %}

    + {% endfor %} {% endif %} @@ -58,7 +58,7 @@ {% endif %} {% else %} -

    +

    {{ value }}

    {% endif %} @@ -66,7 +66,6 @@ {% if edit_link %}
    Edit {{ title }} From e17bca1a99d6e4af58ebc7678d5e1f1192122fa3 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 19 May 2023 12:33:44 -0400 Subject: [PATCH 09/37] Add conditional text for dns section, remove if gates --- src/registrar/templates/domain_detail.html | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/registrar/templates/domain_detail.html b/src/registrar/templates/domain_detail.html index 14ac10639..8dcef8a70 100644 --- a/src/registrar/templates/domain_detail.html +++ b/src/registrar/templates/domain_detail.html @@ -3,31 +3,31 @@ {% block domain_content %} {{ block.super }} -

    Active: {% if domain.is_active %}Yes{% else %}No{% endif %}

    - org type: {{domain.domain_info.organization_type}} +
    - {% url 'domain-nameservers' pk=domain.id as url %} - {% include "includes/summary_item.html" with title='DNS name servers' value=domain.nameservers list='true' edit_link=url %} + {% url 'domain-nameservers' pk=domain.id as url %} + {% if domain.nameservers %} + {% include "includes/summary_item.html" with title='DNS name servers' value=domain.nameservers list='true' edit_link=url %} + {% else %} +

    DNS name servers

    +

    No DNS name servers have been added yet. Before your domain can be used we’ll need information about your domain name servers.

    +
    Add DNS name servers + {% endif %} - {% url 'todo' as url %} - {% if domain.domain_info.organization_name %} + {% url 'todo' as url %} {% include "includes/summary_item.html" with title='Organization name and mailing address' value=domain.domain_info address='true' edit_link=url %} - {% endif %} - {% if domain.domain_info.authorizing_official %} {% url 'todo' as url %} {% include "includes/summary_item.html" with title='Authorizing official' value=domain.domain_info.authorizing_official contact='true' edit_link=url %} - {% endif %} - {% if domain.domain_info.submitter %} {% url 'todo' as url %} {% include "includes/summary_item.html" with title='Your contact information' value='---TODO---' edit_link=url %} - {% endif %} - {% url 'todo' as url %} - {% include "includes/summary_item.html" with title='Security email' value=domain.domain_info.security_email edit_link=url %} + {% url 'todo' as url %} + {% include "includes/summary_item.html" with title='Security email' value=domain.domain_info.security_email edit_link=url %} - {% url 'domain-users' pk=domain.id as url %} - {% include "includes/summary_item.html" with title='User management' users='true' value=domain.permissions.all edit_link=url %} + {% url 'domain-users' pk=domain.id as url %} + {% include "includes/summary_item.html" with title='User management' users='true' value=domain.permissions.all edit_link=url %} +
    {% endblock %} {# domain_content #} From aa58fe0f265f9b9a55f0ecbc00f0817d9c9ce11a Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 19 May 2023 12:34:49 -0400 Subject: [PATCH 10/37] Make h2 color default primary-dark --- .../assets/sass/_theme/_uswds-theme-custom-styles.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/registrar/assets/sass/_theme/_uswds-theme-custom-styles.scss b/src/registrar/assets/sass/_theme/_uswds-theme-custom-styles.scss index ff2614fb8..8c06730bf 100644 --- a/src/registrar/assets/sass/_theme/_uswds-theme-custom-styles.scss +++ b/src/registrar/assets/sass/_theme/_uswds-theme-custom-styles.scss @@ -77,6 +77,7 @@ h2 { font-weight: font-weight('semibold'); line-height: line-height('heading', 3); margin: units(4) 0 units(1); + color: color('primary-darker'); } .register-form-step > h1 { @@ -431,4 +432,4 @@ abbr[title] { @include at-media('tablet') { height: units('mobile'); } -} \ No newline at end of file +} From eb51173ab472fb1a026d413610054453c9ef443e Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 19 May 2023 12:44:36 -0400 Subject: [PATCH 11/37] Add security email section --- src/registrar/templates/domain_detail.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/registrar/templates/domain_detail.html b/src/registrar/templates/domain_detail.html index 8dcef8a70..97b15207a 100644 --- a/src/registrar/templates/domain_detail.html +++ b/src/registrar/templates/domain_detail.html @@ -23,8 +23,8 @@ {% url 'todo' as url %} {% include "includes/summary_item.html" with title='Your contact information' value='---TODO---' edit_link=url %} - {% url 'todo' as url %} - {% include "includes/summary_item.html" with title='Security email' value=domain.domain_info.security_email edit_link=url %} + {% url 'domain-security-email' pk=domain.id as url %} + {% include "includes/summary_item.html" with title='Security email' value=domain.security_email edit_link=url %} {% url 'domain-users' pk=domain.id as url %} {% include "includes/summary_item.html" with title='User management' users='true' value=domain.permissions.all edit_link=url %} From 0d5ca5bdcbda92ac4e97b48c4674076faeb63d1a Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 19 May 2023 12:47:21 -0400 Subject: [PATCH 12/37] Make domain overview sentance case in sidebar --- src/registrar/templates/domain_sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/templates/domain_sidebar.html b/src/registrar/templates/domain_sidebar.html index 46a87ba76..76877198b 100644 --- a/src/registrar/templates/domain_sidebar.html +++ b/src/registrar/templates/domain_sidebar.html @@ -8,7 +8,7 @@ - Domain Overview + Domain overview From 53de82a406afc0bcde97e9491c64c6b98fdb300e Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 19 May 2023 14:55:37 -0400 Subject: [PATCH 13/37] Remove extra spacing on single item lists --- src/registrar/templates/includes/summary_item.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/registrar/templates/includes/summary_item.html b/src/registrar/templates/includes/summary_item.html index bcf8b7ea1..3b9d555cd 100644 --- a/src/registrar/templates/includes/summary_item.html +++ b/src/registrar/templates/includes/summary_item.html @@ -36,7 +36,7 @@ {% elif list %} {% if value|length == 1 %} -

    {{ value | first }}

    +

    {{ value | first }}

    {% else %}