ソースを参照

Merge pull request #227 from Cqoicebordel/rtl-fix

RTL-fixes
Adam Tauber 10 年 前
コミット
516105c570

+ 1
- 1
searx/static/themes/courgette/css/style-rtl.css ファイルの表示

@@ -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}

+ 4
- 0
searx/static/themes/courgette/less/style-rtl.less ファイルの表示

@@ -35,4 +35,8 @@
35 35
 #pagination form + form {
36 36
 	float: left;
37 37
 	margin-top: -2em;
38
+}
39
+
40
+.engine-table {
41
+	text-align:right;
38 42
 }

+ 1
- 1
searx/templates/courgette/about.html ファイルの表示

@@ -1,7 +1,7 @@
1 1
 {% extends 'courgette/base.html' %}
2 2
 {% block content %}
3 3
 {% include 'courgette/github_ribbon.html' %}
4
-<div class="row">
4
+<div class="row"{% if rtl %} dir="ltr"{% endif %}>
5 5
     <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6 6
 
7 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.

+ 1
- 1
searx/templates/courgette/preferences.html ファイルの表示

@@ -95,7 +95,7 @@
95 95
     <fieldset>
96 96
         <legend>{{ _('Currently used search engines') }}</legend>
97 97
 
98
-        <table>
98
+        <table class="engine-table">
99 99
             <tr>
100 100
                 <th>{{ _('Engine name') }}</th>
101 101
                 <th>{{ _('Category') }}</th>

+ 1
- 1
searx/templates/default/about.html ファイルの表示

@@ -1,7 +1,7 @@
1 1
 {% extends 'default/base.html' %}
2 2
 {% block content %}
3 3
 {% include 'default/github_ribbon.html' %}
4
-<div class="row">
4
+<div class="row"{% if rtl %} dir="ltr"{% endif %}>
5 5
     <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
6 6
 
7 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.

+ 1
- 1
searx/templates/default/result_templates/code.html ファイルの表示

@@ -1,6 +1,6 @@
1 1
 <div class="result {{ result.class }}">
2 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 4
     {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
5 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 6
     {% if result.repository %}<p class="result-content"><a href="{{ result.repository|safe }}">{{ result.repository }}</a></p>{% endif %}

+ 1
- 1
searx/templates/default/result_templates/default.html ファイルの表示

@@ -1,6 +1,6 @@
1 1
 <div class="result {{ result.class }}">
2 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 4
     {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
5 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 6
 </div>

+ 1
- 1
searx/templates/default/result_templates/map.html ファイルの表示

@@ -6,7 +6,7 @@
6 6
 
7 7
     <div>
8 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 10
         {% if result.publishedDate %}<span class="published_date">{{ result.publishedDate }}</span>{% endif %}</p>
11 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 12
     </div>

+ 1
- 1
searx/templates/oscar/about.html ファイルの表示

@@ -2,7 +2,7 @@
2 2
 {% block site_alert_warning_nojs %} {% endblock %}
3 3
 {% block title %}{{ _('about') }} - {% endblock %}
4 4
 {% block content %}
5
-<div>
5
+<div{% if rtl %} dir="ltr"{% endif %}>
6 6
     <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
7 7
 
8 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
- 8
searx/templates/oscar/macros.html ファイルの表示

@@ -36,26 +36,26 @@
36 36
     <p class="text-muted">{{ result.pretty_url }}</p>
37 37
 {%- endmacro %}
38 38
 
39
-{% macro preferences_item_header(info, label) -%}
40
-    {% if not rtl %}
39
+{% macro preferences_item_header(info, label, rtl) -%}
40
+    {% if rtl %}
41 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 43
         <div class="col-sm-4 col-md-4">
44 44
     {% else %}
45 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 47
         <div class="col-sm-4 col-md-4">
48 48
     {% endif %}
49 49
 {%- endmacro %}
50 50
 
51
-{% macro preferences_item_footer(info, label) -%}
52
-    {% if not rtl %}
51
+{% macro preferences_item_footer(info, label, rtl) -%}
52
+    {% if rtl %}
53 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 55
     </div>
56 56
     {% else %}
57 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 59
     </div>
60 60
     {% endif %}
61 61
 {%- endmacro %}

+ 14
- 14
searx/templates/oscar/preferences.html ファイルの表示

@@ -41,73 +41,73 @@
41 41
                 </div>
42 42
                 {% set language_label = _('Search language') %}
43 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 45
                     <select class="form-control" name='language'>
46 46
                         <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
47 47
                         {% for lang_id,lang_name,country_name in language_codes %}
48 48
                         <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option>
49 49
                         {% endfor %}
50 50
                     </select>
51
-                {{ preferences_item_footer(language_info, language_label) }}
51
+                {{ preferences_item_footer(language_info, language_label, rtl) }}
52 52
 
53 53
                 {% set locale_label = _('Interface language') %}
54 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 56
                     <select class="form-control" name='locale'>
57 57
                         {% for locale_id,locale_name in locales.items() %}
58 58
                         <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
59 59
                         {% endfor %}
60 60
                     </select>
61
-                {{ preferences_item_footer(locale_info, locale_label) }}
61
+                {{ preferences_item_footer(locale_info, locale_label, rtl) }}
62 62
 
63 63
                 {% set autocomplete_label = _('Autocomplete') %}
64 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 66
                     <select class="form-control" name="autocomplete">
67 67
                         <option value=""> - </option>
68 68
                         {% for backend in autocomplete_backends %}
69 69
                         <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
70 70
                         {% endfor %}
71 71
                     </select>
72
-                {{ preferences_item_footer(autocomplete_info, autocomplete_label) }}
72
+                {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
73 73
 
74 74
                 {% set image_proxy_label = _('Image proxy') %}
75 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 77
                     <select class="form-control" name='image_proxy'>
78 78
                         <option value="1" {% if image_proxy  %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
79 79
                         <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
80 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 83
                 {% set method_label = _('Method') %}
84 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 86
                     <select class="form-control" name='method'>
87 87
                         <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
88 88
                         <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
89 89
                     </select>
90
-                {{ preferences_item_footer(method_info, method_label) }}
90
+                {{ preferences_item_footer(method_info, method_label, rtl) }}
91 91
 
92 92
                 {% set safesearch_label = _('SafeSearch') %}
93 93
                 {% set safesearch_info = _('Filter content') %}
94
-                {{ preferences_item_header(safesearch_info, safesearch_label) }}
94
+                {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }}
95 95
                     <select class="form-control" name='safesearch'>
96 96
                         <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
97 97
                         <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
98 98
                         <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
99 99
                     </select>
100
-                {{ preferences_item_footer(safesearch_info, safesearch_label) }}
100
+                {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
101 101
 
102 102
                 {% set theme_label = _('Themes') %}
103 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 105
                     <select class="form-control" name="theme">
106 106
                         {% for name in themes %}
107 107
                         <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
108 108
                         {% endfor %}
109 109
                     </select>
110
-                {{ preferences_item_footer(theme_info, theme_label) }}
110
+                {{ preferences_item_footer(theme_info, theme_label, rtl) }}
111 111
             </div>
112 112
             </fieldset>
113 113
         </div>

+ 1
- 1
searx/templates/oscar/result_templates/map.html ファイルの表示

@@ -40,7 +40,7 @@
40 40
 {% endif %}
41 41
 
42 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 44
         <div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
45 45
         <table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}">
46 46
             <tr><th>key</th><th>value</th></tr>

+ 0
- 1
searx/webapp.py ファイルの表示

@@ -412,7 +412,6 @@ def about():
412 412
     """Render about page"""
413 413
     return render(
414 414
         'about.html',
415
-        rtl=False,
416 415
     )
417 416
 
418 417