Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
infra
spot
Commits
c27b161f
Commit
c27b161f
authored
Feb 02, 2019
by
Daniel J. Ramirez
Browse files
Improved error display
parent
87574704
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
searx/static/themes/eelo/css/eelo.css
View file @
c27b161f
...
...
@@ -79,6 +79,18 @@ a {
#page_not_found_404
img
{
max-width
:
70%
;
}
#errors
{
border
:
2px
solid
#e06572
;
border-radius
:
8px
;
padding
:
8px
;
}
#errors
.title
{
margin-top
:
0
;
margin-bottom
:
8px
;
}
#errors
pre
{
background-color
:
rgba
(
224
,
101
,
114
,
0.1
);
}
.inline
{
display
:
flex
;
flex-direction
:
row
;
...
...
@@ -323,7 +335,7 @@ pre {
background
:
rgba
(
0
,
0
,
0
,
0.1
);
padding
:
8px
16px
;
border-radius
:
8px
;
white-space
:
pre-
wrap
;
white-space
:
pre-
line
;
}
footer
{
position
:
absolute
;
...
...
searx/static/themes/eelo/css/eelo.min.css
View file @
c27b161f
This diff is collapsed.
Click to expand it.
searx/static/themes/eelo/less/eelo/base.less
View file @
c27b161f
...
...
@@ -51,7 +51,7 @@ pre {
background: @dim-color-lighter;
padding: @spacing_medium @spacing_large;
border-radius: @corner-radius;
white-space: pre-
wrap
;
white-space: pre-
line
;
}
...
...
searx/static/themes/eelo/less/eelo/layout.less
View file @
c27b161f
...
...
@@ -56,6 +56,19 @@
max-width: 70%;
}
}
#errors {
.widget-border(@color_danger);
border-radius: @corner-radius;
padding: @spacing_medium;
.title {
margin-top: 0;
margin-bottom: @spacing_medium;
}
pre {
background-color: fade(@color_danger, 10%);
}
}
.inline {
...
...
searx/templates/eelo/base.html
View file @
c27b161f
...
...
@@ -55,24 +55,6 @@
{% set inline_search_form = true %}
<main>
{# Ignore errors for now, they might not be very useful #}
{% if errors and False %}
<div
class=
"error danger"
role=
"alert"
>
<div
class=
"header"
>
<strong
class=
"lead"
>
{{ _('Error!') }}
</strong>
<button
class=
"close"
data-dismiss=
"alert"
type=
"button"
>
{{ icon("close") }}
</button>
</div>
<ul>
{% for message in errors %}
<li>
{{ message }}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% block site_alert_error %}
{% endblock %}
...
...
searx/templates/eelo/index.html
View file @
c27b161f
{% extends "eelo/base.html" %}
{% block content %}
{% if errors %}
{% from 'eelo/macros.html' import errors_panel %}
<div
class=
"content-small-centered"
>
{{ errors_panel(errors, error_details) }}
</div>
{% endif %}
<div
id=
"index"
>
<img
src=
"{{ url_for('static', filename='img/logo_searx_a.png') }}"
alt=
"searx logo"
/>
<img
id=
"logo_inline"
src=
"{{ url_for('static', filename='img/logo_eelo_inline.png') }}"
alt=
"e logo"
/>
...
...
searx/templates/eelo/macros.html
View file @
c27b161f
...
...
@@ -129,4 +129,21 @@
{%
elif
filesize
<
1024
*1024*1024
%}{{
'{0
:0.2f
}'.
format
(
filesize
/1024/1024)
}}
{{
_
('
MiB
')
}}
{%
elif
filesize
<
1024
*1024*1024*1024
%}{{
'{0
:0.2f
}'.
format
(
filesize
/1024/1024/1024)
}}
{{
_
('
GiB
')
}}
{%
else
%}{{
'{0
:0.2f
}'.
format
(
filesize
/1024/1024/1024/1024)
}}
{{
_
('
TiB
')
}}{%
endif
%}
{%
-
endmacro
%}
{%
macro
errors_panel
(
errors
,
error_detail
)
-
%}
<
section
id=
"errors"
class=
"danger"
>
<h4
class=
"title"
>
{{_("Error")}}
</h4>
<ul>
{% for message in errors %}
<li>
{{ message }}
</li>
{% endfor %}
</ul>
{% if error_detail %}
<pre>
{{error_detail}}
</pre>
{% endif %}
</section>
{%- endmacro %}
\ No newline at end of file
searx/templates/eelo/preferences.html
View file @
c27b161f
...
...
@@ -191,6 +191,11 @@
<div
id=
"info"
>
{% if errors %}
{% from 'eelo/macros.html' import errors_panel %}
{{ errors_panel(errors) }}
{% endif %}
<div
id=
"notice"
>
<p>
{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
<br/>
...
...
searx/templates/eelo/results.html
View file @
c27b161f
...
...
@@ -123,6 +123,11 @@
</div>
<div>
{% if errors %}
{% from 'eelo/macros.html' import errors_panel %}
{{ errors_panel(errors) }}
{% endif %}
{% if infoboxes %}
{% for infobox in infoboxes %}
{% include 'eelo/components/infobox.html' %}
...
...
searx/webapp.py
View file @
c27b161f
...
...
@@ -459,7 +459,7 @@ def index_error(exn, output):
return
jsonify
({
"error"
:
f
"
{
user_error
}
:
{
exn
}
"
})
request
.
errors
.
append
(
user_error
)
return
render
(
'index.html'
)
return
render
(
'index.html'
,
error_details
=
exn
)
@
app
.
route
(
'/search'
,
methods
=
[
'GET'
,
'POST'
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment