on master help sign in
Merge pull request #227 from Cqoicebordel/rtl-fix
516105cAdam Tauber
searx/static/themes/courgette/css/style-rtl.css+1−1
@@ -1 +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}
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}.engine-table{text-align:right}
searx/static/themes/courgette/less/style-rtl.less+4
@@ -35,4 +35,8 @@
35#pagination form + form {
35#pagination form + form {
36 float: left;
36 float: left;
37 margin-top: -2em;
37 margin-top: -2em;
38+}
39+
40+.engine-table {
41+ text-align:right;
38}
42}
searx/templates/courgette/about.html+1−1
@@ -1,7 +1,7 @@
1{% extends 'courgette/base.html' %}
1{% extends 'courgette/base.html' %}
2{% block content %}
2{% block content %}
3{% include 'courgette/github_ribbon.html' %}
3{% include 'courgette/github_ribbon.html' %}
4−<div class="row">
4+<div class="row"{% if rtl %} dir="ltr"{% endif %}>
5 <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
5 <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6
6
7 <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
7 <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
searx/templates/courgette/preferences.html+1−1
@@ -95,7 +95,7 @@
95 <fieldset>
95 <fieldset>
96 <legend>{{ _('Currently used search engines') }}</legend>
96 <legend>{{ _('Currently used search engines') }}</legend>
97
97
98− <table>
98+ <table class="engine-table">
99 <tr>
99 <tr>
100 <th>{{ _('Engine name') }}</th>
100 <th>{{ _('Engine name') }}</th>
101 <th>{{ _('Category') }}</th>
101 <th>{{ _('Category') }}</th>
searx/templates/default/about.html+1−1
@@ -1,7 +1,7 @@
1{% extends 'default/base.html' %}
1{% extends 'default/base.html' %}
2{% block content %}
2{% block content %}
3{% include 'default/github_ribbon.html' %}
3{% include 'default/github_ribbon.html' %}
4−<div class="row">
4+<div class="row"{% if rtl %} dir="ltr"{% endif %}>
5 <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
5 <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6
6
7 <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
7 <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
searx/templates/default/result_templates/code.html+1−1
@@ -1,6 +1,6 @@
1<div class="result {{ result.class }}">
1<div class="result {{ result.class }}">
2 <h3 class="result_title"> {% if result['favicon'] %}<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" alt="{{result['favicon']}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
2 <h3 class="result_title"> {% if result['favicon'] %}<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" alt="{{result['favicon']}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
3− <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
3+ <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">{{ _('cached') }}</a></p>
4 {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
4 {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
5 <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
5 <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
6 {% if result.repository %}<p class="result-content"><a href="{{ result.repository|safe }}">{{ result.repository }}</a></p>{% endif %}
6 {% if result.repository %}<p class="result-content"><a href="{{ result.repository|safe }}">{{ result.repository }}</a></p>{% endif %}
searx/templates/default/result_templates/default.html+1−1
@@ -1,6 +1,6 @@
1<div class="result {{ result.class }}">
1<div class="result {{ result.class }}">
2 <h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
2 <h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
3− <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a>
3+ <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">{{ _('cached') }}</a>
4 {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
4 {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
5 <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
5 <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
6</div>
6</div>
searx/templates/default/result_templates/map.html+1−1
@@ -6,7 +6,7 @@
6
6
7 <div>
7 <div>
8 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
8 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
9− <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a>
9+ <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">{{ _('cached') }}</a>
10 {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
10 {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
11 <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
11 <p class="content">{% if result.img_src %}<img src="{{ image_proxify(result.img_src) }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
12 </div>
12 </div>
searx/templates/oscar/about.html+1−1
@@ -2,7 +2,7 @@
2{% block site_alert_warning_nojs %} {% endblock %}
2{% block site_alert_warning_nojs %} {% endblock %}
3{% block title %}{{ _('about') }} - {% endblock %}
3{% block title %}{{ _('about') }} - {% endblock %}
4{% block content %}
4{% block content %}
5−<div>
5+<div{% if rtl %} dir="ltr"{% endif %}>
6 <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6 <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
7
7
8 <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
8 <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
searx/templates/oscar/macros.html+8−8
@@ -36,26 +36,26 @@
36 <p class="text-muted">{{ result.pretty_url }}</p>
36 <p class="text-muted">{{ result.pretty_url }}</p>
37{%- endmacro %}
37{%- endmacro %}
38
38
39−{% macro preferences_item_header(info, label) -%}
39+{% macro preferences_item_header(info, label, rtl) -%}
40− {% if not rtl %}
40+ {% if rtl %}
41 <div class="row form-group">
41 <div class="row form-group">
42− <label class="col-sm-3 col-md-2">{{ label }}</label>
42+ <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
43 <div class="col-sm-4 col-md-4">
43 <div class="col-sm-4 col-md-4">
44 {% else %}
44 {% else %}
45 <div class="row form-group">
45 <div class="row form-group">
46− <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
46+ <label class="col-sm-3 col-md-2">{{ label }}</label>
47 <div class="col-sm-4 col-md-4">
47 <div class="col-sm-4 col-md-4">
48 {% endif %}
48 {% endif %}
49{%- endmacro %}
49{%- endmacro %}
50
50
51−{% macro preferences_item_footer(info, label) -%}
51+{% macro preferences_item_footer(info, label, rtl) -%}
52− {% if not rtl %}
52+ {% if rtl %}
53 </div>
53 </div>
54− <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
54+ <label class="col-sm-3 col-md-2">{{ label }}</label>
55 </div>
55 </div>
56 {% else %}
56 {% else %}
57 </div>
57 </div>
58− <label class="col-sm-3 col-md-2">{{ label }}</label>
58+ <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
59 </div>
59 </div>
60 {% endif %}
60 {% endif %}
61{%- endmacro %}
61{%- endmacro %}
searx/templates/oscar/preferences.html+14−14
@@ -41,73 +41,73 @@
41 </div>
41 </div>
42 {% set language_label = _('Search language') %}
42 {% set language_label = _('Search language') %}
43 {% set language_info = _('What language do you prefer for search?') %}
43 {% set language_info = _('What language do you prefer for search?') %}
44− {{ preferences_item_header(language_info, language_label) }}
44+ {{ preferences_item_header(language_info, language_label, rtl) }}
45 <select class="form-control" name='language'>
45 <select class="form-control" name='language'>
46 <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
46 <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
47 {% for lang_id,lang_name,country_name in language_codes %}
47 {% for lang_id,lang_name,country_name in language_codes %}
48 <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option>
48 <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option>
49 {% endfor %}
49 {% endfor %}
50 </select>
50 </select>
51− {{ preferences_item_footer(language_info, language_label) }}
51+ {{ preferences_item_footer(language_info, language_label, rtl) }}
52
52
53 {% set locale_label = _('Interface language') %}
53 {% set locale_label = _('Interface language') %}
54 {% set locale_info = _('Change the language of the layout') %}
54 {% set locale_info = _('Change the language of the layout') %}
55− {{ preferences_item_header(locale_info, locale_label) }}
55+ {{ preferences_item_header(locale_info, locale_label, rtl) }}
56 <select class="form-control" name='locale'>
56 <select class="form-control" name='locale'>
57 {% for locale_id,locale_name in locales.items() %}
57 {% for locale_id,locale_name in locales.items() %}
58 <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
58 <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
59 {% endfor %}
59 {% endfor %}
60 </select>
60 </select>
61− {{ preferences_item_footer(locale_info, locale_label) }}
61+ {{ preferences_item_footer(locale_info, locale_label, rtl) }}
62
62
63 {% set autocomplete_label = _('Autocomplete') %}
63 {% set autocomplete_label = _('Autocomplete') %}
64 {% set autocomplete_info = _('Find stuff as you type') %}
64 {% set autocomplete_info = _('Find stuff as you type') %}
65− {{ preferences_item_header(autocomplete_info, autocomplete_label) }}
65+ {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }}
66 <select class="form-control" name="autocomplete">
66 <select class="form-control" name="autocomplete">
67 <option value=""> - </option>
67 <option value=""> - </option>
68 {% for backend in autocomplete_backends %}
68 {% for backend in autocomplete_backends %}
69 <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
69 <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
70 {% endfor %}
70 {% endfor %}
71 </select>
71 </select>
72− {{ preferences_item_footer(autocomplete_info, autocomplete_label) }}
72+ {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
73
73
74 {% set image_proxy_label = _('Image proxy') %}
74 {% set image_proxy_label = _('Image proxy') %}
75 {% set image_proxy_info = _('Proxying image results through searx') %}
75 {% set image_proxy_info = _('Proxying image results through searx') %}
76− {{ preferences_item_header(image_proxy_info, image_proxy_label) }}
76+ {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }}
77 <select class="form-control" name='image_proxy'>
77 <select class="form-control" name='image_proxy'>
78 <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
78 <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
79 <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
79 <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
80 </select>
80 </select>
81− {{ preferences_item_footer(image_proxy_info, image_proxy_label) }}
81+ {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }}
82
82
83 {% set method_label = _('Method') %}
83 {% set method_label = _('Method') %}
84 {% set method_info = _('Change how forms are submited, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') %}
84 {% set method_info = _('Change how forms are submited, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') %}
85− {{ preferences_item_header(method_info, method_label) }}
85+ {{ preferences_item_header(method_info, method_label, rtl) }}
86 <select class="form-control" name='method'>
86 <select class="form-control" name='method'>
87 <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
87 <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
88 <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
88 <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
89 </select>
89 </select>
90− {{ preferences_item_footer(method_info, method_label) }}
90+ {{ preferences_item_footer(method_info, method_label, rtl) }}
91
91
92 {% set safesearch_label = _('SafeSearch') %}
92 {% set safesearch_label = _('SafeSearch') %}
93 {% set safesearch_info = _('Filter content') %}
93 {% set safesearch_info = _('Filter content') %}
94− {{ preferences_item_header(safesearch_info, safesearch_label) }}
94+ {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }}
95 <select class="form-control" name='safesearch'>
95 <select class="form-control" name='safesearch'>
96 <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
96 <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
97 <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
97 <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
98 <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
98 <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
99 </select>
99 </select>
100− {{ preferences_item_footer(safesearch_info, safesearch_label) }}
100+ {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
101
101
102 {% set theme_label = _('Themes') %}
102 {% set theme_label = _('Themes') %}
103 {% set theme_info = _('Change searx layout') %}
103 {% set theme_info = _('Change searx layout') %}
104− {{ preferences_item_header(theme_info, theme_label) }}
104+ {{ preferences_item_header(theme_info, theme_label, rtl) }}
105 <select class="form-control" name="theme">
105 <select class="form-control" name="theme">
106 {% for name in themes %}
106 {% for name in themes %}
107 <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
107 <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
108 {% endfor %}
108 {% endfor %}
109 </select>
109 </select>
110− {{ preferences_item_footer(theme_info, theme_label) }}
110+ {{ preferences_item_footer(theme_info, theme_label, rtl) }}
111 </div>
111 </div>
112 </fieldset>
112 </fieldset>
113 </div>
113 </div>
searx/templates/oscar/result_templates/map.html+1−1
@@ -40,7 +40,7 @@
40{% endif %}
40{% endif %}
41
41
42{% if result.osm and (result.osm.type and result.osm.id) %}
42{% if result.osm and (result.osm.type and result.osm.id) %}
43− <div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}">
43+ <div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}>
44 <div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
44 <div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
45 <table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}">
45 <table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}">
46 <tr><th>key</th><th>value</th></tr>
46 <tr><th>key</th><th>value</th></tr>
searx/webapp.py−1
@@ -412,7 +412,6 @@ def about():
412 """Render about page"""
412 """Render about page"""
413 return render(
413 return render(
414 'about.html',
414 'about.html',
415− rtl=False,
416 )
415 )
417
416
418
417