From bd0edf7203748fafdfae282a0d05422bce1d0796 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:29:03 -0600 Subject: [PATCH 01/40] Redirect and basic changes --- src/registrar/admin.py | 11 +++++ src/registrar/assets/sass/_theme/_admin.scss | 45 ++++++++++++++----- .../django/admin/domain_change_form.html | 1 + src/registrar/templates/domain_base.html | 29 ++++++++---- src/registrar/templates/domain_detail.html | 28 +++++++++--- src/registrar/templates/domain_sidebar.html | 21 ++++----- src/registrar/views/domain.py | 1 - src/registrar/views/utility/mixins.py | 16 +++++-- .../views/utility/permission_views.py | 16 ++++++- 9 files changed, 124 insertions(+), 44 deletions(-) diff --git a/src/registrar/admin.py b/src/registrar/admin.py index 96b8aaa33..a0894c203 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -160,6 +160,17 @@ class DomainAdmin(ListHeaderAdmin): return super().response_change(request, obj) + # Sets domain_id as a context var + def change_view(self, request, object_id, form_url="", extra_context=None): + extra_context = extra_context or {} + extra_context["domain_id"] = object_id + return super().change_view( + request, + object_id, + form_url, + extra_context=extra_context, + ) + class ContactAdmin(ListHeaderAdmin): diff --git a/src/registrar/assets/sass/_theme/_admin.scss b/src/registrar/assets/sass/_theme/_admin.scss index b87257344..204d335e9 100644 --- a/src/registrar/assets/sass/_theme/_admin.scss +++ b/src/registrar/assets/sass/_theme/_admin.scss @@ -1,7 +1,7 @@ @use "cisa_colors" as *; @use "uswds-core" as *; -// We'll use Django's CSS vars: https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#theming-support +// We'll use Django's CSS vars: https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#theming-support // and assign USWDS theme vars whenever possible // If needed (see below), we'll use the USWDS hex value // As a last resort, we'll use CISA colors to supplement the palette @@ -72,34 +72,34 @@ html[data-theme="light"] { @media (prefers-color-scheme: dark) { :root, html[data-theme="dark"] { - // Edit the primary to meet accessibility requ. + // Edit the primary to meet accessibility requ. --primary: #23485a; --primary-fg: #f7f7f7; - + --body-fg: #eeeeee; --body-bg: #121212; --body-quiet-color: #e0e0e0; --body-loud-color: #ffffff; - + --breadcrumbs-link-fg: #e0e0e0; --breadcrumbs-bg: var(--primary); - + --link-fg: #81d4fa; --link-hover-color: #4ac1f7; --link-selected-fg: #6f94c6; - + --hairline-color: #272727; --border-color: #353535; - + --error-fg: #e35f5f; --message-success-bg: #006b1b; --message-warning-bg: #583305; --message-error-bg: #570808; - + --darkened-bg: #212121; --selected-bg: #1b1b1b; --selected-row: #00363a; - + --close-button-bg: #333333; --close-button-hover-bg: #666666; } @@ -108,7 +108,7 @@ html[data-theme="light"] { .change-list .usa-table, .change-list .usa-table--striped tbody tr:nth-child(odd) td, .change-list .usa-table--borderless thead th, - .change-list .usa-table thead td, + .change-list .usa-table thead td, .change-list .usa-table thead th, body.dashboard, body.change-list, @@ -122,7 +122,7 @@ html[data-theme="dark"] { .change-list .usa-table, .change-list .usa-table--striped tbody tr:nth-child(odd) td, .change-list .usa-table--borderless thead th, - .change-list .usa-table thead td, + .change-list .usa-table thead td, .change-list .usa-table thead th, body.dashboard, body.change-list, @@ -163,10 +163,31 @@ table > caption > a { height: auto!important; } -// Keep th from collapsing +// Keep th from collapsing .min-width-25 { min-width: 25px; } .min-width-81 { min-width: 81px; } + +.buttonAdminPadding { + background: var(--button-bg); + padding: 10px 15px; + border: none; + border-radius: 4px; + color: var(--button-fg); + cursor: pointer; + transition: background 0.15s; + +} + +.submit-row input { + height: 2.1875rem; + line-height: 0.9375rem; +} + +a.button{ + font-size: 100% !important; + padding: 9px 15px !important; +} \ No newline at end of file diff --git a/src/registrar/templates/django/admin/domain_change_form.html b/src/registrar/templates/django/admin/domain_change_form.html index 5fa89f20a..e8eaeaf78 100644 --- a/src/registrar/templates/django/admin/domain_change_form.html +++ b/src/registrar/templates/django/admin/domain_change_form.html @@ -2,6 +2,7 @@ {% block field_sets %}
+ Edit domain
{{ block.super }} diff --git a/src/registrar/templates/domain_base.html b/src/registrar/templates/domain_base.html index ac1f8c7a9..41273fe92 100644 --- a/src/registrar/templates/domain_base.html +++ b/src/registrar/templates/domain_base.html @@ -5,11 +5,11 @@ {% block content %}
-
-

+

- Domain name: {{ domain.name }} + Domain name: {{ domain.name }}

@@ -19,16 +19,29 @@
- + {% if not is_analyst_or_superuser %} -

- Back to manage your domains -

-
+

+ Back to manage your domains +

+ + + {% elif is_analyst_or_superuser%} + + + +

+ Back to manage your domains +

+ +
+ {% endif %} {# messages block is under the back breadcrumb link #} {% if messages %} {% for message in messages %} diff --git a/src/registrar/templates/domain_detail.html b/src/registrar/templates/domain_detail.html index dd176c862..256e09f2b 100644 --- a/src/registrar/templates/domain_detail.html +++ b/src/registrar/templates/domain_detail.html @@ -4,24 +4,38 @@ {% block domain_content %} {{ block.super }}
- {% 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 %} + {% if domain.nameservers %} + {% if is_original_creator %} + {% include "includes/summary_item.html" with title='DNS name servers' value=domain.nameservers list='true' edit_link=url %} + {% else %} + {% include "includes/summary_item.html" with title='DNS name servers' value=domain.nameservers list='true' %} + {% endif %} {% else %}

DNS name servers

+ {% if is_original_creator %}

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 + Add DNS name servers + {% else %} +

No DNS name servers have been added yet.

+ {% endif %} {% endif %} {% url 'domain-org-name-address' pk=domain.id as url %} {% include "includes/summary_item.html" with title='Organization name and mailing address' value=domain.domain_info address='true' edit_link=url %} {% url 'domain-authorizing-official' pk=domain.id as url %} - {% include "includes/summary_item.html" with title='Authorizing official' value=domain.domain_info.authorizing_official contact='true' edit_link=url %} - + {% if is_original_creator %} + {% include "includes/summary_item.html" with title='Authorizing official' value=domain.domain_info.authorizing_official contact='true' edit_link=url %} + {% else %} + {% include "includes/summary_item.html" with title='Authorizing official' value=domain.domain_info.authorizing_official contact='true'%} + {% endif %} {% url 'domain-your-contact-information' pk=domain.id as url %} - {% include "includes/summary_item.html" with title='Your contact information' value=request.user.contact contact='true' edit_link=url %} + {% if is_original_creator %} + {% include "includes/summary_item.html" with title='Your contact information' value=request.user.contact contact='true' edit_link=url %} + {% else %} + {% include "includes/summary_item.html" with title='Contact information' value=request.user.contact contact='true' %} + {% endif %} {% 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 %} diff --git a/src/registrar/templates/domain_sidebar.html b/src/registrar/templates/domain_sidebar.html index 1e4cd1882..7b47a64aa 100644 --- a/src/registrar/templates/domain_sidebar.html +++ b/src/registrar/templates/domain_sidebar.html @@ -4,23 +4,23 @@