mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-05 17:28:31 +02:00
Add basic icon with tooltip
This commit is contained in:
parent
057770c584
commit
9cd6d2f7b4
2 changed files with 34 additions and 0 deletions
|
@ -1397,6 +1397,31 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
logger.info("Changing to DNS_NEEDED state")
|
||||
logger.info("able to transition to DNS_NEEDED state")
|
||||
|
||||
def get_state_help_text(self) -> str:
|
||||
"""Returns a str containing additional information about a given state"""
|
||||
help_text = ""
|
||||
print(f"self state is {self.state}")
|
||||
match self.state:
|
||||
case self.State.DNS_NEEDED | self.State.UNKNOWN:
|
||||
help_text = (
|
||||
"Before this domain can be used, "
|
||||
"you’ll need to add name server addresses."
|
||||
)
|
||||
case self.State.READY:
|
||||
help_text = "This domain has name servers and is ready for use."
|
||||
case self.State.ON_HOLD:
|
||||
help_text = (
|
||||
"This domain is administratively paused, "
|
||||
"so it can’t be edited and won’t resolve in DNS. "
|
||||
"Contact help@get.gov for details."
|
||||
)
|
||||
case self.State.DELETED:
|
||||
help_text = (
|
||||
"This domain has been removed and "
|
||||
"is no longer registered to your organization."
|
||||
)
|
||||
return help_text
|
||||
|
||||
def _disclose_fields(self, contact: PublicContact):
|
||||
"""creates a disclose object that can be added to a contact Create using
|
||||
.disclose= <this function> on the command before sending.
|
||||
|
|
|
@ -53,6 +53,15 @@
|
|||
{% else %}
|
||||
{{ domain.state|capfirst }}
|
||||
{% endif %}
|
||||
<svg
|
||||
class="usa-icon usa-tooltip"
|
||||
data-position="top"
|
||||
title="{{domain.get_state_help_text}}"
|
||||
focusable="true"
|
||||
role="img"
|
||||
>
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#info_outline"></use>
|
||||
</svg>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url "domain" pk=domain.pk %}">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue