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