mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-08 20:23:34 +02:00
added is_editable to domain; added editable to domain_detail.html; added editable to domain_sidebar.html; added editable to summary_item.html; updated has_permission in domain views to check for domain editable
This commit is contained in:
parent
6400367368
commit
6da9fdab2a
4 changed files with 18 additions and 8 deletions
|
@ -880,6 +880,14 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
"""
|
||||
return self.state == self.State.READY
|
||||
|
||||
def is_editable(self) -> bool:
|
||||
"""domain is editable unless state is on hold or deleted"""
|
||||
return self.state in [
|
||||
self.State.UNKNOWN,
|
||||
self.State.DNS_NEEDED,
|
||||
self.State.READY,
|
||||
]
|
||||
|
||||
def transfer(self):
|
||||
"""Going somewhere. Not implemented."""
|
||||
raise NotImplementedError()
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
{% url 'domain-dns-nameservers' pk=domain.id as url %}
|
||||
{% if domain.nameservers|length > 0 %}
|
||||
{% include "includes/summary_item.html" with title='DNS name servers' domains='true' value=domain.nameservers list='true' edit_link=url %}
|
||||
{% include "includes/summary_item.html" with title='DNS name servers' domains='true' value=domain.nameservers list='true' edit_link=url editable=domain.is_editable %}
|
||||
{% else %}
|
||||
<h2 class="margin-top-neg-1"> DNS name servers </h2>
|
||||
<p> No DNS name servers have been added yet. Before your domain can be used we’ll need information about your domain name servers.</p>
|
||||
|
@ -37,22 +37,22 @@
|
|||
{% 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 %}
|
||||
{% include "includes/summary_item.html" with title='Organization name and mailing address' value=domain.domain_info address='true' edit_link=url editable=domain.is_editable %}
|
||||
|
||||
{% 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 %}
|
||||
{% include "includes/summary_item.html" with title='Authorizing official' value=domain.domain_info.authorizing_official contact='true' edit_link=url editable=domain.is_editable %}
|
||||
|
||||
{% 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 %}
|
||||
{% include "includes/summary_item.html" with title='Your contact information' value=request.user.contact contact='true' edit_link=url editable=domain.is_editable %}
|
||||
|
||||
{% url 'domain-security-email' pk=domain.id as url %}
|
||||
{% if security_email is not None and security_email != default_security_email%}
|
||||
{% include "includes/summary_item.html" with title='Security email' value=security_email edit_link=url %}
|
||||
{% include "includes/summary_item.html" with title='Security email' value=security_email edit_link=url editable=domain.is_editable %}
|
||||
{% else %}
|
||||
{% include "includes/summary_item.html" with title='Security email' value='None provided' edit_link=url %}
|
||||
{% include "includes/summary_item.html" with title='Security email' value='None provided' edit_link=url editable=domain.is_editable %}
|
||||
{% endif %}
|
||||
{% url 'domain-users' pk=domain.id as url %}
|
||||
{% include "includes/summary_item.html" with title='Domain managers' users='true' list=True value=domain.permissions.all edit_link=url %}
|
||||
{% include "includes/summary_item.html" with title='Domain managers' users='true' list=True value=domain.permissions.all edit_link=url editable=domain.is_editable %}
|
||||
|
||||
</div>
|
||||
{% endblock %} {# domain_content #}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
{% if domain.is_editable %}
|
||||
<li class="usa-sidenav__item">
|
||||
{% url 'domain-dns' pk=domain.id as url %}
|
||||
<a href="{{ url }}" {% if request.path|startswith:url %}class="usa-current"{% endif %}>
|
||||
|
@ -98,6 +99,7 @@
|
|||
Domain managers
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if edit_link %}
|
||||
{% if editable and edit_link %}
|
||||
<div class="text-right">
|
||||
<a
|
||||
href="{{ edit_link }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue