diff --git a/docs/developer/README.md b/docs/developer/README.md index d58dd31ad..b9b79032a 100644 --- a/docs/developer/README.md +++ b/docs/developer/README.md @@ -123,3 +123,17 @@ In an effort to keep our domain logic centralized, we are representing the state objects in the application using the [django-fsm](https://github.com/viewflow/django-fsm) library. See the [ADR number 15](../architecture/decisions/0015-use-django-fs.md) for more information on the topic. + +## Login Time Bug + +If you are seeing errors related to openid complaining about issuing a token from the future like this: + +``` +ERROR [djangooidc.oidc:243] Issued in the future +``` + +it may help to resync your laptop with time.nist.gov: + +``` +sudo sntp -sS time.nist.gov +``` diff --git a/src/registrar/templates/404.html b/src/registrar/templates/404.html index 9b791a88e..f715e0fa9 100644 --- a/src/registrar/templates/404.html +++ b/src/registrar/templates/404.html @@ -7,7 +7,7 @@ {% block content %}
-

{% translate "Page not found" %}

+

{% translate "Page not found" %}

{% translate "The requested page could not be found." %}

diff --git a/src/registrar/templates/home.html b/src/registrar/templates/home.html index 2cb5a9995..a4780c1c5 100644 --- a/src/registrar/templates/home.html +++ b/src/registrar/templates/home.html @@ -6,21 +6,51 @@
-

+

Welcome to the .gov registrar -

+
{% endblock %} {% block content %}
-

This is the .gov registrar.

+

This is the .gov registrar.

- {% if user.is_authenticated %} -

Click here to log out.

- {% else %} -

Click here to log in.

- {% endif %} +{% if user.is_authenticated %} + +{% 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

+ +{% if user.is_staff %} +

CISA admin panel

+{% endif %} + +

Click here to log out.

+{% else %} +

Click here to log in.

+{% endif %}
{% endblock %} diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index bd8439135..374336d4a 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -5,7 +5,7 @@ from django.contrib.auth import get_user_model from django_webtest import WebTest # type: ignore -from registrar.models import DomainApplication +from registrar.models import DomainApplication, Website from registrar.forms.application_wizard import TITLES @@ -55,6 +55,18 @@ class LoggedInTests(TestWithUser): super().setUp() self.client.force_login(self.user) + def test_home_lists_domain_applications(self): + response = self.client.get("/") + self.assertNotContains(response, "igorville.gov") + site = Website.objects.create(website="igorville.gov") + application = DomainApplication.objects.create( + creator=self.user, requested_domain=site + ) + response = self.client.get("/") + self.assertContains(response, "igorville.gov", count=1) + # clean up + application.delete() + def test_whoami_page(self): """User information appears on the whoami page.""" response = self.client.get("/whoami/") 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)