mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-16 22:44:11 +02:00
Cleanup
This commit is contained in:
parent
73da16ec3a
commit
5879afa94b
7 changed files with 28 additions and 25 deletions
|
@ -1980,4 +1980,4 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -527,19 +527,16 @@ class DomainSuborganizationForm(forms.ModelForm):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
if self.instance and self.instance.portfolio:
|
if self.instance and self.instance.portfolio:
|
||||||
self.fields['sub_organization'].queryset = Suborganization.objects.filter(
|
self.fields["sub_organization"].queryset = Suborganization.objects.filter(portfolio=self.instance.portfolio)
|
||||||
portfolio=self.instance.portfolio
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set custom form label
|
# Set custom form label
|
||||||
self.fields["sub_organization"].label = "Suborganization name"
|
self.fields["sub_organization"].label = "Suborganization name"
|
||||||
|
|
||||||
# Use the combobox rather than the regular select widget
|
# Use the combobox rather than the regular select widget
|
||||||
self.fields['sub_organization'].widget.template_name = "django/forms/widgets/combobox.html"
|
self.fields["sub_organization"].widget.template_name = "django/forms/widgets/combobox.html"
|
||||||
|
|
||||||
# TODO: Remove in #2352
|
# TODO: Remove in #2352
|
||||||
DomainHelper.disable_field(self.fields['sub_organization'], disable_required=True)
|
DomainHelper.disable_field(self.fields["sub_organization"], disable_required=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DomainDnssecForm(forms.Form):
|
class DomainDnssecForm(forms.Form):
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<div class="usa-combo-box">
|
<div class="usa-combo-box">
|
||||||
{% include "django/forms/widgets/select.html" %}
|
{% include "django/forms/widgets/select.html" %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,16 @@
|
||||||
{% include "includes/domain_sidenav_item.html" with item_text="Domain overview" %}
|
{% include "includes/domain_sidenav_item.html" with item_text="Domain overview" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
|
{% if portfolio %}
|
||||||
|
{% with url_name="domain-suborganization" %}
|
||||||
|
{% include "includes/domain_sidenav_item.html" with item_text="Suborganization" %}
|
||||||
|
{% endwith %}
|
||||||
|
{% else %}
|
||||||
|
{% with url_name="domain-org-name-address" %}
|
||||||
|
{% include "includes/domain_sidenav_item.html" with item_text="Organization name and mailing address" %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if domain.is_editable %}
|
{% if domain.is_editable %}
|
||||||
<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 %}
|
||||||
|
@ -50,16 +60,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% if portfolio %}
|
|
||||||
{% with url_name="domain-suborganization" %}
|
|
||||||
{% include "includes/domain_sidenav_item.html" with item_text="Suborganization" %}
|
|
||||||
{% endwith %}
|
|
||||||
{% else %}
|
|
||||||
{% with url_name="domain-org-name-address" %}
|
|
||||||
{% include "includes/domain_sidenav_item.html" with item_text="Organization name and mailing address" %}
|
|
||||||
{% endwith %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% with url_name="domain-senior-official" %}
|
{% with url_name="domain-senior-official" %}
|
||||||
{% include "includes/domain_sidenav_item.html" with item_text="Senior official" %}
|
{% include "includes/domain_sidenav_item.html" with item_text="Senior official" %}
|
||||||
|
|
|
@ -5,4 +5,4 @@
|
||||||
>
|
>
|
||||||
{{ item_text }}
|
{{ item_text }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -67,10 +67,8 @@ error messages, if necessary.
|
||||||
{% include "includes/readonly_input.html" %}
|
{% include "includes/readonly_input.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# this is the input field, itself. Toggleable because of the show_readonly flag. #}
|
{# this is the input field, itself #}
|
||||||
{% if not remove_input_field %}
|
{% include widget.template_name %}
|
||||||
{% include widget.template_name %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if append_gov %}
|
{% if append_gov %}
|
||||||
<span class="padding-top-05 padding-left-2px">.gov </span>
|
<span class="padding-top-05 padding-left-2px">.gov </span>
|
||||||
|
|
|
@ -25,6 +25,7 @@ from registrar.models import (
|
||||||
User,
|
User,
|
||||||
UserDomainRole,
|
UserDomainRole,
|
||||||
)
|
)
|
||||||
|
from registrar.models.portfolio import Portfolio
|
||||||
from registrar.models.public_contact import PublicContact
|
from registrar.models.public_contact import PublicContact
|
||||||
from registrar.models.utility.domain_helper import DomainHelper
|
from registrar.models.utility.domain_helper import DomainHelper
|
||||||
from registrar.utility.enums import DefaultEmail
|
from registrar.utility.enums import DefaultEmail
|
||||||
|
@ -272,7 +273,14 @@ class DomainSeniorOfficialView(DomainFormBaseView):
|
||||||
def get_form_kwargs(self, *args, **kwargs):
|
def get_form_kwargs(self, *args, **kwargs):
|
||||||
"""Add domain_info.senior_official instance to make a bound form."""
|
"""Add domain_info.senior_official instance to make a bound form."""
|
||||||
form_kwargs = super().get_form_kwargs(*args, **kwargs)
|
form_kwargs = super().get_form_kwargs(*args, **kwargs)
|
||||||
form_kwargs["instance"] = self.object.domain_info.senior_official
|
org_user = self.request.user.is_org_user(self.request)
|
||||||
|
|
||||||
|
if org_user:
|
||||||
|
portfolio = Portfolio.objects.filter(information_portfolio=self.object.domain_info).first()
|
||||||
|
senior_official = portfolio.senior_official if portfolio else None
|
||||||
|
else:
|
||||||
|
senior_official = self.object.domain_info.senior_official
|
||||||
|
form_kwargs["instance"] = senior_official
|
||||||
|
|
||||||
domain_info = self.get_domain_info_from_domain()
|
domain_info = self.get_domain_info_from_domain()
|
||||||
invalid_fields = [DomainRequest.OrganizationChoices.FEDERAL, DomainRequest.OrganizationChoices.TRIBAL]
|
invalid_fields = [DomainRequest.OrganizationChoices.FEDERAL, DomainRequest.OrganizationChoices.TRIBAL]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue