mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-20 03:19:24 +02:00
CSS done
This commit is contained in:
parent
6a08c1e97a
commit
cbdf763637
13 changed files with 100 additions and 47 deletions
|
@ -1713,7 +1713,20 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
// Request is deletable, modal and modalTrigger are built. Now test is portfolio requests page and enhace the modalTrigger markup
|
// Request is deletable, modal and modalTrigger are built. Now test is portfolio requests page and enhace the modalTrigger markup
|
||||||
if (portfolioValue) {
|
if (portfolioValue) {
|
||||||
modalTrigger = `
|
modalTrigger = `
|
||||||
<div class="usa-accordion usa-accordion--more-actions margin-right-2">
|
<a
|
||||||
|
role="button"
|
||||||
|
id="button-toggle-delete-domain-alert-${request.id}"
|
||||||
|
href="#toggle-delete-domain-alert-${request.id}"
|
||||||
|
class="usa-button text-secondary usa-button--unstyled text-no-underline late-loading-modal-trigger margin-top-2 visible-mobile"
|
||||||
|
aria-controls="toggle-delete-domain-alert-${request.id}"
|
||||||
|
data-open-modal
|
||||||
|
>
|
||||||
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24">
|
||||||
|
<use xlink:href="/public/img/sprite.svg#delete"></use>
|
||||||
|
</svg> Delete <span class="usa-sr-only">${domainName}</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="usa-accordion usa-accordion--more-actions margin-right-2 hidden-mobile">
|
||||||
<div class="usa-accordion__heading">
|
<div class="usa-accordion__heading">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -1732,7 +1745,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
role="button"
|
role="button"
|
||||||
id="button-toggle-delete-domain-alert-${request.id}"
|
id="button-toggle-delete-domain-alert-${request.id}"
|
||||||
href="#toggle-delete-domain-alert-${request.id}"
|
href="#toggle-delete-domain-alert-${request.id}"
|
||||||
class="usa-button text-secondary usa-button--unstyled text-no-underline late-loading-modal-trigger"
|
class="usa-button text-secondary usa-button--unstyled text-no-underline late-loading-modal-trigger margin-top-2"
|
||||||
aria-controls="toggle-delete-domain-alert-${request.id}"
|
aria-controls="toggle-delete-domain-alert-${request.id}"
|
||||||
data-open-modal
|
data-open-modal
|
||||||
>
|
>
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
// Note, width is determined by a custom width class on one of the children
|
// Note, width is determined by a custom width class on one of the children
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
top: 33.88px;
|
|
||||||
left: 0;
|
left: 0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: solid 1px color('base-lighter');
|
border: solid 1px color('base-lighter');
|
||||||
|
@ -33,7 +32,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.usa-accordion--select .usa-accordion__content {
|
||||||
|
top: 33.88px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usa-accordion--more-actions .usa-accordion__content {
|
||||||
|
top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
tr:last-child .usa-accordion--more-actions .usa-accordion__content {
|
tr:last-child .usa-accordion--more-actions .usa-accordion__content {
|
||||||
top: auto;
|
top: auto;
|
||||||
bottom: 20px;
|
bottom: -10px;
|
||||||
|
right: 30px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,23 @@ abbr[title] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden-mobile {
|
||||||
|
display: none!important;
|
||||||
|
}
|
||||||
|
.visible-mobile {
|
||||||
|
display: block!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include at-media(tablet) {
|
||||||
|
.hidden-mobile {
|
||||||
|
display: block!important;
|
||||||
|
}
|
||||||
|
.visible-mobile {
|
||||||
|
display: none!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.flex-end {
|
.flex-end {
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,14 +211,6 @@ a.usa-button--unstyled:visited {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.dotgov-table a,
|
|
||||||
.usa-link--icon {
|
|
||||||
&:visited {
|
|
||||||
color: color('primary');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a .usa-icon,
|
a .usa-icon,
|
||||||
.usa-button--with-icon .usa-icon {
|
.usa-button--with-icon .usa-icon {
|
||||||
height: 1.3em;
|
height: 1.3em;
|
||||||
|
@ -230,3 +222,8 @@ a .usa-icon,
|
||||||
height: 1.5em;
|
height: 1.5em;
|
||||||
width: 1.5em;
|
width: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button.text-secondary,
|
||||||
|
.dotgov-table a.text-secondary {
|
||||||
|
color: $theme-color-error;
|
||||||
|
}
|
||||||
|
|
|
@ -101,6 +101,12 @@
|
||||||
button.usa-current {
|
button.usa-current {
|
||||||
font-weight: font-weight('bold');
|
font-weight: font-weight('bold');
|
||||||
}
|
}
|
||||||
|
button[aria-expanded="true"] {
|
||||||
|
color: color('white');
|
||||||
|
}
|
||||||
|
button:not(.usa-current):hover::after {
|
||||||
|
display: none!important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.usa-nav__secondary {
|
.usa-nav__secondary {
|
||||||
// I don't know why USWDS has this at 2 rem, which puts it out of alignment
|
// I don't know why USWDS has this at 2 rem, which puts it out of alignment
|
||||||
|
|
|
@ -60,6 +60,16 @@ def add_has_profile_feature_flag_to_context(request):
|
||||||
|
|
||||||
def portfolio_permissions(request):
|
def portfolio_permissions(request):
|
||||||
"""Make portfolio permissions for the request user available in global context"""
|
"""Make portfolio permissions for the request user available in global context"""
|
||||||
|
default_context = {
|
||||||
|
"has_base_portfolio_permission": False,
|
||||||
|
"has_domains_portfolio_permission": False,
|
||||||
|
"has_requests_portfolio_permission": False,
|
||||||
|
"has_edit_request_portfolio_permission": False,
|
||||||
|
"has_view_suborganization_portfolio_permission": False,
|
||||||
|
"has_edit_suborganization_portfolio_permission": False,
|
||||||
|
"portfolio": None,
|
||||||
|
"has_organization_feature_flag": False,
|
||||||
|
}
|
||||||
try:
|
try:
|
||||||
portfolio = request.session.get("portfolio")
|
portfolio = request.session.get("portfolio")
|
||||||
if portfolio:
|
if portfolio:
|
||||||
|
@ -69,29 +79,14 @@ def portfolio_permissions(request):
|
||||||
"has_requests_portfolio_permission": request.user.has_requests_portfolio_permission(
|
"has_requests_portfolio_permission": request.user.has_requests_portfolio_permission(
|
||||||
portfolio
|
portfolio
|
||||||
),
|
),
|
||||||
|
"has_edit_request_portfolio_permission": request.user.has_edit_request_portfolio_permission(portfolio),
|
||||||
"has_view_suborganization_portfolio_permission": request.user.has_view_suborganization_portfolio_permission(portfolio),
|
"has_view_suborganization_portfolio_permission": request.user.has_view_suborganization_portfolio_permission(portfolio),
|
||||||
"has_edit_suborganization_portfolio_permission": request.user.has_edit_suborganization_portfolio_permission(portfolio),
|
"has_edit_suborganization_portfolio_permission": request.user.has_edit_suborganization_portfolio_permission(portfolio),
|
||||||
"portfolio": portfolio,
|
"portfolio": portfolio,
|
||||||
"has_organization_feature_flag": True,
|
"has_organization_feature_flag": True,
|
||||||
}
|
}
|
||||||
return {
|
return default_context
|
||||||
"has_base_portfolio_permission": False,
|
|
||||||
"has_domains_portfolio_permission": False,
|
|
||||||
"has_requests_portfolio_permission": False,
|
|
||||||
"has_view_suborganization_portfolio_permission": False,
|
|
||||||
"has_edit_suborganization_portfolio_permission": False,
|
|
||||||
"portfolio": None,
|
|
||||||
"has_organization_feature_flag": False,
|
|
||||||
}
|
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# Handles cases where request.user might not exist
|
# Handles cases where request.user might not exist
|
||||||
return {
|
return default_context
|
||||||
"has_base_portfolio_permission": False,
|
|
||||||
"has_domains_portfolio_permission": False,
|
|
||||||
"has_requests_portfolio_permission": False,
|
|
||||||
"has_view_suborganization_portfolio_permission": False,
|
|
||||||
"has_edit_suborganization_portfolio_permission": False,
|
|
||||||
"portfolio": None,
|
|
||||||
"has_organization_feature_flag": False,
|
|
||||||
}
|
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
<div class="grid-row margin-top-1">
|
<div class="grid-row margin-top-1">
|
||||||
<div class="grid-col">
|
<div class="grid-col">
|
||||||
<button type="button" class="usa-button usa-button--unstyled usa-button--with-icon float-right-tablet delete-record">
|
<button type="button" class="usa-button usa-button--unstyled usa-button--with-icon float-right-tablet delete-record text-secondary">
|
||||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||||
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
||||||
</svg>Delete
|
</svg>Delete
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
<div class="tablet:grid-col-2">
|
<div class="tablet:grid-col-2">
|
||||||
<button type="button" class="usa-button usa-button--unstyled usa-button--with-icon delete-record margin-bottom-075">
|
<button type="button" class="usa-button usa-button--unstyled usa-button--with-icon delete-record margin-bottom-075 text-secondary">
|
||||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||||
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
||||||
</svg>Delete
|
</svg>Delete
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<h2 class="margin-top-1">Organization contact {{ forloop.counter }}</h2>
|
<h2 class="margin-top-1">Organization contact {{ forloop.counter }}</h2>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
<button type="button" class="usa-button usa-button--unstyled display-block float-right-tablet delete-record margin-bottom-2">
|
<button type="button" class="usa-button usa-button--unstyled display-block float-right-tablet delete-record margin-bottom-2 text-secondary">
|
||||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||||
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
<use xlink:href="{%static 'img/sprite.svg'%}#delete"></use>
|
||||||
</svg><span class="margin-left-05">Delete</span>
|
</svg><span class="margin-left-05">Delete</span>
|
||||||
|
|
|
@ -53,7 +53,8 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="usa-nav__primary-item">
|
<li class="usa-nav__primary-item">
|
||||||
{% if has_requests_portfolio_permission %}
|
<!-- user hasone of the view permissions plus the edit permission, show the dropdown -->
|
||||||
|
{% if has_edit_request_portfolio_permission %}
|
||||||
{% url 'domain-requests' as url %}
|
{% url 'domain-requests' as url %}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -75,6 +76,13 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<!-- user has view but no edit permissions -->
|
||||||
|
{% elif has_requests_portfolio_permission %}
|
||||||
|
{% url 'domain-requests' as url %}
|
||||||
|
<a href="{{ url }}" class="usa-nav-link{% if 'request'|in_path:request.path %} usa-current{% endif %}">
|
||||||
|
Domain requests
|
||||||
|
</a>
|
||||||
|
<!-- user does not have permissions -->
|
||||||
{% else %}
|
{% else %}
|
||||||
{% url 'no-portfolio-requests' as url %}
|
{% url 'no-portfolio-requests' as url %}
|
||||||
<a href="{{ url }}" class="usa-nav-link{% if 'request'|in_path:request.path %} usa-current{% endif %}">
|
<a href="{{ url }}" class="usa-nav-link{% if 'request'|in_path:request.path %} usa-current{% endif %}">
|
||||||
|
|
|
@ -11,18 +11,27 @@
|
||||||
{% block portfolio_content %}
|
{% block portfolio_content %}
|
||||||
<div id="main-content">
|
<div id="main-content">
|
||||||
<h1 id="domain-requests-header">Domain requests</h1>
|
<h1 id="domain-requests-header">Domain requests</h1>
|
||||||
|
<div class="grid-row grid-gap">
|
||||||
|
<div class="mobile:grid-col-12 tablet:grid-col-6">
|
||||||
|
<p class="margin-y-0">Domain requests can only be modified by the person who created the request.</p>
|
||||||
|
</div>
|
||||||
|
{% if has_edit_request_portfolio_permission %}
|
||||||
|
<div class="mobile:grid-col-12 tablet:grid-col-6">
|
||||||
|
{% comment %}
|
||||||
|
IMPORTANT:
|
||||||
|
If this button is added on any other page, make sure to update the
|
||||||
|
relevant view to reset request.session["new_request"] = True
|
||||||
|
{% endcomment %}
|
||||||
|
<p class="float-right-tablet tablet:margin-y-0">
|
||||||
|
<a href="{% url 'domain-request:' %}" class="usa-button"
|
||||||
|
>
|
||||||
|
Start a new domain request
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% comment %}
|
|
||||||
IMPORTANT:
|
|
||||||
If this button is added on any other page, make sure to update the
|
|
||||||
relevant view to reset request.session["new_request"] = True
|
|
||||||
{% endcomment %}
|
|
||||||
<p class="margin-top-4">
|
|
||||||
<a href="{% url 'domain-request:' %}" class="usa-button"
|
|
||||||
>
|
|
||||||
Start a new domain request
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{% include "includes/domain_requests_table.html" with portfolio=portfolio %}
|
{% include "includes/domain_requests_table.html" with portfolio=portfolio %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -76,7 +76,7 @@ class PortfolioNoDomainRequestsView(NoPortfolioDomainsPermissionView, View):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
model = Portfolio
|
model = Portfolio
|
||||||
template_name = "portfolio_no_domain_requests.html"
|
template_name = "portfolio_no_requests.html"
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
return render(request, self.template_name, context=self.get_context_data())
|
return render(request, self.template_name, context=self.get_context_data())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue