moved error templates
This commit is contained in:
@@ -110,6 +110,7 @@ urlpatterns = [
|
||||
url(r'^api-docs$', views.schema_view),
|
||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
url(r'^api/workouts/(?P<id>\d+)/strokedata$',views.strokedatajson),
|
||||
url(r'^500v/$',views.error500_view),
|
||||
url(r'^500/$', TemplateView.as_view(template_name='500.html'),name='500'),
|
||||
url(r'^404/$', TemplateView.as_view(template_name='404.html'),name='404'),
|
||||
url(r'^400/$', TemplateView.as_view(template_name='400.html'),name='400'),
|
||||
|
||||
@@ -44,9 +44,10 @@ CELERY_SEND_TASK_SENT_EVENT = True
|
||||
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
ALLOWED_HOSTS = ['localhost']
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
@@ -21,6 +21,16 @@ from rowsandall_app.views import rootview
|
||||
from django.contrib.auth import views as auth_views
|
||||
from rowers import views as rowersviews
|
||||
|
||||
from django.conf.urls import (
|
||||
handler400, handler403, handler404, handler500
|
||||
)
|
||||
|
||||
handler400 = 'rowers.views.error400_view'
|
||||
handler403 = 'rowers.views.error403_view'
|
||||
handler404 = 'rowers.views.error404_view'
|
||||
handler500 = 'rowers.views.error500_view'
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^password_change_done/$',auth_views.password_change_done,name='password_change_done'),
|
||||
url(r'^password_change/$',auth_views.password_change),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from django.shortcuts import render, redirect, render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.conf import settings
|
||||
|
||||
from rowingdata import main as rmain
|
||||
|
||||
16
templates/400.html
Normal file
16
templates/400.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "basenofilters.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Change Workout {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="grid_12">
|
||||
<h1>Bad Request</h1>
|
||||
<p>
|
||||
HTTP Error 400 Bad Request.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
17
templates/403.html
Normal file
17
templates/403.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "basenofilters.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Change Workout {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="grid_12">
|
||||
<h1>Forbidden</h1>
|
||||
<p>
|
||||
Access forbidden. You probably tried to access functionality on a workout
|
||||
or chart that is not owned by you.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
15
templates/404.html
Normal file
15
templates/404.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends "basenofilters.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}Change Workout {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="grid_12">
|
||||
<h1>Error 404 Page not found</h1>
|
||||
<p>
|
||||
We could not find the page on our server.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
21
templates/500.html
Normal file
21
templates/500.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{% extends "basenofilters.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}Change Workout {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="grid_12">
|
||||
<h1>Error 500 Internal Server Error</h1>
|
||||
<p>
|
||||
The site reported an internal server error. The site developer has been
|
||||
notified automatically with a full error report. You can help the developer
|
||||
by reporting an issue on Bitbucket using the button below.
|
||||
</p>
|
||||
|
||||
<div class="grid_2 alpha">
|
||||
<a class="button red small" href="https://bitbucket.org/sanderroosendaal/rowsandall/issues/new">Report an issue</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
42
templates/base.html
Normal file
42
templates/base.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{% extends "basebase.html" %}
|
||||
{% block filters %}
|
||||
{% load rowerfilters %}
|
||||
{% endblock %}
|
||||
|
||||
{% block teams %}
|
||||
{% if user.is_authenticated and user|has_teams %}
|
||||
<div class="grid_1 alpha dropdown">
|
||||
<button class="grid_1 alpha button gray small dropbtn">
|
||||
Teams
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
<a class="button gray small" href="/rowers/me/teams/">Manage Teams</a>
|
||||
{% if user|is_manager %}
|
||||
<a class="button gray small" href="/rowers/workout/upload/team/">Upload Team Member Workout</a>
|
||||
{% endif %}
|
||||
{% for t in user|user_teams %}
|
||||
<a class="button gray small" href="/rowers/list-workouts/team/{{ t.id }}/">{{ t.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<span class="tooltiptext">See recent workouts for your team</span>
|
||||
{% elif user.is_authenticated and user.rower.team.all %}
|
||||
<div class="grid_1 alpha dropdown">
|
||||
<button class="grid_1 alpha button gray small dropbtn">
|
||||
Teams
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for t in user.rower.team.all %}
|
||||
<a class="button gray small" href="/rowers/list-workouts/team/{{ t.id }}/">{{ t.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<span class="tooltiptext">See recent workouts for your team</span>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% endblock %}
|
||||
219
templates/basebase.html
Normal file
219
templates/basebase.html
Normal file
@@ -0,0 +1,219 @@
|
||||
{% load cookielaw_tags %}
|
||||
{% load analytical %}
|
||||
{% block filters %}
|
||||
{% endblock %}
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script src="/static/cookielaw/js/cookielaw.js"></script>
|
||||
{% analytical_head_top %}
|
||||
{% if GOOGLE_ANALYTICS_PROPERTY_ID %}
|
||||
{% include "ga.html" %}
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="/static/css/bokeh-0.12.3.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/static/css/bokeh-widgets-0.12.3.min.css" type="text/css" />
|
||||
|
||||
<link rel="shortcut icon" href="/static/img/favicon.ico" type="image/x-icon" />
|
||||
<link rel="icon" sizes="32x32" href="/static/img/favicon-32x32.png" type="image/png"/>
|
||||
<link rel="icon" sizes="64x64" href="/static/img/favicon-64x64.png" type="image/png"/>
|
||||
<link rel="icon" sizes="192x192" href="/static/img/favicon-192x192.png" type="image/png"/>
|
||||
<link rel="icon" sizes="16x16" href="/static/img/favicon-16x16.png" type="image/png"/>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="initial-scale=0.67">
|
||||
<title>Rowsandall</title>
|
||||
<link rel="stylesheet" href="/static/css/reset.css" />
|
||||
<link rel="stylesheet" href="/static/css/text.css" />
|
||||
<link rel="stylesheet" href="/static/css/960_12_col.css" />
|
||||
<link rel="stylesheet" href="/static/css/rowsandall.css" />
|
||||
{% block meta %} {% endblock %}
|
||||
{% analytical_head_bottom %}
|
||||
</head>
|
||||
<body>
|
||||
{% analytical_body_top %}
|
||||
{% block body_top %}{% endblock %}
|
||||
<div class="container_12">
|
||||
<div class="grid_12">
|
||||
|
||||
</div>
|
||||
<div class="grid_12">
|
||||
<div id="logo" class="grid_6 alpha">
|
||||
{% if user.rower.rowerplan == 'pro' or user.rower.rowerplan == 'coach' %}
|
||||
<p><a href="/"><img src="/static/img/logo7.png"
|
||||
alt="Rowsandall logo" height="80"></a></p>
|
||||
{% else %}
|
||||
<p><a href="/"><img src="/static/img/logo7.png"
|
||||
alt="Rowsandall logo" height="80"></a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_6 omega">
|
||||
<div class="grid_4 alpha">
|
||||
<div class="grid_1 alpha">
|
||||
<p id="header">
|
||||
<a class="button gray small" href="/rowers/videos">Videos</a></p>
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<p id="header">
|
||||
<a class="button gray small" href="http://analytics.rowsandall.com/">Rowing Analytics BLOG</a></p>
|
||||
</div>
|
||||
<div class="grid_1 omega">
|
||||
<p id="header">
|
||||
<a class="button gray small" href="/rowers/email">Contact</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_4 alpha">
|
||||
<p>Free Data and Analysis. For Rowers. By Rowers.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_1">
|
||||
<div class="grid_1 tooltip">
|
||||
{% if user.is_authenticated %}
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/me/edit">{{ user.first_name }}</a>
|
||||
</p>
|
||||
<span class="tooltiptext">Edit user account, e.g. heart rate zones, power zones, email, teams</span>
|
||||
|
||||
{% else %}
|
||||
<p><a class="button gray small" href="{% url 'login' %}">login</a> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_1">
|
||||
{% if user.is_authenticated %}
|
||||
<p><a class="button gray small" href="{% url 'logout' %}">logout</a></p>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid_1 omega">
|
||||
{% if user.rower.rowerplan == 'pro' or user.rower.rowerplan == 'coach' %}
|
||||
<h6 class="graytext">Pro Member</h6>
|
||||
{% else %}
|
||||
<div class="grid_1"><a class="button green small" href="/rowers/promembership">Upgrade to Pro</a></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid_12">
|
||||
<div class="grid_1 alpha tooltip">
|
||||
{% if user.is_authenticated %}
|
||||
<p><a class="button gray small" href="/rowers/workout/upload/">Upload</a></p>
|
||||
<span class="tooltiptext">Upload CSV, TCX, FIT data files to rowsandall.com</span>
|
||||
{% else %}
|
||||
<p><a class="button green small" href="/rowers/register">Register (free)</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_1 tooltip">
|
||||
{% if user.is_authenticated %}
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/imports/">Import</a>
|
||||
</p>
|
||||
<span class="tooltiptext">Import workouts from Strava, SportTracks, and C2 logbook</span>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 tooltip">
|
||||
{% if user.is_authenticated %}
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/list-workouts/">Workouts</a>
|
||||
</p>
|
||||
<span class="tooltiptext">See your list of workouts</span>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_1 tooltip">
|
||||
{% if user.is_authenticated %}
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/list-graphs/">Graphs</a>
|
||||
</p>
|
||||
<span class="tooltiptext">See your most recent charts</span>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_2 tooltip">
|
||||
{% if user.is_authenticated %}
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/analysis">Analysis</a>
|
||||
</p>
|
||||
<span class="tooltiptext">Analysis of workouts over a period of time</span>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="grid_1 tooltip">
|
||||
{% block teams %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clear"></div>
|
||||
<div class="grid_12">
|
||||
{% block message %}
|
||||
{% if message %}
|
||||
<p class="message">
|
||||
{{ message }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if successmessage %}
|
||||
<p class="successmessage">
|
||||
{{ successmessage }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="grid_12">
|
||||
{% load tz %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="grid_12 omega" >
|
||||
{% block footer %}
|
||||
<p id="footer">{{ versionstring }}</p>
|
||||
<div class="grid_2 alpha">
|
||||
<p id="footer"><a href="/rowers/email/">© Sander Roosendaal</a></p>
|
||||
</div>
|
||||
<div class="grid_1">
|
||||
<p id="footer">
|
||||
<a href="/rowers/about">About</a></p>
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<p id="footer">
|
||||
<a href="/rowers/developers">Developers</a></p>
|
||||
</div>
|
||||
<div class="grid_1">
|
||||
<p id="footer">
|
||||
<a href="/rowers/legal">Legal</a></p>
|
||||
</div>
|
||||
<div class="grid_1">
|
||||
<p id="footer">
|
||||
<a href="/rowers/partners">Partners</a></p>
|
||||
</div>
|
||||
<div class="grid_1">
|
||||
<p id="footer">
|
||||
<a href="/rowers/physics">Physics</a></p>
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<p id="footer">
|
||||
<a href="http://analytics.rowsandall.com/">Rowing Analytics BLOG</a></p>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
<p id="footer">
|
||||
<a href="https://www.facebook.com/groups/rowsandall/">Facebook group</a></p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% cookielaw_banner %}
|
||||
</div>
|
||||
<!-- end container -->
|
||||
{% analytical_body_bottom %}
|
||||
{% block body_bottom %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
80
templates/basefront.html
Normal file
80
templates/basefront.html
Normal file
@@ -0,0 +1,80 @@
|
||||
{% extends "basebase.html" %}
|
||||
{% block filters %}
|
||||
{% load rowerfilters %}
|
||||
{% endblock %}
|
||||
|
||||
{% block meta %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body_top %}
|
||||
<style>
|
||||
.splash {
|
||||
background-color: transparent;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
min-height: 759px;
|
||||
min-width: 1024px;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.container_12 {background-color: rgba(255,255,255,0.0);}
|
||||
.container_top {background-color: rgba(255,255,255,0.7);}
|
||||
</style>
|
||||
|
||||
<div id="bgpic" class="splash">
|
||||
|
||||
<div class="container_top">
|
||||
{% endblock %}
|
||||
|
||||
{% block teams %}
|
||||
{% if user.is_authenticated and user|has_teams %}
|
||||
<div class="grid_1 alpha dropdown">
|
||||
<button class="grid_1 alpha button gray small dropbtn">
|
||||
Teams
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
<a class="button gray small" href="/rowers/me/teams/">Manage Teams</a>
|
||||
{% if user|is_manager %}
|
||||
<a class="button gray small" href="/rowers/workout/upload/team/">Upload Team Member Workout</a>
|
||||
{% endif %}
|
||||
{% for t in user|user_teams %}
|
||||
<a class="button gray small" href="/rowers/list-workouts/team/{{ t.id }}/">{{ t.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<span class="tooltiptext">See recent workouts for your team</span>
|
||||
{% elif user.is_authenticated and user.rower.team.all %}
|
||||
<div class="grid_1 alpha dropdown">
|
||||
<button class="grid_1 alpha button gray small dropbtn">
|
||||
Teams
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for t in user.rower.team.all %}
|
||||
<a class="button gray small" href="/rowers/list-workouts/team/{{ t.id }}/">{{ t.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<span class="tooltiptext">See recent workouts for your team</span>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block body_bottom %}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var num = (Math.floor(Math.random()*4));
|
||||
|
||||
var array = ['one', 'two', 'three', 'four'];
|
||||
|
||||
|
||||
var elem = document.getElementById('bgpic');
|
||||
console.log(elem);
|
||||
elem.classList.add(array[num]);
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
26
templates/basenofilters.html
Normal file
26
templates/basenofilters.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "basebase.html" %}
|
||||
{% block filters %}
|
||||
{% load rowerfilters %}
|
||||
{% endblock %}
|
||||
|
||||
{% block teams %}
|
||||
{% if user.is_authenticated and user.rower.team.all %}
|
||||
<div class="grid_1 alpha dropdown">
|
||||
<button class="grid_1 alpha button gray small dropbtn">
|
||||
Teams
|
||||
</button>
|
||||
<div class="dropdown-content">
|
||||
{% for t in user.rower.team.all %}
|
||||
<a class="button gray small" href="/rowers/list-workouts/team/{{ t.id }}/">{{ t.name }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<span class="tooltiptext">See recent workouts for your team</span>
|
||||
{% else %}
|
||||
<p> </p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user