1
Fork 0

Use base on no-js page

This commit is contained in:
Jake Howard 2015-11-25 08:42:58 +00:00
parent eb80c30b81
commit 01a3bf1013
3 changed files with 70 additions and 71 deletions

View file

@ -10,6 +10,11 @@ class IndexView(TemplateView):
class NoJavascriptView(TemplateView): class NoJavascriptView(TemplateView):
template_name = 'core/no-js.html' template_name = 'core/no-js.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['no_js_redirect'] = True
return context
class Custom404View(CustomHeaderBG.Template): class Custom404View(CustomHeaderBG.Template):
template_name = 'core/404.html' template_name = 'core/404.html'

View file

@ -35,10 +35,11 @@
<script type="text/javascript" src="{% static 'js/libs.js' %}"></script> <script type="text/javascript" src="{% static 'js/libs.js' %}"></script>
<script type="text/javascript" src="{% static 'js/app.js' %}"></script> <script type="text/javascript" src="{% static 'js/app.js' %}"></script>
{% if not no_js_redirect %}
<noscript> <noscript>
<style> html, body { display:none; }</style> <style> html, body { display:none; }</style>
<meta http-equiv="refresh" content="0.0;url={% url 'pages:no-js' %}"> <meta http-equiv="refresh" content="0.0;url={% url 'pages:no-js' %}">
</noscript> </noscript>
{% endif %}
</body> </body>
</html> </html>

View file

@ -1,14 +1,8 @@
{% extends 'base.html' %}
{% load staticfiles %} {% load staticfiles %}
<!DOCTYPE html> {% block htmltitle %}Javascript is Disabled!{% endblock %}
<html>
<head> {% block content %}
<title>Javascript Disabled | TheOrangeOne</title>
<meta chatset='utf-8' />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}"/>
<link rel="shortcut icon" href=""/>
</head>
<body>
<div class="jumbotron" style="background-image: url('{% static 'img/bg.png' %}'); background-attachment: fixed;"><div class="container"><h1>Javascript is disabled!</h1></div></div> <div class="jumbotron" style="background-image: url('{% static 'img/bg.png' %}'); background-attachment: fixed;"><div class="container"><h1>Javascript is disabled!</h1></div></div>
<div class="container"> <div class="container">
<p>You appear to have javascript disabled. For my site to function properly, javascript must be enabled! The javascript is used to dynamically change the webpage on your device. Without them then the site will break, cause a tonne of errors, and not look right, all of which aren't very nice, for you or me. </p> <p>You appear to have javascript disabled. For my site to function properly, javascript must be enabled! The javascript is used to dynamically change the webpage on your device. Without them then the site will break, cause a tonne of errors, and not look right, all of which aren't very nice, for you or me. </p>
@ -67,6 +61,5 @@
After enabling javascript, the page should automatically redirect to the homepage. If it doesn't, just refresh the page, or <a href="{% url 'pages:index'%}">Click here</a>. After enabling javascript, the page should automatically redirect to the homepage. If it doesn't, just refresh the page, or <a href="{% url 'pages:index'%}">Click here</a>.
</p> </p>
</div> </div>
</body>
<script>window.location.href=location.href.replace("{% url 'pages:no-js' %}", '');</script> <script>window.location.href=location.href.replace("{% url 'pages:no-js' %}", '');</script>
</html> {% endblock%}