summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFritz Reichwald <reichwald@b1-systems.de>2016-12-28 02:23:35 +0100
committerFritz Reichwald <reichwald@b1-systems.de>2016-12-28 02:23:35 +0100
commitf38dda5f16005347120838adf5b5d9b736697414 (patch)
tree9a86e806430a2c40d07840ec1ee449079023d84a
parent07143dd433bbe05588f1d3fa18b451672d083bac (diff)
downloadqutebrowser-f38dda5f16005347120838adf5b5d9b736697414.tar.gz
qutebrowser-f38dda5f16005347120838adf5b5d9b736697414.zip
Fix html_fallback and logged error message
-rw-r--r--qutebrowser/utils/jinja.py72
1 files changed, 32 insertions, 40 deletions
diff --git a/qutebrowser/utils/jinja.py b/qutebrowser/utils/jinja.py
index 16ccb2959..b3f491ad9 100644
--- a/qutebrowser/utils/jinja.py
+++ b/qutebrowser/utils/jinja.py
@@ -34,45 +34,37 @@ from PyQt5.QtCore import QUrl
html_fallback = """<!DOCTYPE html>
<html>
- <head>
- <meta charset="utf-8">
- <title>{{ title }}</title>
- {% if icon %}
- <link rel="icon" type="image/png" href="{{ icon }}">
- {% endif %}
- <style type="text/css">
- {% block style %}
- body {
- background-color: #fff;
- margin: 0;
- padding: 0;
- }
- {% endblock %}
- </style>
- </head>
- <body>
- <div id="error-container">
- <table>
- <tr>
- <td style="width: 10%; vertical-align: top;">
- <img style="width: 100%; display: block; max-width: 256px;" src="{{ data_url("img/broken_qutebrowser_logo.png") }}" />
- </td>
- <td style="padding-left: 40px;">
- <p><span style="font-size:120%;color:red">The error.html template could not be found!<br>Please check your qutebrowser installation</span><br>
-%ERROR%</p>
- <h1>Unable to load page</h1>
- Error while opening {{ url }}: <br>
- <p id="error-message-text" style="color: #a31a1a;">{{ error }}</p><br><br>
-
- <form name="bl">
- <input type="button" value="Try again" onclick="javascript:location.reload();" />
- </form>
-
- </td>
- </tr>
- </table>
-</div>
- </body>
+ <head>
+ <meta charset="utf-8">
+ <title>{{ title }}</title>
+ {% if icon %}
+ <link rel="icon" type="image/png" href="{{ icon }}">
+ {% endif %}
+ <style type="text/css">
+ {% block style %}
+ body {
+ background-color: #fff;
+ margin: 0;
+ padding: 0;
+ }
+ {% endblock %}
+ </style>
+ </head>
+ <body>
+ <div id="error-container">
+ <table>
+ <tr>
+ <td style="width: 10%; vertical-align: top;">
+ <img style="width: 100%; display: block; max-width: 256px;" src="{{ data_url("img/broken_qutebrowser_logo.png") }}" />
+ </td>
+ <td style="padding-left: 40px;">
+ <p><span style="font-size:120%;color:red">The error.html template could not be found!<br>Please check your qutebrowser installation</span><br>
+ %ERROR%</p>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </body>
</html>
"""
@@ -93,7 +85,7 @@ class Loader(jinja2.BaseLoader):
source = utils.read_file(path)
except OSError as e:
source = html_fallback.replace("%ERROR%", html.escape(str(e)))
- log.misc.error("The error.html template could not be found" + path)
+ log.misc.error("The error.html template could not be found at " + path)
# Currently we don't implement auto-reloading, so we always return True
# for up-to-date.
return source, path, lambda: True