From 6b5f1ca79b42b977ea5f436ac7ab329fd2da1b6b Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 29 Nov 2012 08:57:12 +0100 Subject: Implement generic error pages Rather than having a 404.html, a 403.html, a 500.html,... we have a generic error.html template that we pass in an error code, a title and a (html'ish) error message. Implement the common render_404 and render_403 shortcuts. More exotic cases can be achieved by the generic render_error function. Signed-off-by: Sebastian Spaeth --- mediagoblin/templates/mediagoblin/404.html | 31 ---------------------------- mediagoblin/templates/mediagoblin/error.html | 28 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 31 deletions(-) delete mode 100644 mediagoblin/templates/mediagoblin/404.html create mode 100644 mediagoblin/templates/mediagoblin/error.html (limited to 'mediagoblin/templates') diff --git a/mediagoblin/templates/mediagoblin/404.html b/mediagoblin/templates/mediagoblin/404.html deleted file mode 100644 index c0fe8b62..00000000 --- a/mediagoblin/templates/mediagoblin/404.html +++ /dev/null @@ -1,31 +0,0 @@ -{# -# GNU MediaGoblin -- federated, autonomous media hosting -# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -#} -{% extends "mediagoblin/base.html" %} - -{% block title %}404 — {{ super() }}{% endblock %} - -{% block mediagoblin_content %} - {% trans %}Image of 404 goblin stressing out{% endtrans %} -

{% trans %}Oops!{% endtrans %}

-

{% trans %}There doesn't seem to be a page at this address. Sorry!{% endtrans %}

-

- {%- trans %}If you're sure the address is correct, maybe the page you're looking for has been moved or deleted.{% endtrans -%} -

-
-{% endblock %} diff --git a/mediagoblin/templates/mediagoblin/error.html b/mediagoblin/templates/mediagoblin/error.html new file mode 100644 index 00000000..c16b650f --- /dev/null +++ b/mediagoblin/templates/mediagoblin/error.html @@ -0,0 +1,28 @@ +{# +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +#} +{% extends "mediagoblin/base.html" %} + +{% block title %}{{err_code}} — {{ super() }}{% endblock %} + +{% block mediagoblin_content %} + {% trans %}Image of goblin stressing out{% endtrans %} +

{{ title }}

+

{{ err_msg|safe }}

+
+{% endblock %} -- cgit v1.2.3