diff --git a/src/registrar/config/settings.py b/src/registrar/config/settings.py index aa7d73c2f..688a3e8ca 100644 --- a/src/registrar/config/settings.py +++ b/src/registrar/config/settings.py @@ -189,7 +189,7 @@ MIDDLEWARE = [ # Used for waffle feature flags "waffle.middleware.WaffleMiddleware", "registrar.registrar_middleware.CheckUserProfileMiddleware", - "registrar.registrar_middleware.CheckOrganizationMiddleware", + "registrar.registrar_middleware.CheckPortfolioMiddleware", ] # application object used by Django’s built-in servers (e.g. `runserver`) diff --git a/src/registrar/config/urls.py b/src/registrar/config/urls.py index 3e0d44c4c..b81fba023 100644 --- a/src/registrar/config/urls.py +++ b/src/registrar/config/urls.py @@ -25,7 +25,7 @@ from registrar.views.domain_request import Step from registrar.views.domain_requests_json import get_domain_requests_json from registrar.views.domains_json import get_domains_json from registrar.views.utility import always_404 -from registrar.views.organizations import organization_domains, organization_domain_requests +from registrar.views.portfolios import portfolio_domains, portfolio_domain_requests from api.views import available, get_current_federal, get_current_full @@ -60,14 +60,14 @@ for step, view in [ urlpatterns = [ path("", views.index, name="home"), path( - "organization//domains/", - organization_domains, - name="organization-domains", + "portfolio//domains/", + portfolio_domains, + name="portfolio-domains", ), path( - "organization//domain_requests/", - organization_domain_requests, - name="organization-domain-requests", + "portfolio//domain_requests/", + portfolio_domain_requests, + name="portfolio-domain-requests", ), path( "admin/logout/", diff --git a/src/registrar/registrar_middleware.py b/src/registrar/registrar_middleware.py index ebb0e291d..880f9ee40 100644 --- a/src/registrar/registrar_middleware.py +++ b/src/registrar/registrar_middleware.py @@ -125,10 +125,10 @@ class CheckUserProfileMiddleware: return None -class CheckOrganizationMiddleware: +class CheckPortfolioMiddleware: """ Checks if the current user has a portfolio - If they do, redirect them to the org homepage when they navigate to home. + If they do, redirect them to the portfolio homepage when they navigate to home. """ def __init__(self, get_response): @@ -150,8 +150,8 @@ class CheckOrganizationMiddleware: user_portfolios = Portfolio.objects.filter(creator=request.user) if user_portfolios.exists(): first_portfolio = user_portfolios.first() - home_organization_with_portfolio = reverse( - "organization-domains", kwargs={"portfolio_id": first_portfolio.id} + home_with_portfolio = reverse( + "portfolio-domains", kwargs={"portfolio_id": first_portfolio.id} ) - return HttpResponseRedirect(home_organization_with_portfolio) + return HttpResponseRedirect(home_with_portfolio) return None diff --git a/src/registrar/templates/organization.html b/src/registrar/templates/organization.html deleted file mode 100644 index 33ab7ff6c..000000000 --- a/src/registrar/templates/organization.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends 'home.html' %} - -{% load static %} - -{% block homepage_content %} - -
-
-
- {% include "organization_sidebar.html" with portfolio=portfolio %} -
-
- {% block messages %} - {% include "includes/form_messages.html" %} - {% endblock %} - {# Note: Reimplement commented out functionality #} - - {% block organization_content %} - {% endblock %} - - {# Note: Reimplement this after MVP #} - - - - - - -
-
- -{% endblock %} diff --git a/src/registrar/templates/portfolio.html b/src/registrar/templates/portfolio.html new file mode 100644 index 000000000..4f37c0175 --- /dev/null +++ b/src/registrar/templates/portfolio.html @@ -0,0 +1,24 @@ +{% extends 'home.html' %} + +{% load static %} + +{% block homepage_content %} + +
+
+
+ {% include "portfolio_sidebar.html" with portfolio=portfolio %} +
+
+ {% block messages %} + {% include "includes/form_messages.html" %} + {% endblock %} + {# Note: Reimplement commented out functionality #} + + {% block portfolio_content %} + {% endblock %} + +
+
+ +{% endblock %} diff --git a/src/registrar/templates/organization_domains.html b/src/registrar/templates/portfolio_domains.html similarity index 65% rename from src/registrar/templates/organization_domains.html rename to src/registrar/templates/portfolio_domains.html index 9dff1fb0b..3009b4b14 100644 --- a/src/registrar/templates/organization_domains.html +++ b/src/registrar/templates/portfolio_domains.html @@ -1,8 +1,8 @@ -{% extends 'organization.html' %} +{% extends 'portfolio.html' %} {% load static %} -{% block organization_content %} +{% block portfolio_content %}

Domains

{% include "includes/domains_table.html" with portfolio=portfolio %} {% endblock %} diff --git a/src/registrar/templates/organization_requests.html b/src/registrar/templates/portfolio_requests.html similarity index 88% rename from src/registrar/templates/organization_requests.html rename to src/registrar/templates/portfolio_requests.html index 29d8e589d..b95f03914 100644 --- a/src/registrar/templates/organization_requests.html +++ b/src/registrar/templates/portfolio_requests.html @@ -1,8 +1,8 @@ -{% extends 'organization.html' %} +{% extends 'portfolio.html' %} {% load static %} -{% block organization_content %} +{% block portfolio_content %}

Domain requests

{% comment %} diff --git a/src/registrar/templates/organization_sidebar.html b/src/registrar/templates/portfolio_sidebar.html similarity index 87% rename from src/registrar/templates/organization_sidebar.html rename to src/registrar/templates/portfolio_sidebar.html index d2d7cd306..94c4a0b16 100644 --- a/src/registrar/templates/organization_sidebar.html +++ b/src/registrar/templates/portfolio_sidebar.html @@ -5,14 +5,14 @@

{{ portfolio.organization_name }}

  • - {% url 'organization-domains' portfolio.id as url %} + {% url 'portfolio-domains' portfolio.id as url %} Domains
  • - {% url 'organization-domain-requests' portfolio.id as url %} + {% url 'portfolio-domain-requests' portfolio.id as url %} Domain requests diff --git a/src/registrar/views/organizations.py b/src/registrar/views/portfolios.py similarity index 85% rename from src/registrar/views/organizations.py rename to src/registrar/views/portfolios.py index 61b764d7e..5ecd5d1d0 100644 --- a/src/registrar/views/organizations.py +++ b/src/registrar/views/portfolios.py @@ -5,7 +5,7 @@ from django.contrib.auth.decorators import login_required @login_required -def organization_domains(request, portfolio_id): +def portfolio_domains(request, portfolio_id): context = {} if request.user.is_authenticated: @@ -17,11 +17,11 @@ def organization_domains(request, portfolio_id): portfolio = get_object_or_404(Portfolio, id=portfolio_id) context["portfolio"] = portfolio - return render(request, "organization_domains.html", context) + return render(request, "portfolio_domains.html", context) @login_required -def organization_domain_requests(request, portfolio_id): +def portfolio_domain_requests(request, portfolio_id): context = {} if request.user.is_authenticated: @@ -36,4 +36,4 @@ def organization_domain_requests(request, portfolio_id): # This controls the creation of a new domain request in the wizard request.session["new_request"] = True - return render(request, "organization_requests.html", context) + return render(request, "portfolio_requests.html", context)