mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-14 16:47:02 +02:00
Fix merge conflicts
This commit is contained in:
parent
ee66b234cf
commit
e0aa729133
5 changed files with 160 additions and 168 deletions
|
@ -196,24 +196,6 @@ function checkToListThenInitWidget(toListId, attempts) {
|
|||
addUrlsToOtherContacts()
|
||||
})();
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Select all table rows that have a data-contact-id attribute
|
||||
let contactRows = document.querySelectorAll("tr[data-contact-url]");
|
||||
|
||||
// Add a click event listener to each row
|
||||
index = 1
|
||||
contactRows.forEach(function(row) {
|
||||
let otherContactUrl = row.getAttribute("data-contact-url");
|
||||
if (otherContactUrl){
|
||||
let otherContact = document.querySelector(`.other-contact__${index}`)
|
||||
if (otherContact) {
|
||||
otherContact.href = otherContactUrl
|
||||
}
|
||||
}
|
||||
index++
|
||||
});
|
||||
});
|
||||
|
||||
// Initialize the widget:
|
||||
// add related buttons to the widget for edit, delete and view
|
||||
// add event listeners on the from list, the to list, and selector buttons which either enable or disable the related buttons
|
||||
|
|
|
@ -54,17 +54,17 @@
|
|||
|
||||
})();
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
createComparativeColumnChart("myChart1", "Managed domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart2", "Unmanaged domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart3", "Deleted domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart4", "Ready domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart5", "Submitted requests", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart6", "All requests", "Start Date", "End Date");
|
||||
});
|
||||
|
||||
function createComparativeColumnChart(canvasId, title, labelOne, labelTwo) {
|
||||
/** An IIFE to initialize the analytics page
|
||||
*/
|
||||
(function () {
|
||||
function createComparativeColumnChart(canvasId, title, labelOne, labelTwo) {
|
||||
var canvas = document.getElementById(canvasId);
|
||||
if (!canvas) {
|
||||
console.log("Could not find canvas")
|
||||
return
|
||||
}
|
||||
|
||||
var ctx = canvas.getContext("2d");
|
||||
|
||||
var listOne = JSON.parse(canvas.getAttribute('data-list-one'));
|
||||
|
@ -114,4 +114,18 @@ function createComparativeColumnChart(canvasId, title, labelOne, labelTwo) {
|
|||
data: data,
|
||||
options: options,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initComparativeColumnCharts() {
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
createComparativeColumnChart("myChart1", "Managed domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart2", "Unmanaged domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart3", "Deleted domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart4", "Ready domains", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart5", "Submitted requests", "Start Date", "End Date");
|
||||
createComparativeColumnChart("myChart6", "All requests", "Start Date", "End Date");
|
||||
});
|
||||
};
|
||||
|
||||
initComparativeColumnCharts();
|
||||
})();
|
|
@ -1,96 +0,0 @@
|
|||
{% extends 'admin/change_form.html' %}
|
||||
{% load i18n static %}
|
||||
|
||||
{% block field_sets %}
|
||||
{# Create an invisible <a> tag so that we can use a click event to toggle the modal. #}
|
||||
<a id="invisible-ineligible-modal-toggler" class="display-none" href="#toggle-set-ineligible" aria-controls="toggle-set-ineligible" data-open-modal></a>
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block submit_buttons_bottom %}
|
||||
{% comment %}
|
||||
Modals behave very weirdly in django admin.
|
||||
They tend to "strip out" any injected form elements, leaving only the main form.
|
||||
In addition, USWDS handles modals by first destroying the element, then repopulating it toward the end of the page.
|
||||
In effect, this means that the modal is not, and cannot, be surrounded by any form element at compile time.
|
||||
|
||||
The current workaround for this is to use javascript to inject a hidden input, and bind submit of that
|
||||
element to the click of the confirmation button within this modal.
|
||||
|
||||
This is controlled by the class `dja-form-placeholder` on the button.
|
||||
|
||||
In addition, the modal element MUST be placed low in the DOM. The script loads slower on DJA than on other portions
|
||||
of the application, so this means that it will briefly "populate", causing unintended visual effects.
|
||||
{% endcomment %}
|
||||
{# Create a modal for when a domain is marked as ineligible #}
|
||||
<div
|
||||
class="usa-modal"
|
||||
id="toggle-set-ineligible"
|
||||
aria-labelledby="Are you sure you want to select ineligible status?"
|
||||
aria-describedby="This request will be marked as ineligible."
|
||||
>
|
||||
<div class="usa-modal__content">
|
||||
<div class="usa-modal__main">
|
||||
<h2 class="usa-modal__heading" id="modal-1-heading">
|
||||
Are you sure you want to select ineligible status?
|
||||
</h2>
|
||||
<div class="usa-prose">
|
||||
<p>
|
||||
When a domain request is in ineligible status, the registrant's permissions within the registrar are restricted as follows:
|
||||
</p>
|
||||
<ul>
|
||||
<li class="font-body-sm">They cannot edit the ineligible request or any other pending requests.</li>
|
||||
<li class="font-body-sm">They cannot manage any of their approved domains.</li>
|
||||
<li class="font-body-sm">They cannot initiate a new domain request.</li>
|
||||
</ul>
|
||||
<p>
|
||||
The restrictions will not take effect until you “save” the changes for this domain request.
|
||||
This action can be reversed, if needed.
|
||||
</p>
|
||||
<p>
|
||||
Domain: <b>{{ original.requested_domain.name }}</b>
|
||||
{# Acts as a <br> #}
|
||||
<div class="display-inline"></div>
|
||||
New status: <b>{{ original.DomainRequestStatus.INELIGIBLE|capfirst }}</b>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="usa-modal__footer">
|
||||
<ul class="usa-button-group">
|
||||
<li class="usa-button-group__item">
|
||||
<button
|
||||
type="submit"
|
||||
class="usa-button"
|
||||
name="_set_domain_request_ineligible"
|
||||
data-close-modal
|
||||
>
|
||||
Yes, select ineligible status
|
||||
</button>
|
||||
</li>
|
||||
<li class="usa-button-group__item">
|
||||
<button
|
||||
type="button"
|
||||
class="usa-button usa-button--unstyled padding-105 text-center"
|
||||
name="_cancel_domain_request_ineligible"
|
||||
data-close-modal
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="usa-button usa-modal__close"
|
||||
aria-label="Close this window"
|
||||
data-close-modal
|
||||
>
|
||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#close"></use>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
|
@ -2,7 +2,97 @@
|
|||
{% load i18n static %}
|
||||
|
||||
{% block field_sets %}
|
||||
{# Create an invisible <a> tag so that we can use a click event to toggle the modal. #}
|
||||
<a id="invisible-ineligible-modal-toggler" class="display-none" href="#toggle-set-ineligible" aria-controls="toggle-set-ineligible" data-open-modal></a>
|
||||
{% for fieldset in adminform %}
|
||||
{% include "django/admin/includes/domain_request_fieldset.html" %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block submit_buttons_bottom %}
|
||||
{% comment %}
|
||||
Modals behave very weirdly in django admin.
|
||||
They tend to "strip out" any injected form elements, leaving only the main form.
|
||||
In addition, USWDS handles modals by first destroying the element, then repopulating it toward the end of the page.
|
||||
In effect, this means that the modal is not, and cannot, be surrounded by any form element at compile time.
|
||||
|
||||
The current workaround for this is to use javascript to inject a hidden input, and bind submit of that
|
||||
element to the click of the confirmation button within this modal.
|
||||
|
||||
This is controlled by the class `dja-form-placeholder` on the button.
|
||||
|
||||
In addition, the modal element MUST be placed low in the DOM. The script loads slower on DJA than on other portions
|
||||
of the application, so this means that it will briefly "populate", causing unintended visual effects.
|
||||
{% endcomment %}
|
||||
{# Create a modal for when a domain is marked as ineligible #}
|
||||
<div
|
||||
class="usa-modal"
|
||||
id="toggle-set-ineligible"
|
||||
aria-labelledby="Are you sure you want to select ineligible status?"
|
||||
aria-describedby="This request will be marked as ineligible."
|
||||
>
|
||||
<div class="usa-modal__content">
|
||||
<div class="usa-modal__main">
|
||||
<h2 class="usa-modal__heading" id="modal-1-heading">
|
||||
Are you sure you want to select ineligible status?
|
||||
</h2>
|
||||
<div class="usa-prose">
|
||||
<p>
|
||||
When a domain request is in ineligible status, the registrant's permissions within the registrar are restricted as follows:
|
||||
</p>
|
||||
<ul>
|
||||
<li class="font-body-sm">They cannot edit the ineligible request or any other pending requests.</li>
|
||||
<li class="font-body-sm">They cannot manage any of their approved domains.</li>
|
||||
<li class="font-body-sm">They cannot initiate a new domain request.</li>
|
||||
</ul>
|
||||
<p>
|
||||
The restrictions will not take effect until you “save” the changes for this domain request.
|
||||
This action can be reversed, if needed.
|
||||
</p>
|
||||
<p>
|
||||
Domain: <b>{{ original.requested_domain.name }}</b>
|
||||
{# Acts as a <br> #}
|
||||
<div class="display-inline"></div>
|
||||
New status: <b>{{ original.DomainRequestStatus.INELIGIBLE|capfirst }}</b>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="usa-modal__footer">
|
||||
<ul class="usa-button-group">
|
||||
<li class="usa-button-group__item">
|
||||
<button
|
||||
type="submit"
|
||||
class="usa-button"
|
||||
name="_set_domain_request_ineligible"
|
||||
data-close-modal
|
||||
>
|
||||
Yes, select ineligible status
|
||||
</button>
|
||||
</li>
|
||||
<li class="usa-button-group__item">
|
||||
<button
|
||||
type="button"
|
||||
class="usa-button usa-button--unstyled padding-105 text-center"
|
||||
name="_cancel_domain_request_ineligible"
|
||||
data-close-modal
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="usa-button usa-modal__close"
|
||||
aria-label="Close this window"
|
||||
data-close-modal
|
||||
>
|
||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#close"></use>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1339,6 +1339,8 @@ class TestDomainRequestAdmin(MockEppLib):
|
|||
"about_your_organization",
|
||||
"requested_domain",
|
||||
"approved_domain",
|
||||
"other_contacts",
|
||||
"current_websites",
|
||||
"alternative_domains",
|
||||
"purpose",
|
||||
"submitter",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue