From b92fe3f4697c0dd438ee32528c2aab5ed6ddb10f Mon Sep 17 00:00:00 2001 From: Seamus Johnston Date: Thu, 17 Nov 2022 09:50:56 -0600 Subject: [PATCH] Show domain applications on home --- src/registrar/templates/home.html | 32 +++++++++++++++++++++++++++++-- src/registrar/views/index.py | 8 +++++++- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/registrar/templates/home.html b/src/registrar/templates/home.html index f6601d25c..c6de271d1 100644 --- a/src/registrar/templates/home.html +++ b/src/registrar/templates/home.html @@ -17,9 +17,37 @@

This is the .gov registrar.

{% if user.is_authenticated %} -

Click here to log out.

+ +{% if domain_applications %} +

Your domain applications

+ + + + + + + + + + {% for application in domain_applications %} + + + + + {% endfor %} + +
Your domain applications
NameStatus
{{ application.requested_domain.website }}{{ application.status }}
+{% endif %} + +

Apply

+ +

Edit profile

+ +

CISA admin panel

+ +

Click here to log out.

{% else %} -

Click here to log in.

+

Click here to log in.

{% endif %} {% endblock %} diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index e4acc7818..6d50b3948 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -1,6 +1,12 @@ from django.shortcuts import render +from registrar.models import DomainApplication + def index(request): """This page is available to anyone without logging in.""" - return render(request, "home.html") + context = {} + if request.user.is_authenticated: + applications = DomainApplication.objects.filter(creator=request.user) + context["domain_applications"] = applications + return render(request, "home.html", context)