Merge branch 'main' of https://github.com/cisagov/manage.get.gov into es/code-review-update

This commit is contained in:
Erin Song 2025-01-02 10:17:26 -08:00
commit 3477915221
No known key found for this signature in database
46 changed files with 790 additions and 875 deletions

View file

@ -176,16 +176,7 @@ html[data-theme="dark"] {
color: var(--primary-fg); color: var(--primary-fg);
} }
// Reset the USWDS styles for alerts
@include at-media(desktop) {
.dashboard .usa-alert__body--widescreen {
padding-left: 4rem !important;
}
.dashboard .usa-alert__body--widescreen::before {
left: 1.5rem !important;
}
}
#branding h1, #branding h1,
h1, h2, h3, h1, h2, h3,

View file

@ -1,18 +1,21 @@
@use "uswds-core" as *; @use "uswds-core" as *;
@use "base" as *; @use "base" as *;
// Fixes some font size disparities with the Figma
// for usa-alert alert elements
.usa-alert {
.usa-alert__heading.larger-font-sizing {
font-size: units(3);
}
}
/*---------------- .usa-alert__text.measure-none {
Alert Layout max-width: measure(none);
-----------------*/ }
// The icon was off center for some reason // The icon was off center for some reason
// Fixes that issue // Fixes that issue
@include at-media(desktop) { @media (min-width: 64em){
// NOTE: !important is used because _font.scss overrides this
.usa-alert__body--widescreen {
max-width: $widescreen-max-width !important;
}
.usa-alert--warning{ .usa-alert--warning{
.usa-alert__body::before { .usa-alert__body::before {
left: 1rem !important; left: 1rem !important;
@ -21,29 +24,13 @@
.usa-alert__body.margin-left-1 { .usa-alert__body.margin-left-1 {
margin-left: 0.5rem!important; margin-left: 0.5rem!important;
} }
.usa-alert__body--widescreen::before {
left: 4rem !important;
}
.usa-alert__body--widescreen {
padding-left: 7rem!important;
}
} }
/*---------------- // NOTE: !important is used because _font.scss overrides this
Alert Fonts .usa-alert__body--widescreen {
-----------------*/ max-width: $widescreen-max-width !important;
// Fixes some font size disparities with the Figma
// for usa-alert alert elements
.usa-alert {
.usa-alert__heading.larger-font-sizing {
font-size: 1.5rem;
}
} }
/*----------------
Alert Coloring
-----------------*/
.usa-site-alert--hot-pink { .usa-site-alert--hot-pink {
.usa-alert { .usa-alert {
background-color: $hot-pink; background-color: $hot-pink;
@ -60,4 +47,3 @@
background-color: color('base-darkest'); background-color: color('base-darkest');
} }
} }

View file

@ -2,8 +2,6 @@
@use "cisa_colors" as *; @use "cisa_colors" as *;
$widescreen-max-width: 1920px; $widescreen-max-width: 1920px;
$widescreen-x-padding: 4.5rem;
$hot-pink: #FFC3F9; $hot-pink: #FFC3F9;
/* Styles for making visible to screen reader / AT users only. */ /* Styles for making visible to screen reader / AT users only. */
@ -254,15 +252,6 @@ abbr[title] {
max-width: $widescreen-max-width; max-width: $widescreen-max-width;
} }
// This is used in cases where we want to align content to widescreen margins
// but we don't want the content itself to have widescreen widths
@include at-media(desktop) {
.padding-x--widescreen {
padding-left: $widescreen-x-padding !important;
padding-right: $widescreen-x-padding !important;
}
}
.margin-right-neg-4px { .margin-right-neg-4px {
margin-right: -4px; margin-right: -4px;
} }
@ -277,7 +266,3 @@ abbr[title] {
height: 1.5em; height: 1.5em;
width: 1.5em; width: 1.5em;
} }
.maxw-fit-content {
max-width: fit-content;
}

View file

@ -6,21 +6,3 @@
.usa-identifier__container--widescreen { .usa-identifier__container--widescreen {
max-width: $widescreen-max-width !important; max-width: $widescreen-max-width !important;
} }
// NOTE: !important is used because we are overriding default
// USWDS paddings in a few locations
@include at-media(desktop) {
.grid-container--widescreen {
padding-left: $widescreen-x-padding !important;
padding-right: $widescreen-x-padding !important;
}
}
// matches max-width to equal the max-width of .grid-container
// used to trick the eye into thinking we have left-aligned a
// regular grid-container within a widescreen (see instances
// where is_widescreen_centered is used in the html).
.max-width--grid-container {
max-width: 960px;
}

View file

@ -110,8 +110,8 @@
} }
} }
.usa-nav__secondary { .usa-nav__secondary {
right: 1rem; // I don't know why USWDS has this at 2 rem, which puts it out of alignment
padding-right: $widescreen-x-padding; right: 3rem;
color: color('white'); color: color('white');
bottom: 4.3rem; bottom: 4.3rem;
.usa-nav-link, .usa-nav-link,

View file

@ -251,7 +251,7 @@ TEMPLATES = [
"registrar.context_processors.org_user_status", "registrar.context_processors.org_user_status",
"registrar.context_processors.add_path_to_context", "registrar.context_processors.add_path_to_context",
"registrar.context_processors.portfolio_permissions", "registrar.context_processors.portfolio_permissions",
"registrar.context_processors.is_widescreen_centered", "registrar.context_processors.is_widescreen_mode",
], ],
}, },
}, },

View file

@ -109,21 +109,31 @@ def portfolio_permissions(request):
return portfolio_context return portfolio_context
def is_widescreen_centered(request): def is_widescreen_mode(request):
include_paths = [ widescreen_paths = [] # If this list is meant to include specific paths, populate it.
portfolio_widescreen_paths = [
"/domains/", "/domains/",
"/requests/", "/requests/",
"/members/", "/request/",
"/no-organization-requests/",
"/no-organization-domains/",
"/domain-request/",
] ]
# widescreen_paths can be a bear as it trickles down sub-urls. exclude_paths gives us a way out.
exclude_paths = [ exclude_paths = [
"/domains/edit", "/domains/edit",
"members/new-member/",
] ]
is_excluded = any(exclude_path in request.path for exclude_path in exclude_paths) # Check if the current path matches a widescreen path or the root path.
is_widescreen = any(path in request.path for path in widescreen_paths) or request.path == "/"
# Check if the current path matches a path in included_paths or the root path. # Check if the user is an organization user and the path matches portfolio paths.
is_widescreen_centered = any(path in request.path for path in include_paths) or request.path == "/" is_portfolio_widescreen = (
hasattr(request.user, "is_org_user")
and request.user.is_org_user(request)
and any(path in request.path for path in portfolio_widescreen_paths)
and not any(exclude_path in request.path for exclude_path in exclude_paths)
)
# Return a dictionary with the widescreen mode status. # Return a dictionary with the widescreen mode status.
return {"is_widescreen_centered": is_widescreen_centered and not is_excluded} return {"is_widescreen_mode": is_widescreen or is_portfolio_widescreen}

View file

