Add title as context and remove wrong title from templates

This commit is contained in:
Stephan Porada 2019-07-10 14:35:37 +02:00
parent d7de198302
commit eef9ec9b37
4 changed files with 6 additions and 12 deletions

View File

@ -9,7 +9,7 @@ def forbidden(e):
response = jsonify({'error': 'forbidden'}) response = jsonify({'error': 'forbidden'})
response.status_code = 403 response.status_code = 403
return response return response
return render_template('403.html.j2'), 403 return render_template('403.html.j2', title='Forbidden'), 403
@main.app_errorhandler(404) @main.app_errorhandler(404)
@ -19,7 +19,7 @@ def page_not_found(e):
response = jsonify({'error': 'not found'}) response = jsonify({'error': 'not found'})
response.status_code = 404 response.status_code = 404
return response return response
return render_template('404.html.j2'), 404 return render_template('404.html.j2', title='Not Found'), 404
@main.app_errorhandler(500) @main.app_errorhandler(500)
@ -29,4 +29,4 @@ def internal_server_error(e):
response = jsonify({'error': 'internal server error'}) response = jsonify({'error': 'internal server error'})
response.status_code = 500 response.status_code = 500
return response return response
return render_template('500.html.j2'), 500 return render_template('500.html.j2', title='Internal Server Error'), 500

View File

@ -1,9 +1,7 @@
{% extends "base.html.j2" %} {% extends "base.html.j2" %}
{% block title %}Opaque - Forbidden{% endblock %}
{% block page_content %} {% block page_content %}
<div class="page-header"> <div class="page-header">
<h1>Forbidden</h1> <p>This site is forbidden for you.</p>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,9 +1,7 @@
{% extends "base.html.j2" %} {% extends "base.html.j2" %}
{% block title %}Opaque - Page Not Found{% endblock %}
{% block page_content %} {% block page_content %}
<div class="page-header"> <div class="page-header">
<h1>Not Found</h1> <p>Site has not been found.</p>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,9 +1,7 @@
{% extends "base.html.j2" %} {% extends "base.html.j2" %}
{% block title %}Opaque - Internal Server Error{% endblock %}
{% block page_content %} {% block page_content %}
<div class="page-header"> <div class="page-header">
<h1>Internal Server Error</h1> <p>Internal Server Error. We are Sorry!</p>
</div> </div>
{% endblock %} {% endblock %}