From a4ae775e0f170a483888f2f2deeaf841fe0f1a48 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Wed, 11 Feb 2015 20:08:04 +0100 Subject: [PATCH 1/6] Preferences in the right order in RTL --- searx/templates/oscar/macros.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index f2222c610..7d72b7092 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -37,7 +37,7 @@ {%- endmacro %} {% macro preferences_item_header(info, label) -%} - {% if not rtl %} + {% if rtl %}
@@ -49,7 +49,7 @@ {%- endmacro %} {% macro preferences_item_footer(info, label) -%} - {% if not rtl %} + {% if rtl %}
{{ info }}
From cec3ea77d54011fba3d9a9ab4ab3862ee62f0618 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Wed, 11 Feb 2015 20:18:01 +0100 Subject: [PATCH 2/6] Maps data must be LTR in RTL --- searx/templates/oscar/result_templates/map.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index 2e679e84d..822c7cdea 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -40,7 +40,7 @@ {% endif %} {% if result.osm and (result.osm.type and result.osm.id) %} -
+
Loading ...
From 3d5a4b091d00f0d67f4d15b0340d450ea204447e Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Wed, 11 Feb 2015 20:32:28 +0100 Subject: [PATCH 3/6] Translate the 'cached' in results --- searx/templates/default/result_templates/code.html | 2 +- searx/templates/default/result_templates/default.html | 2 +- searx/templates/default/result_templates/map.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/searx/templates/default/result_templates/code.html b/searx/templates/default/result_templates/code.html index 0aba4684d..751fb3b56 100644 --- a/searx/templates/default/result_templates/code.html +++ b/searx/templates/default/result_templates/code.html @@ -1,6 +1,6 @@

{% if result['favicon'] %}{{result['favicon']}}{% endif %}{{ result.title|safe }}

-

{{ result.pretty_url }} cached

+

{{ result.pretty_url }} {{ _('cached') }}

{% if result.publishedDate %}

{{ result.publishedDate }}

{% endif %}

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

{% if result.repository %}

{{ result.repository }}

{% endif %} diff --git a/searx/templates/default/result_templates/default.html b/searx/templates/default/result_templates/default.html index b7f9d3557..167db888b 100644 --- a/searx/templates/default/result_templates/default.html +++ b/searx/templates/default/result_templates/default.html @@ -1,6 +1,6 @@

{% if "icon_"~result.engine~".ico" in favicons %}{{result.engine}}{% endif %}{{ result.title|safe }}

-

{{ result.pretty_url }} cached +

{{ result.pretty_url }} {{ _('cached') }} {% if result.publishedDate %}{{ result.publishedDate }}{% endif %}

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

diff --git a/searx/templates/default/result_templates/map.html b/searx/templates/default/result_templates/map.html index 159e472b5..b0eda2be5 100644 --- a/searx/templates/default/result_templates/map.html +++ b/searx/templates/default/result_templates/map.html @@ -6,7 +6,7 @@

{{ result.title|safe }}

-

{{ result.pretty_url }} cached +

{{ result.pretty_url }} {{ _('cached') }} {% if result.publishedDate %}{{ result.publishedDate }}{% endif %}

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

From f4bdcc067ff0e6c528970a75475d621dd0d43181 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Wed, 11 Feb 2015 20:53:06 +0100 Subject: [PATCH 4/6] Real fix for preferences in RTL *and* in LTR --- searx/templates/oscar/macros.html | 16 +++++++-------- searx/templates/oscar/preferences.html | 28 +++++++++++++------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index 7d72b7092..42721a812 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -36,26 +36,26 @@

{{ result.pretty_url }}

{%- endmacro %} -{% macro preferences_item_header(info, label) -%} +{% macro preferences_item_header(info, label, rtl) -%} {% if rtl %}
- + {{ info }}
{% else %}
- {{ info }} +
{% endif %} {%- endmacro %} -{% macro preferences_item_footer(info, label) -%} +{% macro preferences_item_footer(info, label, rtl) -%} {% if rtl %} -
- {{ info }} -
- {% else %}
+ {% else %} +
+ {{ info }} + {% endif %} {%- endmacro %} diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 066524f48..b98100e8e 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -41,73 +41,73 @@ {% set language_label = _('Search language') %} {% set language_info = _('What language do you prefer for search?') %} - {{ preferences_item_header(language_info, language_label) }} + {{ preferences_item_header(language_info, language_label, rtl) }} - {{ preferences_item_footer(language_info, language_label) }} + {{ preferences_item_footer(language_info, language_label, rtl) }} {% set locale_label = _('Interface language') %} {% set locale_info = _('Change the language of the layout') %} - {{ preferences_item_header(locale_info, locale_label) }} + {{ preferences_item_header(locale_info, locale_label, rtl) }} - {{ preferences_item_footer(locale_info, locale_label) }} + {{ preferences_item_footer(locale_info, locale_label, rtl) }} {% set autocomplete_label = _('Autocomplete') %} {% set autocomplete_info = _('Find stuff as you type') %} - {{ preferences_item_header(autocomplete_info, autocomplete_label) }} + {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }} - {{ preferences_item_footer(autocomplete_info, autocomplete_label) }} + {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }} {% set image_proxy_label = _('Image proxy') %} {% set image_proxy_info = _('Proxying image results through searx') %} - {{ preferences_item_header(image_proxy_info, image_proxy_label) }} + {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }} - {{ preferences_item_footer(image_proxy_info, image_proxy_label) }} + {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }} {% set method_label = _('Method') %} {% set method_info = _('Change how forms are submited, learn more about request methods') %} - {{ preferences_item_header(method_info, method_label) }} + {{ preferences_item_header(method_info, method_label, rtl) }} - {{ preferences_item_footer(method_info, method_label) }} + {{ preferences_item_footer(method_info, method_label, rtl) }} {% set safesearch_label = _('SafeSearch') %} {% set safesearch_info = _('Filter content') %} - {{ preferences_item_header(safesearch_info, safesearch_label) }} + {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }} - {{ preferences_item_footer(safesearch_info, safesearch_label) }} + {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }} {% set theme_label = _('Themes') %} {% set theme_info = _('Change searx layout') %} - {{ preferences_item_header(theme_info, theme_label) }} + {{ preferences_item_header(theme_info, theme_label, rtl) }} - {{ preferences_item_footer(theme_info, theme_label) }} + {{ preferences_item_footer(theme_info, theme_label, rtl) }} From d4ba97d00df7e1d97c0fa63419ab74dc4ee10f00 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Wed, 11 Feb 2015 22:00:13 +0100 Subject: [PATCH 5/6] Engine table in preference page in Courgette text-aligned to the right in RTL --- searx/static/themes/courgette/css/style-rtl.css | 2 +- searx/static/themes/courgette/less/style-rtl.less | 4 ++++ searx/templates/courgette/preferences.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/searx/static/themes/courgette/css/style-rtl.css b/searx/static/themes/courgette/css/style-rtl.css index 38c4153a6..a725ac1e8 100644 --- a/searx/static/themes/courgette/css/style-rtl.css +++ b/searx/static/themes/courgette/css/style-rtl.css @@ -1 +1 @@ -.q{padding:.5em 1em .5em 3em}#search_submit{left:0;right:auto}.result .favicon{float:right;margin-left:.5em;margin-right:0}#sidebar{right:auto;left:0}#results{padding:0 32px 0 272px}.search.center{padding-right:0;padding-left:17em}.right{right:auto;left:0}#pagination form+form{float:left;margin-top:-2em} \ No newline at end of file +.q{padding:.5em 1em .5em 3em}#search_submit{left:0;right:auto}.result .favicon{float:right;margin-left:.5em;margin-right:0}#sidebar{right:auto;left:0}#results{padding:0 32px 0 272px}.search.center{padding-right:0;padding-left:17em}.right{right:auto;left:0}#pagination form+form{float:left;margin-top:-2em}.engine-table{text-align:right} \ No newline at end of file diff --git a/searx/static/themes/courgette/less/style-rtl.less b/searx/static/themes/courgette/less/style-rtl.less index 13a34f124..3e357d3d8 100644 --- a/searx/static/themes/courgette/less/style-rtl.less +++ b/searx/static/themes/courgette/less/style-rtl.less @@ -35,4 +35,8 @@ #pagination form + form { float: left; margin-top: -2em; +} + +.engine-table { + text-align:right; } \ No newline at end of file diff --git a/searx/templates/courgette/preferences.html b/searx/templates/courgette/preferences.html index 379d68601..efa0f65fa 100644 --- a/searx/templates/courgette/preferences.html +++ b/searx/templates/courgette/preferences.html @@ -95,7 +95,7 @@
{{ _('Currently used search engines') }} -
+
From b5cbbcede4bb352531198d4e80a36d0082ccfa6e Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Thu, 12 Feb 2015 02:02:30 +0100 Subject: [PATCH 6/6] LTR the about page correctly --- searx/templates/courgette/about.html | 2 +- searx/templates/default/about.html | 2 +- searx/templates/oscar/about.html | 2 +- searx/webapp.py | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/searx/templates/courgette/about.html b/searx/templates/courgette/about.html index 1c2e0635d..2945e1f7b 100644 --- a/searx/templates/courgette/about.html +++ b/searx/templates/courgette/about.html @@ -1,7 +1,7 @@ {% extends 'courgette/base.html' %} {% block content %} {% include 'courgette/github_ribbon.html' %} -
+

About searx

Searx is a metasearch engine, aggregating the results of other search engines while not storing information about its users. diff --git a/searx/templates/default/about.html b/searx/templates/default/about.html index 01d6f444e..1b5fc34c0 100644 --- a/searx/templates/default/about.html +++ b/searx/templates/default/about.html @@ -1,7 +1,7 @@ {% extends 'default/base.html' %} {% block content %} {% include 'default/github_ribbon.html' %} -

+

About searx

Searx is a metasearch engine, aggregating the results of other search engines while not storing information about its users. diff --git a/searx/templates/oscar/about.html b/searx/templates/oscar/about.html index 6f9572546..e1f378294 100644 --- a/searx/templates/oscar/about.html +++ b/searx/templates/oscar/about.html @@ -2,7 +2,7 @@ {% block site_alert_warning_nojs %} {% endblock %} {% block title %}{{ _('about') }} - {% endblock %} {% block content %} -

+

About searx

Searx is a metasearch engine, aggregating the results of other search engines while not storing information about its users. diff --git a/searx/webapp.py b/searx/webapp.py index 77b4507e9..b12a08db5 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -412,7 +412,6 @@ def about(): """Render about page""" return render( 'about.html', - rtl=False, )

{{ _('Engine name') }} {{ _('Category') }}