1
Fork 0

Add about page

This commit is contained in:
Jake Howard 2020-04-25 20:35:34 +01:00
parent 2bf177c349
commit 2450c81196
Signed by: jake
GPG key ID: 57AFB45680EDD477
8 changed files with 27 additions and 6 deletions

9
templates/about.html Normal file
View file

@ -0,0 +1,9 @@
{% extends "base.html" %}
{% load static %}
{% block title %}About{% endblock %}
{% block content %}
<h1>About</h1>
{% endblock%}

View file

@ -22,13 +22,13 @@
<a href="#" class="brand-logo right">Logo</a> <a href="#" class="brand-logo right">Logo</a>
<a href="#" data-target="mobile-nav" class="sidenav-trigger">menu</a> <a href="#" data-target="mobile-nav" class="sidenav-trigger">menu</a>
<ul id="nav-mobile" class="left hide-on-med-and-down"> <ul id="nav-mobile" class="left hide-on-med-and-down">
{% include "nav-items.html" %} {% include "navigation/index.html" %}
</ul> </ul>
</div> </div>
</nav> </nav>
<ul class="sidenav" id="mobile-nav"> <ul class="sidenav" id="mobile-nav">
{% include "nav-items.html" %} {% include "navigation/index.html" %}
</ul> </ul>
</header> </header>

View file

@ -1,3 +0,0 @@
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">JavaScript</a></li>

View file

@ -0,0 +1 @@
{% include "navigation/item.html" with reverse="about" text="About" %}

View file

@ -0,0 +1 @@
<li><a href="{% url reverse %}">{{ text }}</a></li>

View file

@ -14,3 +14,9 @@ class HomepageViewTestCase(BaseTestCase):
def test_contains_view_name(self): def test_contains_view_name(self):
response = self.client.get(reverse("homepage")) response = self.client.get(reverse("homepage"))
self.assertContains(response, '<body class="homepageview">') self.assertContains(response, '<body class="homepageview">')
class AboutViewTestCase(BaseTestCase):
def test_accessible(self):
response = self.client.get(reverse("about"))
self.assertEqual(response.status_code, 200)

View file

@ -2,4 +2,7 @@ from django.urls import path
from . import views from . import views
urlpatterns = [path("", views.HomepageView.as_view(), name="homepage")] urlpatterns = [
path("", views.HomepageView.as_view(), name="homepage"),
path("about/", views.AboutView.as_view(), name="about"),
]

View file

@ -3,3 +3,7 @@ from django.views.generic import TemplateView
class HomepageView(TemplateView): class HomepageView(TemplateView):
template_name = "homepage.html" template_name = "homepage.html"
class AboutView(TemplateView):
template_name = "about.html"