Added homepage view and basic templates.
parent
87321b44e1
commit
2ab513b7b2
|
|
@ -0,0 +1,27 @@
|
||||||
|
{% load static %}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<title>
|
||||||
|
{% block title %}Astronomy Base - The Dazed Gerbil{% endblock %}
|
||||||
|
</title>
|
||||||
|
{% block styles %}{% endblock %}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% 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 %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<footer>
|
||||||
|
<p>© The Dazed Gerbil 2025 to {% now "Y" %}</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<header>
|
||||||
|
<h1><a href="{% url 'core:homepage' %}">Astronomy Base by The Dazed Gerbil</a></h1>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<nav>
|
||||||
|
<hr />
|
||||||
|
<ul>
|
||||||
|
{% if page_obj.has_previous %}
|
||||||
|
<li><a href="?page=1">« first</a></li>
|
||||||
|
<li><a href="?page={{ page_obj.previous_page_number }}">previous</a></li>
|
||||||
|
{% endif %} {% for page in page_obj.paginator.page_range %}
|
||||||
|
<li><a href="?page={{ page }}">{{ page }}</a></li>
|
||||||
|
{% endfor %} {% if page_obj.has_next %}
|
||||||
|
<li><a href="?page={{ page_obj.next_page_number }}">next</a></li>
|
||||||
|
<li><a href="?page={{ page_obj.paginator.num_pages }}">last »</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<div>
|
||||||
|
<ul>
|
||||||
|
{% if request.user.is_authenticated %}
|
||||||
|
<span>Nice to see you again {{ request.user }}!</span>
|
||||||
|
<li>
|
||||||
|
<a href="{% url 'dashboard:dashboard' %}">Dashboard</a>
|
||||||
|
</li>
|
||||||
|
{# <li><a href="{% url 'display_profile' %}">Account profile</a></li> #}
|
||||||
|
<li>
|
||||||
|
<form method="post" action="{% url 'logout' %}" style="display: inline;">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button type="submit"
|
||||||
|
style="background: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
text-decoration: underline">Logout</button>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
{# <li><a href="{% url 'django_registration_register' %}">Sign up</a></li> #}
|
||||||
|
<li>
|
||||||
|
<a href="{% url 'login' %}">Login</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{% url 'password_reset' %}">Forgotten password?</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
from django.urls import path
|
||||||
|
|
||||||
|
from .views import Homepage
|
||||||
|
|
||||||
|
app_name = "core"
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path("", Homepage.as_view(), name="homepage"),
|
||||||
|
]
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue