From eb489c45ea74d10cfca4eefbca8c8da027f73963 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Sun, 3 Jul 2022 11:03:20 +0200 Subject: [PATCH] Submit GH bug: ask the user to do some checks before submitting a new issue --- .../themes/simple/src/less/new_issue.less | 59 ++++++++++++++----- .../static/themes/simple/src/less/stats.less | 53 +++++++++++++---- searx/templates/simple/new_issue.html | 12 +++- searx/templates/simple/stats.html | 10 ++-- 4 files changed, 100 insertions(+), 34 deletions(-) diff --git a/searx/static/themes/simple/src/less/new_issue.less b/searx/static/themes/simple/src/less/new_issue.less index 83d53b5e3..a1e5006e3 100644 --- a/searx/static/themes/simple/src/less/new_issue.less +++ b/searx/static/themes/simple/src/less/new_issue.less @@ -1,21 +1,48 @@ // SPDX-License-Identifier: AGPL-3.0-or-later +.stats_endpoint { + .github-issue-button { + display: block; + padding: 8px 16px; + font-family: sans-serif; + font-size: 16px; + color: white; + background-color: #238636; + border: #2ea043; + border-radius: 10px !important; + box-shadow: rgba(0, 0, 0, 0) 0 0 0 0; + } -.github-issue-button { - display: block; - padding: 8px 16px; - font-family: sans-serif; - font-size: 16px; - color: white; - background-color: #238636; - border: #2ea043; - border-radius: 10px !important; - box-shadow: rgba(0, 0, 0, 0) 0 0 0 0; -} + .github-issue-button:hover { + background-color: #2ea043; + } -.github-issue-button:hover { - background-color: #2ea043; -} + .issue-hide { + display: none; + } + + input[type=checked] { + position: absolute; + } + + label { + margin: 1rem 1rem 1rem 0; + } + + .step_content { + margin: 1rem 1rem 1rem 2rem; + } + + .step1, + .step2 { + visibility: hidden; + } + + .step1_delay { + transition: visibility 0s linear 4s; + } -.issue-hide { - display: none; + #step1:checked ~ .step1, + #step2:checked ~ .step2 { + visibility: visible; + } } diff --git a/searx/static/themes/simple/src/less/stats.less b/searx/static/themes/simple/src/less/stats.less index 0e54e270c..4658d4f2b 100644 --- a/searx/static/themes/simple/src/less/stats.less +++ b/searx/static/themes/simple/src/less/stats.less @@ -1,6 +1,25 @@ // SPDX-License-Identifier: AGPL-3.0-or-later .engine-stats { + border-spacing: 0; + border-collapse: collapse; + + tr td, + tr th { + border-bottom: 1px solid var(--color-result-border); + padding: 0.25rem; + } + + table.engine-tooltip { + border-spacing: 0; + border-collapse: collapse; + + td, + th { + border: none; + } + } + .engine-name { width: 20rem; } @@ -13,23 +32,33 @@ .engine-reliability { text-align: right; } +} + +table.engine-error th.engine-error-type, +table.engine-error td.engine-error-type, +failed-test { + width: 10rem; +} + +.engine-errors { + margin-top: 3rem; table.engine-error { max-width: 1280px; - margin: 1rem; - border: 1px solid gray; - } + margin: 1rem 0 3rem 0; + border: 1px solid var(--color-result-border); + .ltr-text-align-left(); - table.engine-error th.engine-error-type, - table.engine-error td.engine-error-type, - failed-test { - width: 10rem; - } + tr th, + tr td { + padding: 0.5rem; + } - table.engine-error span.log_parameters { - border-right: 1px solid gray; - padding: 0 1rem 0 0; - margin: 0 0 0 0.5rem; + & span.log_parameters { + border-right: 1px solid solid var(--color-result-border); + padding: 0 1rem 0 0; + margin: 0 0 0 0.5rem; + } } } diff --git a/searx/templates/simple/new_issue.html b/searx/templates/simple/new_issue.html index 55dbefe60..91f4f13b5 100644 --- a/searx/templates/simple/new_issue.html +++ b/searx/templates/simple/new_issue.html @@ -60,6 +60,16 @@ or manually by executing the searx/webapp.py file? --> {{-'\n '}}* {{ test_name }}: {% for result in results%}`{{ result }}`,{% endfor -%} {%- endfor -%} - + + +
+

{{ _('Please check for existing bugs about this engine on GitHub') }}

+
+ + +
+

{{ _('If this is a public instance, please specify the URL in the bug report') }}

+ +
{% endmacro %} diff --git a/searx/templates/simple/stats.html b/searx/templates/simple/stats.html index 9cc035cfd..378fedd43 100644 --- a/searx/templates/simple/stats.html +++ b/searx/templates/simple/stats.html @@ -91,15 +91,15 @@ {% endif %} -
- {% if selected_engine_name %} +{% if selected_engine_name %} +
{% for secondary in [False, True] %} {% set ns = namespace(first=true) %} {% for error in engine_reliabilities[selected_engine_name].errors %} {% if secondary == error.secondary %} {% if ns.first %} {% set ns.first = false %} -

{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}

+

{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}

{% endif %} @@ -145,7 +145,7 @@
{% endif %} {{ new_issue(selected_engine_name, engine_reliabilities[selected_engine_name]) }} - {% endif %} -
+
+{% endif %} {% endblock %}