diff --git a/searx/static/themes/eelo/css/eelo.css b/searx/static/themes/eelo/css/eelo.css index 3f6df2bf692de0b4b22372f6f772f63cca640eda..e0377eecab8fc3b92b4640b3066bc57cafc89719 100644 --- a/searx/static/themes/eelo/css/eelo.css +++ b/searx/static/themes/eelo/css/eelo.css @@ -657,13 +657,34 @@ nav #eelo_links > * { margin-top: 8px; margin-bottom: 6px; } -.result .result-content p { +.result .result-content p, +.result .result-content pre { margin-top: 8px; margin-bottom: 8px; } .result.result-torrent .extra-info > :not(:last-child) { margin-right: 16px; } +.result.result-videos { + position: relative; +} +.result.result-videos .result-content { + display: flex; + margin: 0px; +} +.result.result-videos .result-content .result_header { + margin-top: 0; +} +.result.result-videos .result-content > .thumbnail { + flex: 1; +} +.result.result-videos .result-content > :not(.thumbnail) { + flex: 3; + padding-left: 16px; +} +.result.result-videos .result-content .thumbnail > img { + width: 100%; +} .result .external-link { font-size: 14px; color: #39a441; @@ -671,8 +692,18 @@ nav #eelo_links > * { .result .extra-info { color: rgba(0, 0, 0, 0.4); } +.result .code-block { + background-color: rgba(0, 0, 0, 0.03); + padding: 0 16px; + border-radius: 8px; + border: 1px solid rgba(0, 0, 0, 0.2); +} +.result .code-block pre { + white-space: pre-wrap; +} .result.result-default, -.result.result-torrent { +.result.result-torrent, +.result.result-videos { margin-bottom: 32px; } .result.result-images { @@ -751,6 +782,18 @@ nav #eelo_links > * { width: 100%; margin-top: 16px; } +.infobox table tr { + vertical-align: baseline; +} +.infobox table tr td { + padding: 0; + padding-bottom: 8px; +} +.infobox table tr > .label { + text-align: right; + color: rgba(0, 0, 0, 0.4); + padding-right: 16px; +} #image_result_mini_gallery_header { display: flex; align-items: center; @@ -845,3 +888,9 @@ nav #eelo_links > * { margin-bottom: 8px; } } +.highlight .lineno, +.highlighttable .lineno { + margin-right: 16px; + color: rgba(0, 0, 0, 0.4); + display: none; +} diff --git a/searx/static/themes/eelo/css/eelo.min.css b/searx/static/themes/eelo/css/eelo.min.css index 7811576050f650fd92cfbb01099b2a6817f49710..00670167f6e7abd593dc16745fd424887be2e88d 100644 Binary files a/searx/static/themes/eelo/css/eelo.min.css and b/searx/static/themes/eelo/css/eelo.min.css differ diff --git a/searx/static/themes/eelo/less/eelo/code.less b/searx/static/themes/eelo/less/eelo/code.less new file mode 100644 index 0000000000000000000000000000000000000000..d1a30e365ae61c1b6e74c6665166cbab26b00712 --- /dev/null +++ b/searx/static/themes/eelo/less/eelo/code.less @@ -0,0 +1,11 @@ +.highlight, .highlighttable { + .lineno { + margin-right: @spacing_large; + color: @text-muted-color; + display: none; + } + .kd {} + .kt {} + .nf {} + .o {} +} \ No newline at end of file diff --git a/searx/static/themes/eelo/less/eelo/defs.less b/searx/static/themes/eelo/less/eelo/defs.less index 8b60d3cca0ed1b94b646036b71855918213da516..5a49eefb3e708c7601e780bc9d5902d561919181 100644 --- a/searx/static/themes/eelo/less/eelo/defs.less +++ b/searx/static/themes/eelo/less/eelo/defs.less @@ -13,6 +13,7 @@ @corner-radius: 8px; +@dim-color-superlighter: rgba(0, 0, 0, 0.03); @dim-color-lighter: rgba(0, 0, 0, 0.1); @dim-color-light: rgba(0, 0, 0, 0.2); @dim-color-normal: rgba(0, 0, 0, 0.4); diff --git a/searx/static/themes/eelo/less/eelo/eelo.less b/searx/static/themes/eelo/less/eelo/eelo.less index ee17dc70f13126890aa345e4767a0eea37f8cfbc..d22b257ec7359755440e8ee00d29fd797c3de727 100644 --- a/searx/static/themes/eelo/less/eelo/eelo.less +++ b/searx/static/themes/eelo/less/eelo/eelo.less @@ -7,4 +7,5 @@ @import "search.less"; @import "results.less"; -@import "preferences.less"; \ No newline at end of file +@import "preferences.less"; +@import "code.less"; \ No newline at end of file diff --git a/searx/static/themes/eelo/less/eelo/results.less b/searx/static/themes/eelo/less/eelo/results.less index e875f16d62b7a4623e231326ff17c43a893ae9db..1c3bd1e58ac8fe5abc6932a852056a922f054cf2 100644 --- a/searx/static/themes/eelo/less/eelo/results.less +++ b/searx/static/themes/eelo/less/eelo/results.less @@ -26,7 +26,7 @@ margin-top: @spacing_medium; margin-bottom: @spacing_small; - p { + p, pre { margin-top: @spacing_medium; margin-bottom: @spacing_medium; } @@ -35,6 +35,22 @@ &.result-torrent { .extra-info > :not(:last-child) { margin-right: @spacing_large; } } + &.result-videos { + position: relative; + .result-content { + display: flex; + margin: 0px; + + .result_header { margin-top: 0; } + + & > .thumbnail { flex: 1; } + & > :not(.thumbnail) { + flex: 3; + padding-left: @spacing_large; + } + .thumbnail > img { width: 100%; } + } + } .external-link { font-size: @fontsize_small; @@ -44,9 +60,21 @@ .extra-info { color: @text-muted-color; } + + + .code-block { + background-color: @dim-color-superlighter; + padding: 0 @spacing_large; + border-radius: @corner-radius; + border: 1px solid @dim-color-light; + + pre { + white-space: pre-wrap; + } + } } -.result.result-default, .result.result-torrent { +.result.result-default, .result.result-torrent, .result.result-videos { margin-bottom: @spacing_xx-large; } .result.result-images { @@ -142,6 +170,24 @@ .footer { } + + table tr { + vertical-align: baseline; + + td { + padding: 0; + padding-bottom: @spacing_medium; + } + + & > .label { + text-align: right; + color: @text-muted-color; + padding-right: @spacing_large; + } + & > .value { + + } + } } #image_result_mini_gallery_header { diff --git a/searx/templates/eelo/about.html b/searx/templates/eelo/about.html index b8012e128ef627b45a557508c23ffd8af10f6aab..159fffcc7e9baf1389e869eb4f895c0b5952078c 100644 --- a/searx/templates/eelo/about.html +++ b/searx/templates/eelo/about.html @@ -1,5 +1,7 @@ {% extends "eelo/base.html" %} {% block title %}{{ _('about') }} - {% endblock %} {% block content %} -{% include '__common__/about.html' %} +
+ {% include '__common__/about.html' %} +
{% endblock %} diff --git a/searx/templates/eelo/categories.html b/searx/templates/eelo/categories.html index 28ca885ec1ee5517bdc4cfdcc7f7f32d15cb0add..2c6f20d5351c540b44d813b4dbb75e5798af208f 100644 --- a/searx/templates/eelo/categories.html +++ b/searx/templates/eelo/categories.html @@ -18,7 +18,7 @@
{% for category in categories %} - {% if not (category in ["general", "images"] or category in selected_categories) %} + {% if not (category in ["general", "images", "map"] or category in selected_categories) %} {{ category_widget(category) }} {% endif %} {% endfor %} diff --git a/searx/templates/eelo/infobox.html b/searx/templates/eelo/infobox.html index 9b6a2b042e352a2ab35b92e87c8f8b66891d11cb..4e84ea7cf507a6da911ab0d186ba8830b0a94a31 100644 --- a/searx/templates/eelo/infobox.html +++ b/searx/templates/eelo/infobox.html @@ -21,14 +21,14 @@
{% if infobox.attributes %} - +
{% for attribute in infobox.attributes %} - + {% if attribute.image %} - + {% else %} - + {% endif %} {% endfor %} diff --git a/searx/templates/eelo/result_templates/code.html b/searx/templates/eelo/result_templates/code.html index 0c04c65bf26afd87258b8e47a2d690d473ccd121..b9659ca2cb5f92da7da37d628d1f74c4a5da800a 100644 --- a/searx/templates/eelo/result_templates/code.html +++ b/searx/templates/eelo/result_templates/code.html @@ -1,18 +1,16 @@ {% from 'eelo/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} {{ result_header(result, favicons) }} -{{ result_sub_header(result) }} +{% call result_sub_header(result) %} + {% if result.repository %}{{ result.repository }}{% endif %} +{% endcall %} -{% if result.content %}

{{ result.content|safe }}

{% endif %} +
+ {% if result.content %}{{ result.content|safe }}{% endif %} -{% if result.repository %}

{{ icon('file') }} {{ result.repository }}

{% endif %} - -
-{{ result.codelines|code_highlighter(result.code_language)|safe }} +
+ {{ result.codelines|code_highlighter(result.code_language)|safe }} +
-{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} +{{ result_footer(result) }} \ No newline at end of file diff --git a/searx/templates/eelo/result_templates/default.html b/searx/templates/eelo/result_templates/default.html index a783a0cc78f563ebb17ec925ce64f9946f00e79a..d6a4f9729e7bf957c6a6fe30e79b8a11d906ccb3 100644 --- a/searx/templates/eelo/result_templates/default.html +++ b/searx/templates/eelo/result_templates/default.html @@ -1,31 +1,13 @@ {% from 'eelo/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon with context %} {{ result_header(result, favicons) }} -{{ result_sub_header(result) }} +{% call result_sub_header(result) %} +{% endcall %} -{% if result.embedded %} - -{% endif %} - -{% if result.embedded %} -
- {{ result.embedded|safe }} -
-{% endif %} - -{% if result.img_src %} -
-
-{{ result.title|striptags }} -{% if result.content %}

{{ result.content|safe }}

{% endif %} -
+
+ + {% if result.content %}{{ result.content|safe }}{% endif %} +
-{% else %} -{% if result.content %}

{{ result.content|safe }}

{% endif %} -{% endif %} -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} {{ result_footer(result) }} -{% endif %} diff --git a/searx/templates/eelo/result_templates/torrent.html b/searx/templates/eelo/result_templates/torrent.html index 07f76913da5973b4f32d55e98f57fde5b7836787..90265d3f2d4a35a4e0b87ec8993ff008f4ffe049 100644 --- a/searx/templates/eelo/result_templates/torrent.html +++ b/searx/templates/eelo/result_templates/torrent.html @@ -38,8 +38,5 @@

{% if result.content %}{{ result.content|safe }}{% endif %}

-{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} + {{ result_footer(result) }} -{% endif %} diff --git a/searx/templates/eelo/result_templates/videos.html b/searx/templates/eelo/result_templates/videos.html index 4fe7ce60f06ccc67ea9b3828a3b4dcfc7f243b3d..724accc2c79eee40aefc568e7469b4ee3932967d 100644 --- a/searx/templates/eelo/result_templates/videos.html +++ b/searx/templates/eelo/result_templates/videos.html @@ -1,27 +1,13 @@ {% from 'eelo/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %} -{{ result_header(result, favicons) }} -{{ result_sub_header(result) }} - -{% if result.embedded %} - -{% endif %} - -{% if result.embedded %} -
- {{ result.embedded|safe }} -
-{% endif %} - -
-
- {{ result.title|striptags }} {{ result.engine }} - {% if result.content %}

{{ result.content|safe }}

{% endif %} -
-
- -{% if rtl %} -{{ result_footer_rtl(result) }} -{% else %} -{{ result_footer(result) }} -{% endif %} +
+ + {{ result.title|striptags }} {{ result.engine }} + + + {{ result_header(result, favicons) }} + {% call result_sub_header(result) -%} + {{result.engine}} + {%- endcall %} + +
\ No newline at end of file diff --git a/searx/templates/eelo/results.html b/searx/templates/eelo/results.html index d1a89bd73760b2afdf123156e55cda017c748e30..34712fe8614d2f2ddbf31a07d80350246737016b 100644 --- a/searx/templates/eelo/results.html +++ b/searx/templates/eelo/results.html @@ -40,9 +40,11 @@ {% else %} - {% macro put_results(results_slice) -%} + {% macro put_results(results_slice, no_image=False) -%} {%- for result in results_slice %} {% set template = result.template|replace('.html', '') if result['template'] else None %} + {% if no_image and template == "images" and not image_gallery %} + {% else %}
{% if template in ["torrent"] %} {{template}} @@ -55,12 +57,13 @@ {% include 'eelo/result_templates/default.html' %} {% endif %}
+ {% endif %} {%- endfor %} {%- endmacro %} diff --git a/searx/templates/eelo/stats.html b/searx/templates/eelo/stats.html index dc904d6c3c45fd135849a518596e63502d1f920f..1291474deb02370feb04ec8b73e23f5c124d0e98 100644 --- a/searx/templates/eelo/stats.html +++ b/searx/templates/eelo/stats.html @@ -1,7 +1,7 @@ {% extends "eelo/base.html" %} {% block title %}{{ _('stats') }} - {% endblock %} {% block content %} -
+

{{ _('Engine stats') }}

{% for stat_name,stat_category in stats %} diff --git a/searx/webapp.py b/searx/webapp.py index 8f984c9ee24a0f125262b43c8fb1712d0fc86ff2..ced662965fa9ac214f196c8e298ded8f9e24f143 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -480,7 +480,18 @@ def index(): # search searchData = None try: + # we dont want users to select multiple categories, this simplifies the experience. + if request.form.get("categories"): + request.form["categories"] = "general" + if request.form.get("category"): + for k, v in request.form.items(): + if k.startswith("category_"): + request.form.pop(k, None) + request.form["category_images"] = u"off" + request.form["category_" + request.form['category']] = u"On" + searchData = search(request) + except Exception as e: # log exception logger.exception('search error') @@ -491,7 +502,7 @@ def index(): else: return index_error(), 500 - # serarch 5 images and 5 videos + # serrch 5 images and 5 videos images = [] videos = [] if searchData.categories == ['general'] and searchData.pageno == 1:
{{ attribute.label }}{{ attribute.label }}{{ attribute.image.alt }}{{ attribute.image.alt }}{{ attribute.value }}{{ attribute.value }}