Restructure page views
This commit is contained in:
parent
dda83f5dca
commit
4e80ab2696
5 changed files with 17 additions and 17 deletions
|
@ -6,11 +6,6 @@ from django.contrib.staticfiles.templatetags.staticfiles import static
|
|||
class IndexView(TemplateView):
|
||||
template_name = 'index.html'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['body_class'] = "index"
|
||||
return context
|
||||
|
||||
|
||||
class NoJavascriptView(TemplateView):
|
||||
template_name = 'core/no-js.html'
|
||||
|
@ -18,12 +13,6 @@ class NoJavascriptView(TemplateView):
|
|||
|
||||
class Custom404View(CustomHeaderBG.Template):
|
||||
template_name = 'core/404.html'
|
||||
header_BG = static('img/ninjas.png')
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['no_footer'] = True
|
||||
return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
context = self.get_context_data(**kwargs)
|
||||
|
@ -32,7 +21,6 @@ class Custom404View(CustomHeaderBG.Template):
|
|||
|
||||
class AboutWebsiteView(CustomHeaderBG.Template):
|
||||
template_name = 'about/website.html'
|
||||
header_BG = ''
|
||||
|
||||
|
||||
class AboutIndexView(TemplateView):
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
from django.conf.urls import include, url
|
||||
from django.views.generic import TemplateView
|
||||
from django.contrib import admin
|
||||
from project.pages.views import Custom404View
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^site-admin/', include(admin.site.urls)),
|
||||
url(r'^404/', TemplateView.as_view(template_name='core/404.html')),
|
||||
url(r'', include('project.pages.urls', namespace='pages'))
|
||||
]
|
||||
|
||||
|
||||
handler404 = Custom404View
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}"/>
|
||||
<link rel="shortcut icon" href=""/>
|
||||
</head>
|
||||
<body class="{{ body_class }}">
|
||||
<body class="{% block bodyClass%}{% endblock %}">
|
||||
{% block content%}{% endblock %}
|
||||
<footer>
|
||||
<div class="container">
|
||||
|
|
|
@ -12,8 +12,16 @@
|
|||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyClass %}404{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container center-text">
|
||||
<h5>Nope, There's nothing down here either. <a href="javascript:window.history.back()">Go back to where you came from!</h5></a>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
<h1>There's nothing here!</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,7 +1,7 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block htmltitle %}Homepage{% endblock %}
|
||||
|
||||
{% block bodyClass %}index{% endblock %}
|
||||
{% block content%}
|
||||
<div class="container-fluid" id="header">
|
||||
<div class="jumbotron container animated zoomInDown">
|
||||
|
|
Reference in a new issue