From 2ab513b7b25e6393bbe04a1cfd16fc264a5b49e9 Mon Sep 17 00:00:00 2001 From: Calum Andrew Morrell Date: Sun, 9 Nov 2025 12:40:59 +0000 Subject: [PATCH] Added homepage view and basic templates. --- core/templates/base.html | 27 +++++++++++++++++++++++++++ core/templates/core/homepage.html | 4 ++++ core/templates/footer.html | 4 ++++ core/templates/header.html | 4 ++++ core/templates/pagination.html | 15 +++++++++++++++ core/templates/usernav.html | 31 +++++++++++++++++++++++++++++++ core/urls.py | 9 +++++++++ core/views.py | 6 ++++-- 8 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 core/templates/base.html create mode 100644 core/templates/core/homepage.html create mode 100644 core/templates/footer.html create mode 100644 core/templates/header.html create mode 100644 core/templates/pagination.html create mode 100644 core/templates/usernav.html create mode 100644 core/urls.py diff --git a/core/templates/base.html b/core/templates/base.html new file mode 100644 index 0000000..1dbbd44 --- /dev/null +++ b/core/templates/base.html @@ -0,0 +1,27 @@ +{% load static %} + + + + + + {% block title %}Astronomy Base - The Dazed Gerbil{% endblock %} + + {% block styles %}{% endblock %} + + + {% block page %} + {% block usernav %} + {% include 'usernav.html' %} + {% endblock %} + {% block header %} + {% include 'header.html' %} + {% endblock %} + {% block sitenav %}{% endblock %} + {% block content %}{% endblock %} + {% block footer %} + {% include 'footer.html' %} + {% endblock %} + {% endblock %} + + + diff --git a/core/templates/core/homepage.html b/core/templates/core/homepage.html new file mode 100644 index 0000000..357a399 --- /dev/null +++ b/core/templates/core/homepage.html @@ -0,0 +1,4 @@ +{% extends 'base.html' %} + +{% block content %} +{% endblock %} diff --git a/core/templates/footer.html b/core/templates/footer.html new file mode 100644 index 0000000..569d713 --- /dev/null +++ b/core/templates/footer.html @@ -0,0 +1,4 @@ + + diff --git a/core/templates/header.html b/core/templates/header.html new file mode 100644 index 0000000..8330ac4 --- /dev/null +++ b/core/templates/header.html @@ -0,0 +1,4 @@ +
+

Astronomy Base by The Dazed Gerbil

+
+ diff --git a/core/templates/pagination.html b/core/templates/pagination.html new file mode 100644 index 0000000..5c0ad1a --- /dev/null +++ b/core/templates/pagination.html @@ -0,0 +1,15 @@ + + diff --git a/core/templates/usernav.html b/core/templates/usernav.html new file mode 100644 index 0000000..75c05e9 --- /dev/null +++ b/core/templates/usernav.html @@ -0,0 +1,31 @@ +
+ +
+ diff --git a/core/urls.py b/core/urls.py new file mode 100644 index 0000000..ad5e593 --- /dev/null +++ b/core/urls.py @@ -0,0 +1,9 @@ +from django.urls import path + +from .views import Homepage + +app_name = "core" + +urlpatterns = [ + path("", Homepage.as_view(), name="homepage"), +] diff --git a/core/views.py b/core/views.py index 91ea44a..29a9d20 100644 --- a/core/views.py +++ b/core/views.py @@ -1,3 +1,5 @@ -from django.shortcuts import render +from django.views.generic import TemplateView -# Create your views here. + +class Homepage(TemplateView): + template_name = "core/homepage.html"