Add error/failure templates and use full url for openid redirect

This commit is contained in:
Oliver Falk
2018-11-06 16:02:51 +01:00
parent f29bca6394
commit 7df47d6b3e
3 changed files with 29 additions and 1 deletions

22
templates/error.html Normal file
View File

@@ -0,0 +1,22 @@
{% extends 'base.html' %}
{% load i18n %}
{% load static %}
{% load bootstrap4 %}
{% block title %}Libravatar: {% trans 'Error!' %}{% endblock title %}
{% block content %}
<h1 class="error">{% trans 'Error!' %}</h1>
<p>{% block errormessage %}{% trans 'Libravatar has encountered an error.' %}{% endblock errormessage %}</p>
<div style="height:40px"></div>
{% endblock content %}
{% block backlink %}
{% if user.is_authenticated %}
<p><a href="{% url 'profile' %}">{% trans 'Back to your profile' %}</a></p>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends 'error.html' %}
{% load i18n %}
{% block errormessage %}
{% trans 'OpenID error:' %} {{ message }}
{% endblock errormessage %}

View File

@@ -28,7 +28,7 @@
<input class="required openid" id="id_openid_identifier" size="70" maxlength="255" name="openid_identifier" value="{{ openid_identifier }}" type="text"></p>
<p><input type="submit" value="{% trans 'Login' %}" />
<input type="hidden" name="next" value="{{ next }}" />
<input type="hidden" name="next" value="{{ request.build_absolute_uri }}" />
&nbsp;<a href="{% url 'home' %}">{% trans 'Cancel' %}</a></p>
</form>