Add about page
This commit is contained in:
parent
2bf177c349
commit
2450c81196
8 changed files with 27 additions and 6 deletions
9
templates/about.html
Normal file
9
templates/about.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block title %}About{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>About</h1>
|
||||
{% endblock%}
|
|
@ -22,13 +22,13 @@
|
|||
<a href="#" class="brand-logo right">Logo</a>
|
||||
<a href="#" data-target="mobile-nav" class="sidenav-trigger">menu</a>
|
||||
<ul id="nav-mobile" class="left hide-on-med-and-down">
|
||||
{% include "nav-items.html" %}
|
||||
{% include "navigation/index.html" %}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<ul class="sidenav" id="mobile-nav">
|
||||
{% include "nav-items.html" %}
|
||||
{% include "navigation/index.html" %}
|
||||
</ul>
|
||||
</header>
|
||||
|
||||
|
|
|
@ -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>
|
1
templates/navigation/index.html
Normal file
1
templates/navigation/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
{% include "navigation/item.html" with reverse="about" text="About" %}
|
1
templates/navigation/item.html
Normal file
1
templates/navigation/item.html
Normal file
|
@ -0,0 +1 @@
|
|||
<li><a href="{% url reverse %}">{{ text }}</a></li>
|
|
@ -14,3 +14,9 @@ class HomepageViewTestCase(BaseTestCase):
|
|||
def test_contains_view_name(self):
|
||||
response = self.client.get(reverse("homepage"))
|
||||
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)
|
||||
|
|
|
@ -2,4 +2,7 @@ from django.urls import path
|
|||
|
||||
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"),
|
||||
]
|
||||
|
|
|
@ -3,3 +3,7 @@ from django.views.generic import TemplateView
|
|||
|
||||
class HomepageView(TemplateView):
|
||||
template_name = "homepage.html"
|
||||
|
||||
|
||||
class AboutView(TemplateView):
|
||||
template_name = "about.html"
|
||||
|
|
Reference in a new issue