diff --git a/bakerydemo/locations/models.py b/bakerydemo/locations/models.py index 8d5b8d931..62ba65f0a 100644 --- a/bakerydemo/locations/models.py +++ b/bakerydemo/locations/models.py @@ -1,4 +1,4 @@ -from datetime import datetime +from django.utils import timezone from django.conf import settings from django.core.validators import RegexValidator @@ -182,9 +182,9 @@ def operating_hours(self): hours = self.hours_of_operation.all() return hours - # Determines if the location is currently open. It is timezone naive + # Determines if the location is currently open. def is_open(self): - now = datetime.now() + now = timezone.localtime() current_time = now.time() current_day = now.strftime("%a").upper() try: diff --git a/bakerydemo/search/views.py b/bakerydemo/search/views.py index 58c64921f..3c5d941eb 100644 --- a/bakerydemo/search/views.py +++ b/bakerydemo/search/views.py @@ -7,6 +7,7 @@ from bakerydemo.blog.models import BlogPage from bakerydemo.breads.models import BreadPage from bakerydemo.locations.models import LocationPage +from bakerydemo.recipes.models import RecipePage def search(request): @@ -31,7 +32,10 @@ def search(request): location_results = LocationPage.objects.live().search(search_query) location_result_ids = [p.page_ptr.id for p in location_results] - page_ids = blog_page_ids + bread_page_ids + location_result_ids + recipe_results = RecipePage.objects.live().search(search_query) + recipe_page_ids = [p.page_ptr.id for p in recipe_results] + + page_ids = blog_page_ids + bread_page_ids + location_result_ids + recipe_page_ids search_results = Page.objects.live().filter(id__in=page_ids) query = Query.get(search_query) diff --git a/bakerydemo/static/css/main.css b/bakerydemo/static/css/main.css index 6f8edaae7..a42200da5 100644 --- a/bakerydemo/static/css/main.css +++ b/bakerydemo/static/css/main.css @@ -2099,3 +2099,68 @@ input[type='radio'] { max-height: 100vh; margin-inline: auto; } + +/* ---- 404 Error Page ---- */ +.error-page { + padding: 80px 0 120px; +} + +.error-page__inner { + max-width: 600px; +} + +.error-page__code { + font-family: var(--font--primary); + font-size: 8rem; + line-height: 1; + color: var(--orange); + margin: 0 0 10px; +} + +.error-page__title { + font-size: 2.375rem; + line-height: 1.16; + margin: 0 0 20px; +} + +.error-page__description { + color: var(--grey); + margin: 0 0 40px; +} + +.error-page__actions { + display: flex; + align-items: center; + gap: 30px; + flex-wrap: wrap; +} + +.error-page__search-link { + color: var(--dark); + text-decoration: underline; +} + +.error-page__search-link:hover { + color: var(--dark-orange); +} + +@media (min-width: 768px) { + .error-page { + padding: 140px 0 200px; + } + + .error-page__code { + font-size: 12rem; + } + + .error-page__title { + font-size: 3.75rem; + line-height: 1.07; + margin-bottom: 30px; + } + + .error-page__description { + font-size: var(--font-md); + margin-bottom: 60px; + } +} diff --git a/bakerydemo/templates/404.html b/bakerydemo/templates/404.html index d069c0c4e..ef5852471 100644 --- a/bakerydemo/templates/404.html +++ b/bakerydemo/templates/404.html @@ -7,7 +7,20 @@ {% block body_class %}template-404{% endblock %} {% block content %} -
404
++ Sorry, the page you were looking for could not be found. + It may have been moved, deleted, or never existed. +
+ +