@ -5,8 +5,8 @@
{% block title %}{% translate "Unauthorized | " %}{% endblock %} {% block title %}{% translate "Unauthorized | " %}{% endblock %}
{% block content %} {% block content %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container {% if is_widescreen_mode %} grid-container--widescreen{% endif %}">
<div class="grid-row grow-gap {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-row grow-gap">
<div class="tablet:grid-col-6 usa-prose margin-bottom-3"> <div class="tablet:grid-col-6 usa-prose margin-bottom-3">
<h1> <h1>
{% translate "You are not authorized to view this page" %} {% translate "You are not authorized to view this page" %}

View file

@ -5,8 +5,8 @@
{% block title %}{% translate "Forbidden | " %}{% endblock %} {% block title %}{% translate "Forbidden | " %}{% endblock %}
{% block content %} {% block content %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container {% if is_widescreen_mode %} grid-container--widescreen{% endif %}">
<div class="grid-row grow-gap {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-row grow-gap">
<div class="tablet:grid-col-6 usa-prose margin-bottom-3"> <div class="tablet:grid-col-6 usa-prose margin-bottom-3">
<h1> <h1>
{% translate "You're not authorized to view this page." %} {% translate "You're not authorized to view this page." %}

View file

@ -5,8 +5,8 @@
{% block title %}{% translate "Page not found | " %}{% endblock %} {% block title %}{% translate "Page not found | " %}{% endblock %}
{% block content %} {% block content %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container {% if is_widescreen_mode %} grid-container--widescreen{% endif %}">
<div class="grid-row grid-gap {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-row grid-gap">
<div class="tablet:grid-col-6 usa-prose margin-bottom-3"> <div class="tablet:grid-col-6 usa-prose margin-bottom-3">
<h1> <h1>
{% translate "We couldnt find that page" %} {% translate "We couldnt find that page" %}

View file

@ -5,8 +5,8 @@
{% block title %}{% translate "Server error | " %}{% endblock %} {% block title %}{% translate "Server error | " %}{% endblock %}
{% block content %} {% block content %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container {% if is_widescreen_mode %} grid-container--widescreen{% endif %}">
<div class="grid-row grid-gap {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-row grid-gap">
<div class="tablet:grid-col-6 usa-prose margin-bottom-3"> <div class="tablet:grid-col-6 usa-prose margin-bottom-3">
<h1> <h1>
{% translate "We're having some trouble." %} {% translate "We're having some trouble." %}

View file

@ -39,7 +39,7 @@
{% for model in app.models %} {% for model in app.models %}
<tr class="model-{{ model.object_name|lower }}{% if model.admin_url in request.path|urlencode %} current-model{% endif %}"> <tr class="model-{{ model.object_name|lower }}{% if model.admin_url in request.path|urlencode %} current-model{% endif %}">
{% if model.admin_url %} {% if model.admin_url %}
<th scope="row"><a href="{{ model.admin_url }}"{% if model.admin_url in request.path|urlencode %} aria-current="page"{% endif %}">{{ model.name }}</a></th> <th scope="row"><a href="{{ model.admin_url }}"{% if model.admin_url in request.path|urlencode %} aria-current="page"{% endif %}>{{ model.name }}</a></th>
{% else %} {% else %}
<th scope="row">{{ model.name }}</th> <th scope="row">{{ model.name }}</th>
{% endif %} {% endif %}

View file

@ -61,7 +61,7 @@ https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/
{% if field.field.help_text %} {% if field.field.help_text %}
{# .gov override #} {# .gov override #}
{% block help_text %} {% block help_text %}
<div class="help"{% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}"> <div class="help"{% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}>
<div>{{ field.field.help_text|safe }}</div> <div>{{ field.field.help_text|safe }}</div>
</div> </div>
{% endblock help_text %} {% endblock help_text %}

View file

@ -43,7 +43,7 @@
<select name="selected_user" id="selected_user" class="admin-combobox margin-top-0" onchange="this.form.submit()"> <select name="selected_user" id="selected_user" class="admin-combobox margin-top-0" onchange="this.form.submit()">
<option value="">Select a user</option> <option value="">Select a user</option>
{% for user in other_users %} {% for user in other_users %}
<option value="{{ user.pk }}" {% if selected_user and user.pk == selected_user.pk %}selected{% endif %}"> <option value="{{ user.pk }}" {% if selected_user and user.pk == selected_user.pk %}selected{% endif %}>
{{ user.first_name }} {{ user.last_name }} {{ user.first_name }} {{ user.last_name }}
</option> </option>
{% endfor %} {% endfor %}

View file

@ -97,7 +97,7 @@
<section class="usa-banner" aria-label="Official website of the United States government"> <section class="usa-banner" aria-label="Official website of the United States government">
<div class="usa-accordion"> <div class="usa-accordion">
<header class="usa-banner__header"> <header class="usa-banner__header">
<div class="usa-banner__inner usa-banner__inner--widescreen padding-x--widescreen"> <div class="usa-banner__inner {% if is_widescreen_mode %} usa-banner__inner--widescreen {% endif %}">
<div class="grid-col-auto"> <div class="grid-col-auto">
<img class="usa-banner__header-flag" src="{% static 'img/us_flag_small.png' %}" alt="U.S. flag" /> <img class="usa-banner__header-flag" src="{% static 'img/us_flag_small.png' %}" alt="U.S. flag" />
</div> </div>
@ -113,7 +113,7 @@
</button> </button>
</div> </div>
</header> </header>
<div class="usa-banner__content usa-accordion__content padding-x--widescreen margin-x-0" id="gov-banner-default"> <div class="usa-banner__content usa-accordion__content" id="gov-banner-default">
<div class="grid-row grid-gap-lg"> <div class="grid-row grid-gap-lg">
<div class="usa-banner__guidance tablet:grid-col-6"> <div class="usa-banner__guidance tablet:grid-col-6">
<img class="usa-banner__icon usa-media-block__img" src="{% static 'img/icon-dot-gov.svg' %}" role="img" <img class="usa-banner__icon usa-media-block__img" src="{% static 'img/icon-dot-gov.svg' %}" role="img"
@ -159,14 +159,14 @@
{% block wrapper %} {% block wrapper %}
{% block wrapperdiv %} {% block wrapperdiv %}
<div id="wrapper" class="wrapper--padding-top-6"> <div id="wrapper">
{% endblock wrapperdiv %} {% endblock wrapperdiv %}
{% block messages %} {% block messages %}
{% if messages %} {% if messages %}
<ul class="messages"> <ul class="messages">
{% for message in messages %} {% for message in messages %}
{% if 'base' in message.extra_tags %} {% if 'base' in message.extra_tags %}
<li{% if message.tags %} class="{{ message.tags }}" {% endif %}"> <li{% if message.tags %} class="{{ message.tags }}" {% endif %}>
{{ message }} {{ message }}
</li> </li>
{% endif %} {% endif %}

View file

@ -11,7 +11,7 @@
{% if messages %} {% if messages %}
<ul class="messages"> <ul class="messages">
{% for message in messages %} {% for message in messages %}
<li {% if message.tags %} class="{{ message.tags }}" {% endif %}"> <li {% if message.tags %} class="{{ message.tags }}" {% endif %}>
{{ message }} {{ message }}
</li> </li>
{% endfor %} {% endfor %}

View file

@ -1,6 +1,6 @@
{% comment %} This view provides a detail button that can be used to show/hide content {% endcomment %} {% comment %} This view provides a detail button that can be used to show/hide content {% endcomment %}
<details class="margin-top-1 dja-detail-table" aria-role="button" {% if start_open %}open{% else %}closed{% endif %}"> <details class="margin-top-1 dja-detail-table" aria-role="button" {% if start_open %}open{% else %}closed{% endif %}>
<summary class="padding-1 padding-left-0 dja-details-summary">Details</summary> <summary class="padding-1 padding-left-0 dja-details-summary">Details</summary>
<div class="grid-container margin-left-0 padding-left-0 padding-right-0 dja-details-contents"> <div class="grid-container margin-left-0 padding-left-0 padding-right-0 dja-details-contents">
{% block detail_content %} {% block detail_content %}

View file

@ -11,7 +11,7 @@
{% endblock %} {% endblock %}
{% block help_text %} {% block help_text %}
<div class="help margin-bottom-1" {% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}"> <div class="help margin-bottom-1" {% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}>
{% if field.field.name == "state" %} {% if field.field.name == "state" %}
<div>{{ state_help_message }}</div> <div>{{ state_help_message }}</div>
{% else %} {% else %}

View file

@ -6,14 +6,14 @@
<ul class="mulitple-choice"> <ul class="mulitple-choice">
{% for choice in choices %} {% for choice in choices %}
{% if choice.reset %} {% if choice.reset %}
<li{% if choice.selected %} class="selected"{% endif %}"> <li{% if choice.selected %} class="selected"{% endif %}>
<a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">{{ choice.display }}</a> <a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">{{ choice.display }}</a>
</li> </li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for choice in choices %} {% for choice in choices %}
{% if not choice.reset %} {% if not choice.reset %}
<li{% if choice.selected %} class="selected"{% endif %}"> <li{% if choice.selected %} class="selected"{% endif %}>
{% if choice.selected and choice.exclude_query_string %} {% if choice.selected and choice.exclude_query_string %}
<a class="choice-filter choice-filter--checked" href="{{ choice.exclude_query_string|iriencode }}">{{ choice.display }} <a class="choice-filter choice-filter--checked" href="{{ choice.exclude_query_string|iriencode }}">{{ choice.display }}
<svg class="usa-icon position-absolute z-0 left-0" aria-hidden="true" focusable="false" role="img" width="24" height="24"> <svg class="usa-icon position-absolute z-0 left-0" aria-hidden="true" focusable="false" role="img" width="24" height="24">

View file

@ -4,10 +4,10 @@
{% block title %}{{ domain.name }} | {% endblock %} {% block title %}{{ domain.name }} | {% endblock %}
{% block content %} {% block content %}
<div class="grid-container grid-container--widescreen"> <div class="grid-container">
<div class="grid-row grid-gap {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-row grid-gap">
<div class="tablet:grid-col-3 "> <div class="tablet:grid-col-3">
<p class="font-body-md margin-top-0 margin-bottom-2 <p class="font-body-md margin-top-0 margin-bottom-2
text-primary-darker text-semibold domain-name-wrap" text-primary-darker text-semibold domain-name-wrap"
> >

View file

@ -3,13 +3,13 @@
{% block title %}{{form_titles|get_item:steps.current}} | Request a .gov | {% endblock %} {% block title %}{{form_titles|get_item:steps.current}} | Request a .gov | {% endblock %}
{% block content %} {% block content %}
<div class="grid-container grid-container--widescreen"> <div class="grid-container">
<div class="grid-row grid-gap {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-row grid-gap">
<div class="tablet:grid-col-3"> <div class="tablet:grid-col-3">
{% include 'domain_request_sidebar.html' %} {% include 'domain_request_sidebar.html' %}
</div> </div>
<div class="tablet:grid-col-9"> <div class="tablet:grid-col-9">
<main id="main-content" class="register-form-step"> <main id="main-content" class="grid-container register-form-step">
<input type="hidden" class="display-none" id="wizard-domain-request-id" value="{{domain_request_id}}"/> <input type="hidden" class="display-none" id="wizard-domain-request-id" value="{{domain_request_id}}"/>
{% if steps.current == steps.first %} {% if steps.current == steps.first %}
{% if portfolio %} {% if portfolio %}

View file

@ -4,9 +4,8 @@
{% block title %} Start a request | {% endblock %} {% block title %} Start a request | {% endblock %}
{% block content %} {% block content %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container">
<div class="grid-row {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-col desktop:grid-offset-2 desktop:grid-col-8">
<div class="grid-col {% if is_widescreen_centered %}desktop:grid-offset-2 {% endif %} desktop:grid-col-8">
<form class="usa-form usa-form--extra-large" method="post" novalidate> <form class="usa-form usa-form--extra-large" method="post" novalidate>
{% csrf_token %} {% csrf_token %}
@ -26,7 +25,7 @@
{% include "includes/profile_information.html" with user=user%} {% include "includes/profile_information.html" with user=user%}
{% block form_buttons %} {% block form_buttons %}
<div class="stepnav"> <div class="stepnav">
<button <button
type="submit" type="submit"
@ -35,7 +34,7 @@
class="usa-button" class="usa-button"
>Continue</button> >Continue</button>
</div> </div>
{% endblock %} {% endblock %}
</form> </form>

View file

@ -8,20 +8,18 @@
{% endblock wrapperdiv %} {% endblock wrapperdiv %}
{% block content %} {% block content %}
<div class="grid-container grid-container--widescreen"> <div class="grid-container">
<div class="grid-row {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-col desktop:grid-offset-2 desktop:grid-col-8">
<div class="grid-col {% if is_widescreen_centered %}desktop:grid-offset-2 {% endif %} desktop:grid-col-8">
<h1>Withdraw request for {{ DomainRequest.requested_domain.name }}?</h1> <h1>Withdraw request for {{ DomainRequest.requested_domain.name }}?</h1>
<p>If you withdraw your request, we won't review it. Once you withdraw your request, you can edit it and submit it again. </p> <p>If you withdraw your request, we won't review it. Once you withdraw your request, you can edit it and submit it again. </p>
<p><a href="{% url 'domain-request-withdrawn' DomainRequest.id %}" class="usa-button withdraw">Withdraw request</a> <p><a href="{% url 'domain-request-withdrawn' DomainRequest.id %}" class="usa-button withdraw">Withdraw request</a>
<a href="{% url 'domain-request-status' DomainRequest.id %}">Cancel</a></p> <a href="{% url 'domain-request-status' DomainRequest.id %}">Cancel</a></p>
</div> </div>
</div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -18,7 +18,7 @@
<li class="usa-sidenav__item"> <li class="usa-sidenav__item">
{% url 'domain-dns' pk=domain.id as url %} {% url 'domain-dns' pk=domain.id as url %}
<a href="{{ url }}" {% if request.path|startswith:url %}class="usa-current"{% endif %}"> <a href="{{ url }}" {% if request.path|startswith:url %}class="usa-current"{% endif %}>
DNS DNS
</a> </a>
{% if request.path|startswith:url %} {% if request.path|startswith:url %}

View file

@ -5,12 +5,12 @@
{% block title %} Home | {% endblock %} {% block title %} Home | {% endblock %}
{% block content %} {% block content %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container {% if is_widescreen_mode %} grid-container--widescreen{% endif %}">
{% if user.is_authenticated %} {% if user.is_authenticated %}
{# the entire logged in page goes here #} {# the entire logged in page goes here #}
{% block homepage_content %} {% block homepage_content %}
<div class="tablet:grid-col-11 desktop:grid-col-10 {% if is_widescreen_centered %}tablet:grid-offset-1{% endif %}"> <div class="tablet:grid-col-11 desktop:grid-col-10 tablet:grid-offset-1">
{% block messages %} {% block messages %}
{% include "includes/form_messages.html" %} {% include "includes/form_messages.html" %}
{% endblock %} {% endblock %}

View file

@ -1,6 +1,6 @@
<div class="margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <div class="margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert usa-alert--error"> <div class="usa-alert usa-alert--error">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<h4 class="usa-alert__heading"> <h4 class="usa-alert__heading">
Header Header
</h4> </h4>

View file

@ -1,6 +1,6 @@
<section class="usa-site-alert usa-site-alert--info margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <section class="usa-site-alert usa-site-alert--info margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert"> <div class="usa-alert">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<h4 class="usa-alert__heading"> <h4 class="usa-alert__heading">
Header Header
</h4> </h4>

View file

@ -1,6 +1,6 @@
<section class="usa-site-alert usa-site-alert--emergency usa-site-alert--hot-pink margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <section class="usa-site-alert usa-site-alert--emergency usa-site-alert--hot-pink margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert"> <div class="usa-alert">
<div class="usa-alert__body {% if add_body_class %}{{ add_body_class }}{% endif %} usa-alert__body--widescreen"> <div class="usa-alert__body {% if add_body_class %}{{ add_body_class }}{% endif %} {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<p class="usa-alert__text maxw-none"> <p class="usa-alert__text maxw-none">
<strong>Attention:</strong> You are on a test site. <strong>Attention:</strong> You are on a test site.
</p> </p>

View file

@ -1,6 +1,6 @@
<section class="usa-site-alert usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <section class="usa-site-alert usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert"> <div class="usa-alert">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<h3 class="usa-alert__heading"> <h3 class="usa-alert__heading">
Service disruption Service disruption
</h3> </h3>

View file

@ -1,6 +1,6 @@
<section class="usa-site-alert usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <section class="usa-site-alert usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert"> <div class="usa-alert">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<h3 class="usa-alert__heading"> <h3 class="usa-alert__heading">
Header here Header here
</h3> </h3>

View file

@ -1,6 +1,6 @@
<section class="usa-site-alert usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <section class="usa-site-alert usa-site-alert--emergency margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert"> <div class="usa-alert">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<h3 class="usa-alert__heading"> <h3 class="usa-alert__heading">
System outage System outage
</h3> </h3>

View file

@ -1,6 +1,6 @@
<div class="margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <div class="margin-y-0 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert usa-alert--warning"> <div class="usa-alert usa-alert--warning">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<h4 class="usa-alert__heading"> <h4 class="usa-alert__heading">
Header Header
</h4> </h4>

View file

@ -1,8 +1,7 @@
{% load custom_filters %} {% load custom_filters %}
{% load static url_helpers %} {% load static url_helpers %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container">
<div class="grid-row {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-col desktop:grid-offset-2 desktop:grid-col-8">
<div class="grid-col {% if is_widescreen_centered %}desktop:grid-offset-2 {% endif %} desktop:grid-col-8">
{% block breadcrumb %} {% block breadcrumb %}
{% if portfolio %} {% if portfolio %}
{% url 'domain-requests' as url %} {% url 'domain-requests' as url %}
@ -140,7 +139,7 @@
{% endblock modify_request %} {% endblock modify_request %}
</div> </div>
<div class="grid-col {% if is_widescreen_centered %}desktop:grid-offset-2 maxw-tablet{% endif %}"> <div class="grid-col desktop:grid-offset-2 maxw-tablet">
{% block request_summary_header %} {% block request_summary_header %}
<h2 class="text-primary-darker"> Summary of your domain request </h2> <h2 class="text-primary-darker"> Summary of your domain request </h2>
{% endblock request_summary_header%} {% endblock request_summary_header%}
@ -234,5 +233,4 @@
{% endwith %} {% endwith %}
{% endblock request_summary%} {% endblock request_summary%}
</div> </div>
</div>
</main> </main>

View file

@ -4,8 +4,8 @@
{% url 'get_domain_requests_json' as url %} {% url 'get_domain_requests_json' as url %}
<span id="get_domain_requests_json_url" class="display-none">{{url}}</span> <span id="get_domain_requests_json_url" class="display-none">{{url}}</span>
<section class="section-outlined domain-requests {% if portfolio %}section-outlined--border-base-light{% endif %}" id="domain-requests"> <section class="section-outlined domain-requests{% if portfolio %} section-outlined--border-base-light{% endif %}" id="domain-requests">
<div class="section-outlined__header margin-bottom-3 {% if not portfolio %}section-outlined__header--no-portfolio justify-content-space-between{% else %} grid-row{% endif %}"> <div class="section-outlined__header margin-bottom-3 {% if not portfolio %} section-outlined__header--no-portfolio justify-content-space-between{% else %} grid-row{% endif %}">
{% if not portfolio %} {% if not portfolio %}
<h2 id="domain-requests-header" class="display-inline-block">Domain requests</h2> <h2 id="domain-requests-header" class="display-inline-block">Domain requests</h2>
{% else %} {% else %}
@ -13,7 +13,7 @@
<span id="portfolio-js-value" data-portfolio="{{ portfolio.id }}"></span> <span id="portfolio-js-value" data-portfolio="{{ portfolio.id }}"></span>
{% endif %} {% endif %}
<div class="section-outlined__search section-outlined__search--widescreen {% if portfolio %}mobile:grid-col-12 desktop:grid-col-6{% endif %}"> <div class="section-outlined__search {% if portfolio %} mobile:grid-col-12 desktop:grid-col-6{% endif %} {% if is_widescreen_mode %} section-outlined__search--widescreen {% endif %}">
<section aria-label="Domain requests search component" class="margin-top-2"> <section aria-label="Domain requests search component" class="margin-top-2">
<form class="usa-search usa-search--small" method="POST" role="search"> <form class="usa-search usa-search--small" method="POST" role="search">
{% csrf_token %} {% csrf_token %}

View file

@ -12,7 +12,7 @@
{% if has_domain_renewal_flag and num_expiring_domains > 0 and has_any_domains_portfolio_permission %} {% if has_domain_renewal_flag and num_expiring_domains > 0 and has_any_domains_portfolio_permission %}
<section class="usa-site-alert usa-site-alert--info margin-bottom-2 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <section class="usa-site-alert usa-site-alert--info margin-bottom-2 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert"> <div class="usa-alert">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<p class="usa-alert__text maxw-none"> <p class="usa-alert__text maxw-none">
{% if num_expiring_domains == 1%} {% if num_expiring_domains == 1%}
One domain will expire soon. Go to "Manage" to renew the domain. <a href="#" id="link-expiring-domains" class="usa-link">Show expiring domain.</a> One domain will expire soon. Go to "Manage" to renew the domain. <a href="#" id="link-expiring-domains" class="usa-link">Show expiring domain.</a>
@ -33,7 +33,7 @@
<!-- Embedding the portfolio value in a data attribute --> <!-- Embedding the portfolio value in a data attribute -->
<span id="portfolio-js-value" data-portfolio="{{ portfolio.id }}"></span> <span id="portfolio-js-value" data-portfolio="{{ portfolio.id }}"></span>
{% endif %} {% endif %}
<div class="section-outlined__search section-outlined__search--widescreen {% if portfolio %}mobile:grid-col-12 desktop:grid-col-6{% endif %}"> <div class="section-outlined__search {% if portfolio %} mobile:grid-col-12 desktop:grid-col-6{% endif %} {% if is_widescreen_mode %} section-outlined__search--widescreen {% endif %}">
<section aria-label="Domains search component" class="margin-top-2"> <section aria-label="Domains search component" class="margin-top-2">
<form class="usa-search usa-search--small" method="POST" role="search"> <form class="usa-search usa-search--small" method="POST" role="search">
{% csrf_token %} {% csrf_token %}
@ -78,7 +78,7 @@
{% if has_domain_renewal_flag and num_expiring_domains > 0 and not portfolio %} {% if has_domain_renewal_flag and num_expiring_domains > 0 and not portfolio %}
<section class="usa-site-alert usa-site-alert--info margin-bottom-2 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert"> <section class="usa-site-alert usa-site-alert--info margin-bottom-2 {% if add_class %}{{ add_class }}{% endif %}" aria-label="Site alert">
<div class="usa-alert"> <div class="usa-alert">
<div class="usa-alert__body usa-alert__body--widescreen"> <div class="usa-alert__body {% if is_widescreen_mode %}usa-alert__body--widescreen{% endif %}">
<p class="usa-alert__text maxw-none"> <p class="usa-alert__text maxw-none">
{% if num_expiring_domains == 1%} {% if num_expiring_domains == 1%}
One domain will expire soon. Go to "Manage" to renew the domain. <a href="#" id="link-expiring-domains" class="usa-link">Show expiring domain.</a> One domain will expire soon. Go to "Manage" to renew the domain. <a href="#" id="link-expiring-domains" class="usa-link">Show expiring domain.</a>

View file

@ -3,7 +3,7 @@
<footer class="usa-footer"> <footer class="usa-footer">
<div class="usa-footer__secondary-section"> <div class="usa-footer__secondary-section">
<div class="grid-container grid-container--widescreen"> <div class="grid-container {% if is_widescreen_mode %} grid-container--widescreen{% endif %}">
<div class="grid-row grid-gap"> <div class="grid-row grid-gap">
<div <div
class=" class="
@ -24,7 +24,7 @@
<div class="usa-footer__contact-links <div class="usa-footer__contact-links
mobile-lg:grid-col-6 flex-align-self-center" mobile-lg:grid-col-6 flex-align-self-center"
> >
<address class="usa-footer__address maxw-none"> <address class="usa-footer__address">
<div class="usa-footer__contact-info grid-row grid-gap-md"> <div class="usa-footer__contact-info grid-row grid-gap-md">
{% if show_manage_your_domains %} {% if show_manage_your_domains %}
<div class="grid-col-auto"> <div class="grid-col-auto">
@ -51,7 +51,7 @@
class="usa-identifier__section usa-identifier__section--masthead" class="usa-identifier__section usa-identifier__section--masthead"
aria-label="Agency identifier" aria-label="Agency identifier"
> >
<div class="usa-identifier__container usa-identifier__container--widescreen padding-x--widescreen"> <div class="usa-identifier__container {% if is_widescreen_mode %} usa-identifier__container--widescreen {% endif %}">
<div class="usa-identifier__logos"> <div class="usa-identifier__logos">
<a rel="noopener noreferrer" target="_blank" href="https://www.cisa.gov" class="usa-identifier__logo" <a rel="noopener noreferrer" target="_blank" href="https://www.cisa.gov" class="usa-identifier__logo"
><img ><img
@ -77,7 +77,7 @@
class="usa-identifier__section usa-identifier__section--required-links" class="usa-identifier__section usa-identifier__section--required-links"
aria-label="Important links" aria-label="Important links"
> >
<div class="usa-identifier__container usa-identifier__container--widescreen padding-x--widescreen"> <div class="usa-identifier__container {% if is_widescreen_mode %} usa-identifier__container--widescreen {% endif %}">
<ul class="usa-identifier__required-links-list"> <ul class="usa-identifier__required-links-list">
<li class="usa-identifier__required-links-item"> <li class="usa-identifier__required-links-item">
<a rel="noopener noreferrer" target="_blank" href="{% public_site_url 'about/' %}" <a rel="noopener noreferrer" target="_blank" href="{% public_site_url 'about/' %}"
@ -119,7 +119,7 @@
class="usa-identifier__section usa-identifier__section--usagov" class="usa-identifier__section usa-identifier__section--usagov"
aria-label="U.S. government information and services" aria-label="U.S. government information and services"
> >
<div class="usa-identifier__container usa-identifier__container--widescreen padding-x--widescreen"> <div class="usa-identifier__container {% if is_widescreen_mode %} usa-identifier__container--widescreen {% endif %}">
<div class="usa-identifier__usagov-description"> <div class="usa-identifier__usagov-description">
Looking for U.S. government information and services? Looking for U.S. government information and services?
</div> </div>

View file

@ -1,7 +1,7 @@
{% load static %} {% load static %}
<header class="usa-header usa-header--basic"> <header class="usa-header usa-header--basic">
<div class="usa-nav-container usa-nav-container--widescreen padding-x--widescreen"> <div class="usa-nav-container {% if is_widescreen_mode %} usa-nav-container--widescreen {% endif %}">
<div class="usa-navbar"> <div class="usa-navbar">
{% include "includes/gov_extended_logo.html" with logo_clickable=logo_clickable %} {% include "includes/gov_extended_logo.html" with logo_clickable=logo_clickable %}
<button type="button" class="usa-menu-btn">Menu</button> <button type="button" class="usa-menu-btn">Menu</button>

View file

@ -2,13 +2,13 @@
{% load custom_filters %} {% load custom_filters %}
<header class="usa-header usa-header--extended"> <header class="usa-header usa-header--extended">
<div class="usa-navbar usa-navbar--widescreen padding-x--widescreen"> <div class="usa-navbar {% if is_widescreen_mode %} usa-navbar--widescreen {% endif %}">
{% include "includes/gov_extended_logo.html" with logo_clickable=logo_clickable %} {% include "includes/gov_extended_logo.html" with logo_clickable=logo_clickable %}
<button type="button" class="usa-menu-btn">Menu</button> <button type="button" class="usa-menu-btn">Menu</button>
</div> </div>
{% block usa_nav %} {% block usa_nav %}
<nav class="usa-nav" aria-label="Primary navigation"> <nav class="usa-nav" aria-label="Primary navigation">
<div class="usa-nav__inner usa-nav__inner--widescreen padding-x--widescreen"> <div class="usa-nav__inner {% if is_widescreen_mode %} usa-nav__inner--widescreen {% endif %}">
<button type="button" class="usa-nav__close"> <button type="button" class="usa-nav__close">
<img src="{%static 'img/usa-icons/close.svg'%}" role="img" alt="Close" /> <img src="{%static 'img/usa-icons/close.svg'%}" role="img" alt="Close" />
</button> </button>

View file

@ -8,7 +8,7 @@
<section class="section-outlined members margin-top-0 section-outlined--border-base-light" id="members"> <section class="section-outlined members margin-top-0 section-outlined--border-base-light" id="members">
<div class="section-outlined__header margin-bottom-3 grid-row"> <div class="section-outlined__header margin-bottom-3 grid-row">
<!-- ---------- SEARCH ---------- --> <!-- ---------- SEARCH ---------- -->
<div class="section-outlined__search mobile:grid-col-12 desktop:grid-col-6 section-outlined__search--widescreen"> <div class="section-outlined__search mobile:grid-col-12 desktop:grid-col-6 {% if is_widescreen_mode %} section-outlined__search--widescreen {% endif %}">
<section aria-label="Members search component" class="margin-top-2"> <section aria-label="Members search component" class="margin-top-2">
<form class="usa-search usa-search--small" method="POST" role="search"> <form class="usa-search usa-search--small" method="POST" role="search">
{% csrf_token %} {% csrf_token %}

View file

@ -1,8 +1,7 @@
{% load custom_filters %} {% load custom_filters %}
{% load static url_helpers %} {% load static url_helpers %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container">
<div class="grid-row {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-col desktop:grid-offset-2 desktop:grid-col-8">
<div class="grid-col desktop:grid-col-8 {% if is_widescreen_centered %}desktop:grid-offset-2{% endif %}">
{% block breadcrumb %} {% block breadcrumb %}
{% if portfolio %} {% if portfolio %}
{% url 'domain-requests' as url %} {% url 'domain-requests' as url %}
@ -140,7 +139,7 @@
{% endblock modify_request %} {% endblock modify_request %}
</div> </div>
<div class="grid-col {% if is_widescreen_centered %}desktop:grid-offset-2 maxw-tablet{% endif %}"> <div class="grid-col desktop:grid-offset-2 maxw-tablet">
{% block request_summary_header %} {% block request_summary_header %}
<h2 class="text-primary-darker"> Summary of your domain request </h2> <h2 class="text-primary-darker"> Summary of your domain request </h2>
{% endblock request_summary_header%} {% endblock request_summary_header%}
@ -238,5 +237,4 @@
{% endif %} {% endif %}
{% endblock request_summary%} {% endblock request_summary%}
</div> </div>
</div>
</main> </main>

View file

@ -1,3 +1,3 @@
<p class="{% if not remove_margin_top %}margin-top-3{% endif %}"> <p class="{% if not remove_margin_top %}margin-top-3 {% endif %}">
<em>Required fields are marked with an asterisk (<abbr class="usa-hint usa-hint--required" title="required">*</abbr>).</em> <em>Required fields are marked with an asterisk (<abbr class="usa-hint usa-hint--required" title="required">*</abbr>).</em>
</p> </p>

View file

@ -4,12 +4,11 @@
<div id="wrapper" class="{% block wrapper_class %}wrapper--padding-top-6{% endblock %}"> <div id="wrapper" class="{% block wrapper_class %}wrapper--padding-top-6{% endblock %}">
{% block content %} {% block content %}
<main class="grid-container grid-container--widescreen"> <main class="grid-container {% if is_widescreen_mode %} grid-container--widescreen{% endif %}">
{% if user.is_authenticated %} {% if user.is_authenticated %}
{# the entire logged in page goes here #} {# the entire logged in page goes here #}
<div class="grid-row {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="tablet:grid-col-11 desktop:grid-col-10 tablet:grid-offset-1">
<div class="tablet:grid-col-11 desktop:grid-col-10 {% if is_widescreen_centered %}tablet:grid-offset-1{% endif %}">
{% block messages %} {% block messages %}
{% include "includes/form_messages.html" %} {% include "includes/form_messages.html" %}
{% endblock %} {% endblock %}
@ -25,8 +24,6 @@
</a></p> </a></p>
{% endif %} {% endif %}
</div>
</main> </main>
{% endblock content%} {% endblock content%}

View file

@ -11,9 +11,8 @@ Edit your User Profile |
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<main id="main-content" class="grid-container grid-container--widescreen"> <main id="main-content" class="grid-container">
<div class="grid-row {% if not is_widescreen_centered %}max-width--grid-container{% endif %}"> <div class="grid-col desktop:grid-offset-2 desktop:grid-col-8">
<div class="desktop:grid-col-8">
{% if messages %} {% if messages %}
{% for message in messages %} {% for message in messages %}
<div class="usa-alert usa-alert--{{ message.tags }} usa-alert--slim margin-bottom-3"> <div class="usa-alert usa-alert--{{ message.tags }} usa-alert--slim margin-bottom-3">
@ -91,12 +90,11 @@ Edit your User Profile |
{% endblock content %} {% endblock content %}
{% block content_bottom %} {% block content_bottom %}
{% include "includes/profile_form.html" with form=form %} {% include "includes/profile_form.html" with form=form %}
</div> </div>
</div>
</main> </main>
{% endblock content_bottom %} {% endblock content_bottom %}

View file

@ -16,7 +16,7 @@ from registrar.utility.csv_export import (
DomainDataType, DomainDataType,
DomainDataFederal, DomainDataFederal,
DomainDataTypeUser, DomainDataTypeUser,
DomainRequestsDataType, DomainRequestDataType,
DomainGrowth, DomainGrowth,
DomainManaged, DomainManaged,
DomainUnmanaged, DomainUnmanaged,
@ -456,11 +456,11 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
portfolio.delete() portfolio.delete()
def _run_domain_request_data_type_user_export(self, request): def _run_domain_request_data_type_user_export(self, request):
"""Helper function to run the exporting_dr_data_to_csv function on DomainRequestsDataType""" """Helper function to run the export_data_to_csv function on DomainRequestDataType"""
csv_file = StringIO() csv_file = StringIO()
DomainRequestsDataType.exporting_dr_data_to_csv(csv_file, request=request) DomainRequestDataType.export_data_to_csv(csv_file, request=request)
csv_file.seek(0) csv_file.seek(0)
@ -773,9 +773,9 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
# Content # Content
"city5.gov,Approved,Federal,Executive,,Testorg,N/A,,NY,2,,,,1,0,city1.gov,Testy,Tester,testy@town.com," "city5.gov,Approved,Federal,Executive,,Testorg,N/A,,NY,2,,,,1,0,city1.gov,Testy,Tester,testy@town.com,"
"Chief Tester,Purpose of the site,There is more,Testy Tester testy2@town.com,,city.com,\n" "Chief Tester,Purpose of the site,There is more,Testy Tester testy2@town.com,,city.com,\n"
"city2.gov,In review,Federal,Executive,Portfolio 1 Federal Agency,,N/A,,,2,,,,0,1,city1.gov,,,,," "city2.gov,In review,Federal,Executive,Portfolio 1 Federal Agency,,N/A,,NY,2,,,,0,1,city1.gov,,,,,"
"Purpose of the site,There is more,Testy Tester testy2@town.com,,city.com,\n" "Purpose of the site,There is more,Testy Tester testy2@town.com,,city.com,\n"
"city3.gov,Submitted,Federal,Executive,Portfolio 1 Federal Agency,,N/A,,,2,,,,0,1," "city3.gov,Submitted,Federal,Executive,Portfolio 1 Federal Agency,,N/A,,NY,2,,,,0,1,"
'"cheeseville.gov, city1.gov, igorville.gov",,,,,Purpose of the site,CISA-first-name CISA-last-name | ' '"cheeseville.gov, city1.gov, igorville.gov",,,,,Purpose of the site,CISA-first-name CISA-last-name | '
'There is more,"Meow Tester24 te2@town.com, Testy1232 Tester24 te2@town.com, ' 'There is more,"Meow Tester24 te2@town.com, Testy1232 Tester24 te2@town.com, '
'Testy Tester testy2@town.com",' 'Testy Tester testy2@town.com",'
@ -785,7 +785,7 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
"Chief Tester,Purpose of the site,CISA-first-name CISA-last-name | There is more," "Chief Tester,Purpose of the site,CISA-first-name CISA-last-name | There is more,"
"Testy Tester testy2@town.com," "Testy Tester testy2@town.com,"
"cisaRep@igorville.gov,city.com,\n" "cisaRep@igorville.gov,city.com,\n"
"city6.gov,Submitted,Federal,Executive,Portfolio 1 Federal Agency,,N/A,,,2,,,,0,1,city1.gov,,,,," "city6.gov,Submitted,Federal,Executive,Portfolio 1 Federal Agency,,N/A,,NY,2,,,,0,1,city1.gov,,,,,"
"Purpose of the site,CISA-first-name CISA-last-name | There is more,Testy Tester testy2@town.com," "Purpose of the site,CISA-first-name CISA-last-name | There is more,Testy Tester testy2@town.com,"
"cisaRep@igorville.gov,city.com,\n" "cisaRep@igorville.gov,city.com,\n"
) )
@ -794,6 +794,7 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
# spaces and leading/trailing whitespace # spaces and leading/trailing whitespace
csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip() csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip()
expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip() expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip()
self.maxDiff = None
self.assertEqual(csv_content, expected_content) self.assertEqual(csv_content, expected_content)

View file

@ -538,11 +538,23 @@ class DomainExport(BaseExport):
# model objects as we export data, trying to reinstate model objects in order to grab @property # model objects as we export data, trying to reinstate model objects in order to grab @property
# values negatively impacts performance. Therefore, we will follow best practice and use annotations # values negatively impacts performance. Therefore, we will follow best practice and use annotations
return { return {
"converted_generic_org_type": Case( "converted_org_type": Case(
# When portfolio is present, use its value instead # When portfolio is present and is_election_board is True
When(portfolio__isnull=False, then=F("portfolio__organization_type")), When(
portfolio__isnull=False,
portfolio__organization_type__isnull=False,
is_election_board=True,
then=Concat(F("portfolio__organization_type"), Value("_election")),
),
# When portfolio is present and is_election_board is False or None
When(
Q(is_election_board=False) | Q(is_election_board__isnull=True),
portfolio__isnull=False,
portfolio__organization_type__isnull=False,
then=F("portfolio__organization_type"),
),
# Otherwise, return the natively assigned value # Otherwise, return the natively assigned value
default=F("generic_org_type"), default=F("organization_type"),
output_field=CharField(), output_field=CharField(),
), ),
"converted_federal_agency": Case( "converted_federal_agency": Case(
@ -573,20 +585,6 @@ class DomainExport(BaseExport):
default=F("organization_name"), default=F("organization_name"),
output_field=CharField(), output_field=CharField(),
), ),
"converted_city": Case(
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__city")),
# Otherwise, return the natively assigned value
default=F("city"),
output_field=CharField(),
),
"converted_state_territory": Case(
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__state_territory")),
# Otherwise, return the natively assigned value
default=F("state_territory"),
output_field=CharField(),
),
"converted_so_email": Case( "converted_so_email": Case(
# When portfolio is present, use its value instead # When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__senior_official__email")), When(portfolio__isnull=False, then=F("portfolio__senior_official__email")),
@ -727,7 +725,8 @@ class DomainExport(BaseExport):
first_ready_on = "(blank)" first_ready_on = "(blank)"
# organization_type has organization_type AND is_election # organization_type has organization_type AND is_election
domain_org_type = model.get("converted_generic_org_type") # domain_org_type includes "- Election" org_type variants
domain_org_type = model.get("converted_org_type")
human_readable_domain_org_type = DomainRequest.OrgChoicesElectionOffice.get_org_label(domain_org_type) human_readable_domain_org_type = DomainRequest.OrgChoicesElectionOffice.get_org_label(domain_org_type)
domain_federal_type = model.get("converted_federal_type") domain_federal_type = model.get("converted_federal_type")
human_readable_domain_federal_type = BranchChoices.get_branch_label(domain_federal_type) human_readable_domain_federal_type = BranchChoices.get_branch_label(domain_federal_type)
@ -772,8 +771,8 @@ class DomainExport(BaseExport):
"Domain type": model.get("domain_type"), "Domain type": model.get("domain_type"),
"Agency": model.get("converted_federal_agency"), "Agency": model.get("converted_federal_agency"),
"Organization name": model.get("converted_organization_name"), "Organization name": model.get("converted_organization_name"),
"City": model.get("converted_city"), "City": model.get("city"),
"State": model.get("converted_state_territory"), "State": model.get("state_territory"),
"SO": model.get("converted_so_name"), "SO": model.get("converted_so_name"),
"SO email": model.get("converted_so_email"), "SO email": model.get("converted_so_email"),
"Security contact email": model.get("security_contact_email"), "Security contact email": model.get("security_contact_email"),
@ -908,7 +907,7 @@ class DomainDataType(DomainExport):
""" """
# Coalesce is used to replace federal_type of None with ZZZZZ # Coalesce is used to replace federal_type of None with ZZZZZ
return [ return [
"converted_generic_org_type", "converted_org_type",
Coalesce("converted_federal_type", Value("ZZZZZ")), Coalesce("converted_federal_type", Value("ZZZZZ")),
"converted_federal_agency", "converted_federal_agency",
"domain__name", "domain__name",
@ -987,105 +986,6 @@ class DomainDataTypeUser(DomainDataType):
return Q(domain__id__in=request.user.get_user_domain_ids(request)) return Q(domain__id__in=request.user.get_user_domain_ids(request))
class DomainRequestsDataType:
"""
The DomainRequestsDataType report, but filtered based on the current request user
"""
@classmethod
def get_filter_conditions(cls, request=None, **kwargs):
if request is None or not hasattr(request, "user") or not request.user.is_authenticated:
return Q(id__in=[])
request_ids = request.user.get_user_domain_request_ids(request)
return Q(id__in=request_ids)
@classmethod
def get_queryset(cls, request):
return DomainRequest.objects.filter(cls.get_filter_conditions(request))
def safe_get(attribute, default="N/A"):
# Return the attribute value or default if not present
return attribute if attribute is not None else default
@classmethod
def exporting_dr_data_to_csv(cls, response, request=None):
import csv
writer = csv.writer(response)
# CSV headers
writer.writerow(
[
"Domain request",
"Region",
"Status",
"Election office",
"Federal type",
"Domain type",
"Request additional details",
"Creator approved domains count",
"Creator active requests count",
"Alternative domains",
"Other contacts",
"Current websites",
"Federal agency",
"SO first name",
"SO last name",
"SO email",
"SO title/role",
"Creator first name",
"Creator last name",
"Creator email",
"Organization name",
"City",
"State/territory",
"Request purpose",
"CISA regional representative",
"Last submitted date",
"First submitted date",
"Last status update",
]
)
queryset = cls.get_queryset(request)
for request in queryset:
writer.writerow(
[
request.requested_domain,
cls.safe_get(getattr(request, "region_field", None)),
request.status,
cls.safe_get(getattr(request, "election_office", None)),
request.converted_federal_type,
cls.safe_get(getattr(request, "domain_type", None)),
cls.safe_get(getattr(request, "additional_details", None)),
cls.safe_get(getattr(request, "creator_approved_domains_count", None)),
cls.safe_get(getattr(request, "creator_active_requests_count", None)),
cls.safe_get(getattr(request, "all_alternative_domains", None)),
cls.safe_get(getattr(request, "all_other_contacts", None)),
cls.safe_get(getattr(request, "all_current_websites", None)),
cls.safe_get(getattr(request, "converted_federal_agency", None)),
cls.safe_get(getattr(request.converted_senior_official, "first_name", None)),
cls.safe_get(getattr(request.converted_senior_official, "last_name", None)),
cls.safe_get(getattr(request.converted_senior_official, "email", None)),
cls.safe_get(getattr(request.converted_senior_official, "title", None)),
cls.safe_get(getattr(request.creator, "first_name", None)),
cls.safe_get(getattr(request.creator, "last_name", None)),
cls.safe_get(getattr(request.creator, "email", None)),
cls.safe_get(getattr(request, "converted_organization_name", None)),
cls.safe_get(getattr(request, "converted_city", None)),
cls.safe_get(getattr(request, "converted_state_territory", None)),
cls.safe_get(getattr(request, "purpose", None)),
cls.safe_get(getattr(request, "cisa_representative_email", None)),
cls.safe_get(getattr(request, "last_submitted_date", None)),
cls.safe_get(getattr(request, "first_submitted_date", None)),
cls.safe_get(getattr(request, "last_status_update", None)),
]
)
return response
class DomainDataFull(DomainExport): class DomainDataFull(DomainExport):
""" """
Shows security contacts, filtered by state Shows security contacts, filtered by state
@ -1760,20 +1660,6 @@ class DomainRequestExport(BaseExport):
default=F("organization_name"), default=F("organization_name"),
output_field=CharField(), output_field=CharField(),
), ),
"converted_city": Case(
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__city")),
# Otherwise, return the natively assigned value
default=F("city"),
output_field=CharField(),
),
"converted_state_territory": Case(
# When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__state_territory")),
# Otherwise, return the natively assigned value
default=F("state_territory"),
output_field=CharField(),
),
"converted_so_email": Case( "converted_so_email": Case(
# When portfolio is present, use its value instead # When portfolio is present, use its value instead
When(portfolio__isnull=False, then=F("portfolio__senior_official__email")), When(portfolio__isnull=False, then=F("portfolio__senior_official__email")),
@ -1952,8 +1838,8 @@ class DomainRequestExport(BaseExport):
"Investigator": model.get("investigator__email"), "Investigator": model.get("investigator__email"),
# Untouched fields # Untouched fields
"Organization name": model.get("converted_organization_name"), "Organization name": model.get("converted_organization_name"),
"City": model.get("converted_city"), "City": model.get("city"),
"State/territory": model.get("converted_state_territory"), "State/territory": model.get("state_territory"),
"Request purpose": model.get("purpose"), "Request purpose": model.get("purpose"),
"CISA regional representative": model.get("cisa_representative_email"), "CISA regional representative": model.get("cisa_representative_email"),
"Last submitted date": model.get("last_submitted_date"), "Last submitted date": model.get("last_submitted_date"),
@ -1965,6 +1851,92 @@ class DomainRequestExport(BaseExport):
return row return row
class DomainRequestDataType(DomainRequestExport):
"""
The DomainRequestDataType report, but filtered based on the current request user
"""
@classmethod
def get_columns(cls):
"""
Overrides the columns for CSV export specific to DomainRequestDataType.
"""
return [
"Domain request",
"Region",
"Status",
"Election office",
"Federal type",
"Domain type",
"Request additional details",
"Creator approved domains count",
"Creator active requests count",
"Alternative domains",
"Other contacts",
"Current websites",
"Federal agency",
"SO first name",
"SO last name",
"SO email",
"SO title/role",
"Creator first name",
"Creator last name",
"Creator email",
"Organization name",
"City",
"State/territory",
"Request purpose",
"CISA regional representative",
"Last submitted date",
"First submitted date",
"Last status update",
]
@classmethod
def get_filter_conditions(cls, request=None, **kwargs):
"""
Get a Q object of filter conditions to filter when building queryset.
"""
if request is None or not hasattr(request, "user") or not request.user:
# Return nothing
return Q(id__in=[])
else:
# Get all domain requests the user is associated with
return Q(id__in=request.user.get_user_domain_request_ids(request))
@classmethod
def get_select_related(cls):
"""
Get a list of tables to pass to select_related when building queryset.
"""
return ["creator", "senior_official", "federal_agency", "investigator", "requested_domain"]
@classmethod
def get_prefetch_related(cls):
"""
Get a list of tables to pass to prefetch_related when building queryset.
"""
return ["current_websites", "other_contacts", "alternative_domains"]
@classmethod
def get_related_table_fields(cls):
"""
Get a list of fields from related tables.
"""
return [
"requested_domain__name",
"federal_agency__agency",
"senior_official__first_name",
"senior_official__last_name",
"senior_official__email",
"senior_official__title",
"creator__first_name",
"creator__last_name",
"creator__email",
"investigator__email",
]
class DomainRequestGrowth(DomainRequestExport): class DomainRequestGrowth(DomainRequestExport):
""" """
Shows submitted requests within a date range, sorted Shows submitted requests within a date range, sorted

View file

@ -203,7 +203,7 @@ class ExportDataTypeRequests(View):
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
response = HttpResponse(content_type="text/csv") response = HttpResponse(content_type="text/csv")
response["Content-Disposition"] = 'attachment; filename="domain-requests.csv"' response["Content-Disposition"] = 'attachment; filename="domain-requests.csv"'
csv_export.DomainRequestsDataType.exporting_dr_data_to_csv(response, request=request) csv_export.DomainRequestDataType.export_data_to_csv(response, request=request)
return response return response