on master help sign in
Merge branch 'rtl' of github.com:Cqoicebordel/searx
df9cf9dAdam Tauber
@@ -46,7 +46,9 @@ minimal: bin/buildout minimal.cfg setup.py
46
46
47styles:
47styles:
48 @lessc -x searx/static/themes/default/less/style.less > searx/static/themes/default/css/style.css
48 @lessc -x searx/static/themes/default/less/style.less > searx/static/themes/default/css/style.css
49+ @lessc -x searx/static/themes/default/less/style-rtl.less > searx/static/themes/default/css/style-rtl.css
49 @lessc -x searx/static/themes/courgette/less/style.less > searx/static/themes/courgette/css/style.css
50 @lessc -x searx/static/themes/courgette/less/style.less > searx/static/themes/courgette/css/style.css
51+ @lessc -x searx/static/themes/courgette/less/style-rtl.less > searx/static/themes/courgette/css/style-rtl.css
50 @lessc -x searx/static/less/bootstrap/bootstrap.less > searx/static/css/bootstrap.min.css
52 @lessc -x searx/static/less/bootstrap/bootstrap.less > searx/static/css/bootstrap.min.css
51 @lessc -x searx/static/themes/oscar/less/oscar/oscar.less > searx/static/themes/oscar/css/oscar.min.css
53 @lessc -x searx/static/themes/oscar/less/oscar/oscar.less > searx/static/themes/oscar/css/oscar.min.css
52
54
searx/static/themes/courgette/css/style-rtl.cssnew file+1
@@ -0,0 +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}
searx/static/themes/courgette/css/style.css+1−1
@@ -1 +1 @@
1−*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]{-webkit-appearance:textfield}h2{color:#666;text-transform:uppercase}body{font-family:sans-serif;line-height:1.5;margin:0;background:#eee}html{position:relative;min-height:100%}a{color:#666}.title h1{font-size:7em;color:#3498db;margin:0 auto;line-height:100px;margin-top:-20px;padding-bottom:20px}.center{max-width:70em;text-align:center;background:rgba(255,255,255,0.6);padding:2em;margin:7% auto 0;position:relative}.center.search{position:static;width:auto;background:none;margin:auto;padding-top:1.8em}@media screen and (min-width:1001px){.center:after{content:"";z-index:-1;background:url(../img/bg-body-index.jpg) no-repeat;background-size:cover;width:100%;height:100%;top:0;left:0;position:fixed}.center.search:after{content:none}}.autocompleter-choices{position:absolute;margin:0;padding:0;background:#fff}.autocompleter-choices li{padding:.5em 1em}.autocompleter-choices li:hover{background:#3498db;color:#fff;cursor:pointer}#categories{text-align:center}.top_margin{position:absolute;bottom:-3.5em;width:100%;left:0}.top_margin a{display:inline-block;margin-right:1em;color:#fff;text-decoration:none}.top_margin a:hover,.top_margin a:focus{text-decoration:underline}@media screen and (max-width:1000px){.center{background:none}.top_margin a{color:#333}}.checkbox_container{margin-top:1.5em}.checkbox_container label{padding:.5em 1em;color:#333;cursor:pointer;font-size:.9em}.checkbox_container label:hover{background:#3498db;color:#fff}.checkbox_container input[type="checkbox"]{position:absolute;top:-9999px}.checkbox_container input[type="checkbox"]:checked+label{background:#3498db;color:#fff}#categories_container>div{display:inline-block}#categories .hidden{display:none;position:absolute;bottom:1em;left:0;text-align:center;width:100%;font-size:.9em;font-style:italic;color:#333}#categories:hover .hidden{display:block}@media screen and (max-width:900px){#categories_container{letter-spacing:-5px}#categories_container>div{letter-spacing:normal;margin-top:1em}.checkbox_container{margin:0}.checkbox_container label{display:block;background:#ccc;padding:1em;border:1px solid #fff}.top_margin{position:static}#categories .hidden{position:static;display:block}}@media screen and (max-width:900px) and (min-width:501px){#categories_container>div{width:31%;margin-left:2.333%}#categories_container>div:nth-child(3n+1){margin-left:0}}@media screen and (max-width:500px){#categories_container>div{width:48%;margin-left:2%;font-size:.9em}#categories_container>div:nth-child(2n+1){margin-left:0}.title h1{background:url(../img/searx-mobile.png) no-repeat;width:200px;height:39px}}#search_wrapper{position:relative}.q{padding:.5em 3em .5em 1em;width:100%;font-size:1.5em;border:0;color:#666}#search_submit{position:absolute;top:0;right:0;border:0;background:url("../img/search-icon.png") no-repeat scroll center center / 65% auto #3498db;text-indent:-9999px;width:5em;height:100%;cursor:pointer}#search_submit:hover,#search_submit:focus{background-color:#0665a2}#sidebar{background:#3498db;position:fixed;top:0;right:0;width:15em;height:100%;padding:1.5em;text-align:right}.right{position:fixed;bottom:1.5em;width:15em;right:0;z-index:1;padding:0 1.5em;text-align:right}.right a{color:#fff;display:block;text-decoration:none}.right a:hover,.right a:focus{text-decoration:underline}#preferences{background:url(../img/preference-icon.png) no-repeat right 0 auto;padding-right:1.8em}#search_url input{border:0;padding:.5em}#sidebar>div{margin-bottom:1em;color:#fff}#sidebar form{display:inline-block}#sidebar input[type="submit"]{background:#ccc;border:0;padding:.5em 1em;cursor:pointer;margin-top:.5em}#sidebar input[type="submit"]:hover,#sidebar input[type="submit"]:focus{color:#fff;background-color:#0665a2}#results{padding-right:17em;padding-left:2em;padding:0 17em 0 2em}.result p{font-size:.9em}.result .content{margin:0;color:#666}.result .url{margin-top:0;color:#ff6530}.result .favicon{float:left;position:relative;top:.5em;margin-right:.5em}.definition_result{background:#ccc;padding:1em}.definition_result .result_title,.definition_result p{margin:0}.result_title{margin-bottom:0;font-weight:normal}.highlight{font-weight:bold}.result_title a{color:#3498db;text-decoration:none}.result_title a:hover,.result_title a:focus{text-decoration:underline}.cache_link{color:#666;font-size:.9em;font-style:italic}.search.center{padding-right:17em}#answers{border:2px solid #3498db;padding:20px;color:#666;text-align:center;max-width:70em;margin:0 auto 20px}#suggestions{margin-bottom:1em}#suggestions span{color:#666}#suggestions form{display:inline-block;vertical-align:top;margin-bottom:.5em}#suggestions input[type="submit"]{color:#333;padding:.5em 1em;border:0;background:#ccc;cursor:pointer}#suggestions input[type="submit"]:hover,#suggestions input[type="submit"]:focus{background:#3498db;color:#fff}#pagination{margin:1.5em 0 2em}#pagination form+form{float:right;margin-top:-2em}input[type="submit"]{display:inline-block;background:#3498db;color:#fff;border:0;padding:.6em 1em;cursor:pointer}input[type="submit"]:hover,input[type="submit"]:focus{background:#0665a2}.row{max-width:60em;margin:auto}.row a{color:#3498db}.row form{letter-spacing:-5px}.row form>*{letter-spacing:normal}.row p{margin:0}.row fieldset{display:inline-block;width:48%;vertical-align:top}.row fieldset:last-of-type{display:block;width:auto;background:none;padding:0}.row fieldset:nth-child(odd){margin-right:2%}.row fieldset:nth-child(2){min-height:10.5em}@media screen and (max-width:900px){.row{margin:0 1em}.row fieldset{width:49%}.row fieldset,.row fieldset:nth-child(odd){margin-right:0}.row fieldset:first-child{width:100%;margin-right:0}.row fieldset:nth-child(even){margin-right:2%}}@media screen and (max-width:800px){.row fieldset{width:100%}select{width:100%}table{font-size:.8em}.right{display:none}#sidebar{display:none}#results{padding:0 2em}.search.center{padding-right:2em}}@media screen and (max-width:400px){.row #categories_container>div{width:100%;margin-left:0}}fieldset{border:0;margin:1em 0;background:#ccc;padding:1.5em}table{width:100%;text-align:left;border:1px solid #ccc;border-collapse:collapse}table th{background:#999;color:#fff}table tr:nth-child(odd){background:#ccc}table th,table td{padding:.5em 1em;border:1px solid #fff}.engine_checkbox label{padding:.5em;background:#3498db;color:#fff;cursor:pointer}.engine_checkbox .deny{background:#3498db}.engine_checkbox .allow{display:none;background:#666}.engine_checkbox input{display:none}.engine_checkbox input:checked+.allow{display:inline}.engine_checkbox input:checked+.allow+.deny{display:none}.row input[type="submit"]{font-size:1em;margin:1em 0 2em}.row .right{position:static;display:inline-block}.row .right a{color:#333;width:auto;text-align:left;padding:0}.small_font{font-size:.8em}table th{padding:1em}legend{background:#eee;padding:0 1em;position:relative}select{border:1px solid #ddd;padding:.5em .8em;font-size:1em}.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#408080;font-style:italic}.highlight .err{border:1px solid #f00}.highlight .k{color:#008000;font-weight:bold}.highlight .o{color:#666}.highlight .cm{color:#408080;font-style:italic}.highlight .cp{color:#bc7a00}.highlight .c1{color:#408080;font-style:italic}.highlight .cs{color:#408080;font-style:italic}.highlight .gd{color:#a00000}.highlight .ge{font-style:italic}.highlight .gr{color:#f00}.highlight .gh{color:#000080;font-weight:bold}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:#000080;font-weight:bold}.highlight .gs{font-weight:bold}.highlight .gu{color:#800080;font-weight:bold}.highlight .gt{color:#04d}.highlight .kc{color:#008000;font-weight:bold}.highlight .kd{color:#008000;font-weight:bold}.highlight .kn{color:#008000;font-weight:bold}.highlight .kp{color:#008000}.highlight .kr{color:#008000;font-weight:bold}.highlight .kt{color:#b00040}.highlight .m{color:#666}.highlight .s{color:#ba2121}.highlight .na{color:#7d9029}.highlight .nb{color:#008000}.highlight .nc{color:#00f;font-weight:bold}.highlight .no{color:#800}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:bold}.highlight .ne{color:#d2413a;font-weight:bold}.highlight .nf{color:#00f}.highlight .nl{color:#a0a000}.highlight .nn{color:#00f;font-weight:bold}.highlight .nt{color:#008000;font-weight:bold}.highlight .nv{color:#19177c}.highlight .ow{color:#a2f;font-weight:bold}.highlight .w{color:#bbb}.highlight .mf{color:#666}.highlight .mh{color:#666}.highlight .mi{color:#666}.highlight .mo{color:#666}.highlight .sb{color:#ba2121}.highlight .sc{color:#ba2121}.highlight .sd{color:#ba2121;font-style:italic}.highlight .s2{color:#ba2121}.highlight .se{color:#b62;font-weight:bold}.highlight .sh{color:#ba2121}.highlight .si{color:#b68;font-weight:bold}.highlight .sx{color:#008000}.highlight .sr{color:#b68}.highlight .s1{color:#ba2121}.highlight .ss{color:#19177c}.highlight .bp{color:#008000}.highlight .vc{color:#19177c}.highlight .vg{color:#19177c}.highlight .vi{color:#19177c}.highlight .il{color:#666}.highlight pre{overflow:auto}.highlight .lineno{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.highlight .lineno::selection{background:transparent}.highlight .lineno::-moz-selection{background:transparent}
1+*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]{-webkit-appearance:textfield}h2{color:#666;text-transform:uppercase}body{font-family:sans-serif;line-height:1.5;margin:0;background:#eee}html{position:relative;min-height:100%}a{color:#666}.title h1{font-size:7em;color:#3498db;margin:0 auto;line-height:100px;margin-top:-20px;padding-bottom:20px}.center{max-width:70em;text-align:center;background:rgba(255,255,255,0.6);padding:2em;margin:7% auto 0;position:relative}.center.search{position:static;width:auto;background:none;margin:auto;padding-top:1.8em}@media screen and (min-width:1001px){.center:after{content:"";z-index:-1;background:url(../img/bg-body-index.jpg) no-repeat;background-size:cover;width:100%;height:100%;top:0;left:0;position:fixed}.center.search:after{content:none}}.autocompleter-choices{position:absolute;margin:0;padding:0;background:#fff}.autocompleter-choices li{padding:.5em 1em}.autocompleter-choices li:hover{background:#3498db;color:#fff;cursor:pointer}#categories{text-align:center}.top_margin{position:absolute;bottom:-3.5em;width:100%;left:0}.top_margin a{display:inline-block;margin-right:1em;color:#fff;text-decoration:none}.top_margin a:hover,.top_margin a:focus{text-decoration:underline}@media screen and (max-width:1000px){.center{background:none}.top_margin a{color:#333}}.checkbox_container{margin-top:1.5em}.checkbox_container label{padding:.5em 1em;color:#333;cursor:pointer;font-size:.9em}.checkbox_container label:hover{background:#3498db;color:#fff}.checkbox_container input[type="checkbox"]{position:absolute;top:-9999px}.checkbox_container input[type="checkbox"]:checked+label{background:#3498db;color:#fff}#categories_container>div{display:inline-block}#categories .hidden{display:none;position:absolute;bottom:1em;left:0;text-align:center;width:100%;font-size:.9em;font-style:italic;color:#333}#categories:hover .hidden{display:block}@media screen and (max-width:900px){#categories_container{letter-spacing:-5px}#categories_container>div{letter-spacing:normal;margin-top:1em}.checkbox_container{margin:0}.checkbox_container label{display:block;background:#ccc;padding:1em;border:1px solid #fff}.top_margin{position:static}#categories .hidden{position:static;display:block}}@media screen and (max-width:900px) and (min-width:501px){#categories_container>div{width:31%;margin-left:2.333%}#categories_container>div:nth-child(3n+1){margin-left:0}}@media screen and (max-width:500px){#categories_container>div{width:48%;margin-left:2%;font-size:.9em}#categories_container>div:nth-child(2n+1){margin-left:0}.title h1{background:url(../img/searx-mobile.png) no-repeat;width:200px;height:39px}}#search_wrapper{position:relative}.q{padding:.5em 3em .5em 1em;width:100%;font-size:1.5em;border:0;color:#666}#search_submit{position:absolute;top:0;right:0;border:0;background:url("../img/search-icon.png") no-repeat scroll center center / 65% auto #3498db;text-indent:-9999px;width:5em;height:100%;cursor:pointer}#search_submit:hover,#search_submit:focus{background-color:#0665a2}#sidebar{background:#3498db;position:fixed;top:0;right:0;width:15em;height:100%;padding:1.5em;text-align:right}.right{position:fixed;bottom:1.5em;width:15em;right:0;z-index:1;padding:0 1.5em;text-align:right}.right a{color:#fff;display:block;text-decoration:none}.right a:hover,.right a:focus{text-decoration:underline}#preferences{background:url("../img/preference-icon.png") no-repeat right center / 12% auto;padding-right:1.8em}#search_url input{border:0;padding:.5em}#sidebar>div{margin-bottom:1em;color:#fff}#sidebar form{display:inline-block}#sidebar input[type="submit"]{background:#ccc;border:0;padding:.5em 1em;cursor:pointer;margin-top:.5em}#sidebar input[type="submit"]:hover,#sidebar input[type="submit"]:focus{color:#fff;background-color:#0665a2}#results{padding-right:17em;padding-left:2em;padding:0 17em 0 2em}.result p{font-size:.9em}.result .content{margin:0;color:#666}.result .url{margin-top:0;color:#ff6530}.result .favicon{float:left;position:relative;top:.5em;margin-right:.5em}.definition_result{background:#ccc;padding:1em}.definition_result .result_title,.definition_result p{margin:0}.result_title{margin-bottom:0;font-weight:normal}.highlight{font-weight:bold}.result_title a{color:#3498db;text-decoration:none}.result_title a:hover,.result_title a:focus{text-decoration:underline}.cache_link{color:#666;font-size:.9em;font-style:italic}.search.center{padding-right:17em}#answers{border:2px solid #3498db;padding:20px;color:#666;text-align:center;max-width:70em;margin:0 auto 20px}#suggestions{margin-bottom:1em}#suggestions span{color:#666}#suggestions form{display:inline-block;vertical-align:top;margin-bottom:.5em}#suggestions input[type="submit"]{color:#333;padding:.5em 1em;border:0;background:#ccc;cursor:pointer}#suggestions input[type="submit"]:hover,#suggestions input[type="submit"]:focus{background:#3498db;color:#fff}#pagination{margin:1.5em 0 2em}#pagination form+form{float:right;margin-top:-2em}input[type="submit"]{display:inline-block;background:#3498db;color:#fff;border:0;padding:.6em 1em;cursor:pointer}input[type="submit"]:hover,input[type="submit"]:focus{background:#0665a2}.row{max-width:60em;margin:auto}.row a{color:#3498db}.row form{letter-spacing:-5px}.row form>*{letter-spacing:normal}.row p{margin:0}.row fieldset{display:inline-block;width:48%;vertical-align:top}.row fieldset:last-of-type{display:block;width:auto;background:none;padding:0}.row fieldset:nth-child(odd){margin-right:2%}.row fieldset:nth-child(2){min-height:10.5em}@media screen and (max-width:900px){.row{margin:0 1em}.row fieldset{width:49%}.row fieldset,.row fieldset:nth-child(odd){margin-right:0}.row fieldset:first-child{width:100%;margin-right:0}.row fieldset:nth-child(even){margin-right:2%}}@media screen and (max-width:800px){.row fieldset{width:100%}select{width:100%}table{font-size:.8em}.right{display:none}#sidebar{display:none}#results{padding:0 2em}.search.center{padding-right:2em}}@media screen and (max-width:400px){.row #categories_container>div{width:100%;margin-left:0}}fieldset{border:0;margin:1em 0;background:#ccc;padding:1.5em}table{width:100%;text-align:left;border:1px solid #ccc;border-collapse:collapse}table th{background:#999;color:#fff}table tr:nth-child(odd){background:#ccc}table th,table td{padding:.5em 1em;border:1px solid #fff}.engine_checkbox label{padding:.5em;background:#3498db;color:#fff;cursor:pointer}.engine_checkbox .deny{background:#3498db}.engine_checkbox .allow{display:none;background:#666}.engine_checkbox input{display:none}.engine_checkbox input:checked+.allow{display:inline}.engine_checkbox input:checked+.allow+.deny{display:none}.row input[type="submit"]{font-size:1em;margin:1em 0 2em}.row .right{position:static;display:inline-block}.row .right a{color:#333;width:auto;text-align:left;padding:0}.small_font{font-size:.8em}table th{padding:1em}legend{background:#eee;padding:0 1em;position:relative}select{border:1px solid #ddd;padding:.5em .8em;font-size:1em}.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#408080;font-style:italic}.highlight .err{border:1px solid #f00}.highlight .k{color:#008000;font-weight:bold}.highlight .o{color:#666}.highlight .cm{color:#408080;font-style:italic}.highlight .cp{color:#bc7a00}.highlight .c1{color:#408080;font-style:italic}.highlight .cs{color:#408080;font-style:italic}.highlight .gd{color:#a00000}.highlight .ge{font-style:italic}.highlight .gr{color:#f00}.highlight .gh{color:#000080;font-weight:bold}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:#000080;font-weight:bold}.highlight .gs{font-weight:bold}.highlight .gu{color:#800080;font-weight:bold}.highlight .gt{color:#04d}.highlight .kc{color:#008000;font-weight:bold}.highlight .kd{color:#008000;font-weight:bold}.highlight .kn{color:#008000;font-weight:bold}.highlight .kp{color:#008000}.highlight .kr{color:#008000;font-weight:bold}.highlight .kt{color:#b00040}.highlight .m{color:#666}.highlight .s{color:#ba2121}.highlight .na{color:#7d9029}.highlight .nb{color:#008000}.highlight .nc{color:#00f;font-weight:bold}.highlight .no{color:#800}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:bold}.highlight .ne{color:#d2413a;font-weight:bold}.highlight .nf{color:#00f}.highlight .nl{color:#a0a000}.highlight .nn{color:#00f;font-weight:bold}.highlight .nt{color:#008000;font-weight:bold}.highlight .nv{color:#19177c}.highlight .ow{color:#a2f;font-weight:bold}.highlight .w{color:#bbb}.highlight .mf{color:#666}.highlight .mh{color:#666}.highlight .mi{color:#666}.highlight .mo{color:#666}.highlight .sb{color:#ba2121}.highlight .sc{color:#ba2121}.highlight .sd{color:#ba2121;font-style:italic}.highlight .s2{color:#ba2121}.highlight .se{color:#b62;font-weight:bold}.highlight .sh{color:#ba2121}.highlight .si{color:#b68;font-weight:bold}.highlight .sx{color:#008000}.highlight .sr{color:#b68}.highlight .s1{color:#ba2121}.highlight .ss{color:#19177c}.highlight .bp{color:#008000}.highlight .vc{color:#19177c}.highlight .vg{color:#19177c}.highlight .vi{color:#19177c}.highlight .il{color:#666}.highlight pre{overflow:auto}.highlight .lineno{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.highlight .lineno::selection{background:transparent}.highlight .lineno::-moz-selection{background:transparent}
searx/static/themes/courgette/less/style-rtl.lessnew file+38
@@ -0,0 +1,38 @@
1+.q {
2+ padding: 0.5em 1em 0.5em 3em;
3+}
4+
5+#search_submit {
6+ left: 0;
7+ right:auto;
8+}
9+
10+.result .favicon {
11+ float: right;
12+ margin-left: 0.5em;
13+ margin-right: 0;
14+}
15+
16+#sidebar {
17+ right: auto;
18+ left: 0;
19+}
20+
21+#results {
22+ padding: 0px 32px 0px 272px;
23+}
24+
25+.search.center {
26+ padding-right: 0;
27+ padding-left: 17em;
28+}
29+
30+.right {
31+ right: auto;
32+ left: 0;
33+}
34+
35+#pagination form + form {
36+ float: left;
37+ margin-top: -2em;
38+}
searx/static/themes/courgette/less/style.less+1−1
@@ -278,7 +278,7 @@ a {
278}
278}
279
279
280#preferences {
280#preferences {
281− background: url(../img/preference-icon.png) no-repeat right 0 / 12% auto;
281+ background: url("../img/preference-icon.png") no-repeat right center / 12% auto;
282 padding-right: 1.8em;
282 padding-right: 1.8em;
283}
283}
284
284
searx/static/themes/default/css/style-rtl.cssnew file+1
@@ -0,0 +1 @@
1+#search_submit{left:1px;right:auto}.result .favicon{float:right;margin-left:.5em;margin-right:0}
searx/static/themes/default/less/style-rtl.lessnew file+11
@@ -0,0 +1,11 @@
1+#search_submit {
2+ left: 1px;
3+ right:auto;
4+}
5+
6+.result .favicon {
7+ float: right;
8+ margin-left: 0.5em;
9+ margin-right: 0;
10+}
11+
searx/templates/courgette/base.html+4−1
@@ -1,5 +1,5 @@
1<!DOCTYPE html>
1<!DOCTYPE html>
2−<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
2+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}>
3 <head>
3 <head>
4 <meta charset="UTF-8" />
4 <meta charset="UTF-8" />
5 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
5 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
@@ -8,6 +8,9 @@
8 <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
8 <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
9 <title>{% block title %}{% endblock %}searx</title>
9 <title>{% block title %}{% endblock %}searx</title>
10 <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
10 <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
11+ {% if rtl %}
12+ <link rel="stylesheet" href="{{ url_for('static', filename='css/style-rtl.css') }}" type="text/css" media="screen" />
13+ {% endif %}
11 {% if cookies['courgette-color'] %}
14 {% if cookies['courgette-color'] %}
12 <style type="text/css">
15 <style type="text/css">
13 {% include 'courgette/color.css' %}
16 {% include 'courgette/color.css' %}
searx/templates/courgette/index.html+5
@@ -5,8 +5,13 @@
5 <div class="title"><h1>searx</h1></div>
5 <div class="title"><h1>searx</h1></div>
6 {% include 'courgette/search.html' %}
6 {% include 'courgette/search.html' %}
7 <p class="top_margin">
7 <p class="top_margin">
8+ {% if rtl %}
9+ <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
10+ {% endif %}
8 <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
11 <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
12+ {% if not rtl %}
9 <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
13 <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
14+ {% endif %}
10 </p>
15 </p>
11</div>
16</div>
12{% endblock %}
17{% endblock %}
searx/templates/courgette/preferences.html+1−1
@@ -106,7 +106,7 @@
106
106
107 {% if not search_engine.private %}
107 {% if not search_engine.private %}
108 <tr>
108 <tr>
109− <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</td>
109+ <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</td>
110 <td>{{ _(categ) }}</td>
110 <td>{{ _(categ) }}</td>
111 <td class="engine_checkbox">
111 <td class="engine_checkbox">
112 <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in blocked_engines %} checked="checked"{% endif %} />
112 <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in blocked_engines %} checked="checked"{% endif %} />
searx/templates/courgette/results.html−1
@@ -8,7 +8,6 @@
8</div>
8</div>
9<div id="results">
9<div id="results">
10 <div id="sidebar">
10 <div id="sidebar">
11−
12 <div id="search_url">
11 <div id="search_url">
13 {{ _('Search URL') }}:
12 {{ _('Search URL') }}:
14 <input type="text" value="{{ base_url }}?q={{ q|urlencode }}&amp;pageno={{ pageno }}{% if selected_categories %}&amp;category_{{ selected_categories|join("&category_")|replace(' ','+') }}{% endif %}" readonly />
13 <input type="text" value="{{ base_url }}?q={{ q|urlencode }}&amp;pageno={{ pageno }}{% if selected_categories %}&amp;category_{{ selected_categories|join("&category_")|replace(' ','+') }}{% endif %}" readonly />
searx/templates/default/base.html+4−1
@@ -1,5 +1,5 @@
1<!DOCTYPE html>
1<!DOCTYPE html>
2−<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
2+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}>
3 <head>
3 <head>
4 <meta charset="UTF-8" />
4 <meta charset="UTF-8" />
5 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
5 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
@@ -8,6 +8,9 @@
8 <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
8 <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
9 <title>{% block title %}{% endblock %}searx</title>
9 <title>{% block title %}{% endblock %}searx</title>
10 <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
10 <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
11+ {% if rtl %}
12+ <link rel="stylesheet" href="{{ url_for('static', filename='css/style-rtl.css') }}" type="text/css" media="screen" />
13+ {% endif %}
11 <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" />
14 <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" />
12 {% block styles %}
15 {% block styles %}
13 {% endblock %}
16 {% endblock %}
searx/templates/default/index.html+5
@@ -4,8 +4,13 @@
4 <div class="title"><h1>searx</h1></div>
4 <div class="title"><h1>searx</h1></div>
5 {% include 'default/search.html' %}
5 {% include 'default/search.html' %}
6 <p class="top_margin">
6 <p class="top_margin">
7+ {% if rtl %}
8+ <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
9+ {% endif %}
7 <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
10 <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
11+ {% if not rtl %}
8 <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
12 <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
13+ {% endif %}
9 </p>
14 </p>
10</div>
15</div>
11{% include 'default/github_ribbon.html' %}
16{% include 'default/github_ribbon.html' %}
searx/templates/default/preferences.html+2−2
@@ -94,7 +94,7 @@
94
94
95 {% if not search_engine.private %}
95 {% if not search_engine.private %}
96 <tr>
96 <tr>
97− <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</td>
97+ <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</td>
98 <td>{{ _(categ) }}</td>
98 <td>{{ _(categ) }}</td>
99 <td class="engine_checkbox">
99 <td class="engine_checkbox">
100 <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in blocked_engines %} checked="checked"{% endif %} />
100 <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in blocked_engines %} checked="checked"{% endif %} />
@@ -113,7 +113,7 @@
113 </p>
113 </p>
114
114
115 <input type="submit" value="{{ _('save') }}" />
115 <input type="submit" value="{{ _('save') }}" />
116− <div class="right preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
116+ <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
117 </form>
117 </form>
118</div>
118</div>
119{% endblock %}
119{% endblock %}
searx/templates/default/results.html+2−2
@@ -72,7 +72,7 @@
72 <div id="pagination">
72 <div id="pagination">
73 {% if pageno > 1 %}
73 {% if pageno > 1 %}
74 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
74 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
75− <div class="left">
75+ <div class="{% if rtl %}right{% else %}left{% endif %}">
76 <input type="hidden" name="q" value="{{ q }}" />
76 <input type="hidden" name="q" value="{{ q }}" />
77 {% for category in selected_categories %}
77 {% for category in selected_categories %}
78 <input type="hidden" name="category_{{ category }}" value="1"/>
78 <input type="hidden" name="category_{{ category }}" value="1"/>
@@ -83,7 +83,7 @@
83 </form>
83 </form>
84 {% endif %}
84 {% endif %}
85 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
85 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
86− <div class="right">
86+ <div class="{% if rtl %}left{% else %}right{% endif %}">
87 {% for category in selected_categories %}
87 {% for category in selected_categories %}
88 <input type="hidden" name="category_{{ category }}" value="1"/>
88 <input type="hidden" name="category_{{ category }}" value="1"/>
89 {% endfor %}
89 {% endfor %}
searx/templates/oscar/base.html+1−1
@@ -1,5 +1,5 @@
1<!DOCTYPE html>
1<!DOCTYPE html>
2−<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
2+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}>
3<head>
3<head>
4 <meta charset="UTF-8" />
4 <meta charset="UTF-8" />
5 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
5 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
searx/templates/oscar/categories.html+21−1
@@ -1,6 +1,16 @@
1<!-- used if scripts are disabled -->
1<!-- used if scripts are disabled -->
2<noscript>
2<noscript>
3<div id="categories" class="btn-group btn-toggle">
3<div id="categories" class="btn-group btn-toggle">
4+{% if rtl %}
5+{% for category in categories | reverse %}
6+ <!--<div class="checkbox">-->
7+ <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
8+ <label class="btn btn-sm btn-primary active label_hide_if_not_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
9+ <label class="btn btn-sm btn-default label_hide_if_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
10+ <!--</div>-->
11+ {% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %}
12+{% endfor %}
13+{% else %}
4{% for category in categories %}
14{% for category in categories %}
5 <!--<div class="checkbox">-->
15 <!--<div class="checkbox">-->
6 <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
16 <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
@@ -9,14 +19,24 @@
9 <!--</div>-->
19 <!--</div>-->
10 {% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %}
20 {% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %}
11{% endfor %}
21{% endfor %}
22+{% endif %}
12</div>
23</div>
13</noscript>
24</noscript>
14
25
15<div id="categories" class="btn-group btn-toggle hide_if_nojs" data-toggle="buttons">
26<div id="categories" class="btn-group btn-toggle hide_if_nojs" data-toggle="buttons">
27+{% if rtl %}
28+{% for category in categories | reverse %}
29+ <label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
30+ <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }}
31+ </label>
32+{% endfor %}
33+{% else %}
16{% for category in categories %}
34{% for category in categories %}
17 <label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
35 <label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
18− <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }}</label>
36+ <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }}
37+ </label>
19{% endfor %}
38{% endfor %}
39+{% endif %}
20</div>
40</div>
21
41
22
42
searx/templates/oscar/macros.html+31
@@ -28,3 +28,34 @@
28 <span class="label label-default pull-right">{{ result.engine }}</span>
28 <span class="label label-default pull-right">{{ result.engine }}</span>
29 <p class="text-muted">{{ result.pretty_url }}</p>
29 <p class="text-muted">{{ result.pretty_url }}</p>
30{%- endmacro %}
30{%- endmacro %}
31+
32+<!-- Draw result footer -->
33+{% macro result_footer_rtl(result) -%}
34+ <div class="clearfix"></div>
35+ <span class="label label-default pull-left">{{ result.engine }}</span>
36+ <p class="text-muted">{{ result.pretty_url }}</p>
37+{%- endmacro %}
38+
39+{% macro preferences_item_header(info, label) -%}
40+ {% if not rtl %}
41+ <div class="row form-group">
42+ <label class="col-sm-3 col-md-2">{{ label }}</label>
43+ <div class="col-sm-4 col-md-4">
44+ {% else %}
45+ <div class="row form-group">
46+ <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
47+ <div class="col-sm-4 col-md-4">
48+ {% endif %}
49+{%- endmacro %}
50+
51+{% macro preferences_item_footer(info, label) -%}
52+ {% if not rtl %}
53+ </div>
54+ <span class="col-sm-5 col-md-6 help-block">{{ info }}</span>
55+ </div>
56+ {% else %}
57+ </div>
58+ <label class="col-sm-3 col-md-2">{{ label }}</label>
59+ </div>
60+ {% endif %}
61+{%- endmacro %}
searx/templates/oscar/navbar.html+19
@@ -1,6 +1,24 @@
1<!-- Static navbar -->
1<!-- Static navbar -->
2<div class="navbar navbar-default" role="navigation">
2<div class="navbar navbar-default" role="navigation">
3 <div class="container-fluid">
3 <div class="container-fluid">
4+ {% if rtl %}
5+ <div class="navbar-collapse collapse navbar-left">
6+ <ul class="nav navbar-nav navbar-left"> <!-- results.html -->
7+ <li{% if template_name == 'preferences.html' %} class="active"{% endif %}><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a></li>
8+ <li{% if template_name == 'about.html' %} class="active"{% endif %}><a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a></li>
9+ <li{% if template_name == 'index.html' %} class="active"{% endif %}><a href="{{ url_for('index') }}" class="hmarg">{{ _('home') }}</a></li>
10+ </ul>
11+ </div>
12+ <div class="navbar-header navbar-right">
13+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
14+ <span class="sr-only">{{ _('Toggle navigation') }}</span>
15+ <span class="icon-bar"></span>
16+ <span class="icon-bar"></span>
17+ <span class="icon-bar"></span>
18+ </button>
19+ <a class="navbar-brand" href="{{ url_for('index') }}">searx</a>
20+ </div>
21+ {% else %}
4 <div class="navbar-header">
22 <div class="navbar-header">
5 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
23 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
6 <span class="sr-only">{{ _('Toggle navigation') }}</span>
24 <span class="sr-only">{{ _('Toggle navigation') }}</span>
@@ -17,5 +35,6 @@
17 <li{% if template_name == 'preferences.html' %} class="active"{% endif %}><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a></li>
35 <li{% if template_name == 'preferences.html' %} class="active"{% endif %}><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a></li>
18 </ul>
36 </ul>
19 </div><!--/.nav-collapse -->
37 </div><!--/.nav-collapse -->
38+ {% endif %}
20 </div><!--/.container-fluid -->
39 </div><!--/.container-fluid -->
21</div>
40</div>
searx/templates/oscar/preferences.html+83−80
@@ -1,3 +1,4 @@
1+{% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl %}
1{% extends "oscar/base.html" %}
2{% extends "oscar/base.html" %}
2{% block title %}{{ _('preferences') }} - {% endblock %}
3{% block title %}{{ _('preferences') }} - {% endblock %}
3{% block site_alert_warning_nojs %}
4{% block site_alert_warning_nojs %}
@@ -12,7 +13,7 @@
12 <form method="post" action="{{ url_for('preferences') }}" id="search_form">
13 <form method="post" action="{{ url_for('preferences') }}" id="search_form">
13
14
14 <!-- Nav tabs -->
15 <!-- Nav tabs -->
15− <ul class="nav nav-tabs hide_if_nojs" role="tablist" style="margin-bottom:20px;">
16+ <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
16 <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
17 <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
17 <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
18 <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
18 </ul>
19 </ul>
@@ -26,96 +27,94 @@
26 <fieldset>
27 <fieldset>
27 <div class="container-fluid">
28 <div class="container-fluid">
28 <div class="row form-group">
29 <div class="row form-group">
29− <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
30+ {% if rtl %}
30 <div class="col-sm-11 col-md-10">
31 <div class="col-sm-11 col-md-10">
31 {% include 'oscar/categories.html' %}
32 {% include 'oscar/categories.html' %}
32 </div>
33 </div>
33− </div>
34− <div class="row form-group">
35− <label class="col-sm-3 col-md-2">{{ _('Search language') }}</label>
34+ <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
36− <div class="col-sm-4 col-md-4">
35+ {% else %}
37− <select class="form-control" name='language'>
38− <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
39− {% for lang_id,lang_name,country_name in language_codes %}
40− <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option>
41− {% endfor %}
42− </select>
43− </div>
44− <span class="col-sm-5 col-md-6 help-block">{{ _('What language do you prefer for search?') }}</span>
45− </div>
46− <div class="row form-group">
47− <label class="col-sm-3 col-md-2">{{ _('Interface language') }}</label>
36+ <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
48− <div class="col-sm-4 col-md-4">
37+ <div class="col-sm-11 col-md-10">
49− <select class="form-control" name='locale'>
38+ {% include 'oscar/categories.html' %}
50− {% for locale_id,locale_name in locales.items() %}
51− <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
52− {% endfor %}
53− </select>
54 </div>
39 </div>
55− <span class="col-sm-5 col-md-6 help-block">{{ _('Change the language of the layout') }}</span>
40+ {% endif %}
56 </div>
41 </div>
57− <div class="row form-group">
42+ {% set language_label = _('Search language') %}
58− <label class="col-sm-3 col-md-2">{{ _('Autocomplete') }}</label>
43+ {% set language_info = _('What language do you prefer for search?') %}
59− <div class="col-sm-4 col-md-4">
44+ {{ preferences_item_header(language_info, language_label) }}
45+ <select class="form-control" name='language'>
46+ <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
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>
49+ {% endfor %}
50+ </select>
51+ {{ preferences_item_footer(language_info, language_label) }}
60
52
53+ {% set locale_label = _('Interface language') %}
54+ {% set locale_info = _('Change the language of the layout') %}
55+ {{ preferences_item_header(locale_info, locale_label) }}
61− <select class="form-control" name="autocomplete">
56+ <select class="form-control" name='locale'>
62− <option value=""> - </option>
57+ {% for locale_id,locale_name in locales.items() %}
63− {% for backend in autocomplete_backends %}
64− <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
58+ <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
65− {% endfor %}
59+ {% endfor %}
66− </select>
60+ </select>
67− </div>
61+ {{ preferences_item_footer(locale_info, locale_label) }}
62+
63+ {% set autocomplete_label = _('Autocomplete') %}
68− <span class="col-sm-5 col-md-6 help-block">{{ _('Find stuff as you type') }}</span>
64+ {% set autocomplete_info = _('Find stuff as you type') %}
69− </div>
65+ {{ preferences_item_header(autocomplete_info, autocomplete_label) }}
70− <div class="row form-group">
66+ <select class="form-control" name="autocomplete">
71− <label class="col-sm-3 col-md-2">{{ _('Image proxy') }}</label>
67+ <option value=""> - </option>
72− <div class="col-sm-4 col-md-4">
68+ {% for backend in autocomplete_backends %}
69+ <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
70+ {% endfor %}
71+ </select>
72+ {{ preferences_item_footer(autocomplete_info, autocomplete_label) }}
73+
74+ {% set image_proxy_label = _('Image proxy') %}
75+ {% set image_proxy_info = _('Proxying image results through searx') %}
76+ {{ preferences_item_header(image_proxy_info, image_proxy_label) }}
73− <select class="form-control" name='image_proxy'>
77+ <select class="form-control" name='image_proxy'>
74− <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
78+ <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
75− <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
79+ <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
76− </select>
80+ </select>
77− </div>
81+ {{ preferences_item_footer(image_proxy_info, image_proxy_label) }}
78− <span class="col-sm-5 col-md-6 help-block">{{ _('Proxying image results through searx') }}</span>
82+
79− </div>
83+ {% set method_label = _('Method') %}
80− <div class="row form-group">
81− <label class="col-sm-3 col-md-2">{{ _('Method') }}</label>
82− <div class="col-sm-4 col-md-4">
83− <select class="form-control" name='method'>
84− <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
85− <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
86− </select>
87− </div>
88− <span class="col-sm-5 col-md-6 help-block">{{ _('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>') }}</span>
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>') %}
89− </div>
85+ {{ preferences_item_header(method_info, method_label) }}
90− <div class="row form-group">
86+ <select class="form-control" name='method'>
91− <label class="col-sm-3 col-md-2">{{ _('SafeSearch') }}</label>
87+ <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
92− <div class="col-sm-4 col-md-4">
88+ <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
89+ </select>
90+ {{ preferences_item_footer(method_info, method_label) }}
91+
92+ {% set safesearch_label = _('SafeSearch') %}
93+ {% set safesearch_info = _('Filter content') %}
94+ {{ preferences_item_header(safesearch_info, safesearch_label) }}
93− <select class="form-control" name='safesearch'>
95+ <select class="form-control" name='safesearch'>
94− <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
96+ <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
95− <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
97+ <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
96− <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
98+ <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
97− </select>
99+ </select>
98− </div>
100+ {{ preferences_item_footer(safesearch_info, safesearch_label) }}
99− <span class="col-sm-5 col-md-6 help-block">{{ _('Filter explicite content') }}</span>
101+
100− </div>
102+ {% set theme_label = _('Themes') %}
101− <div class="row form-group">
103+ {% set theme_info = _('Change searx layout') %}
102− <label class="col-sm-3 col-md-2">{{ _('Themes') }}</label>
104+ {{ preferences_item_header(theme_info, theme_label) }}
103− <div class="col-sm-4 col-md-4">
104− <select class="form-control" name="theme">
105+ <select class="form-control" name="theme">
105− {% for name in themes %}
106+ {% for name in themes %}
106− <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
107+ <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
107− {% endfor %}
108+ {% endfor %}
108− </select>
109+ </select>
109− </div>
110+ {{ preferences_item_footer(theme_info, theme_label) }}
110− <span class="col-sm-5 col-md-6 help-block">{{ _('Change searx layout') }}</span>
111− </div>
112 </div>
111 </div>
113 </fieldset>
112 </fieldset>
114 </div>
113 </div>
115 <div class="tab-pane active_if_nojs" id="tab_engine">
114 <div class="tab-pane active_if_nojs" id="tab_engine">
116
115
117 <!-- Nav tabs -->
116 <!-- Nav tabs -->
118− <ul class="nav nav-tabs hide_if_nojs" role="tablist" style="margin-bottom:20px;">
117+ <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
119 {% for (categ,search_engines) in categs %}
118 {% for (categ,search_engines) in categs %}
120 <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
119 <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
121 {% endfor %}
120 {% endfor %}
@@ -136,7 +135,9 @@
136 {% for search_engine in search_engines %}
135 {% for search_engine in search_engines %}
137 {% if not search_engine.private %}
136 {% if not search_engine.private %}
138 <div class="row">
137 <div class="row">
138+ {% if not rtl %}
139 <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</div>
139 <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</div>
140+ {% endif %}
140 <div class="col-xs-6 col-sm-4 col-md-4">
141 <div class="col-xs-6 col-sm-4 col-md-4">
141 <div class="checkbox">
142 <div class="checkbox">
142 <input class="hidden" type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in blocked_engines %} checked="checked"{% endif %} />
143 <input class="hidden" type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in blocked_engines %} checked="checked"{% endif %} />
@@ -144,6 +145,9 @@
144 <label class="btn btn-danger label_hide_if_not_checked" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label>
145 <label class="btn btn-danger label_hide_if_not_checked" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label>
145 </div>
146 </div>
146 </div>
147 </div>
148+ {% if rtl %}
149+ <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</div>
150+ {% endif %}
147 </div>
151 </div>
148 {% endif %}
152 {% endif %}
149 {% endfor %}
153 {% endfor %}
@@ -154,7 +158,6 @@
154 </div>
158 </div>
155 </div>
159 </div>
156 </div>
160 </div>
157−
158 <p class="text-muted" style="margin:20px 0;">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
161 <p class="text-muted" style="margin:20px 0;">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
159 <br />
162 <br />
160 {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
163 {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
searx/templates/oscar/result_templates/code.html+5−1
@@ -1,4 +1,4 @@
1−{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}
1+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
2
2
3{{ result_header(result, favicons) }}
3{{ result_header(result, favicons) }}
4{{ result_sub_header(result) }}
4{{ result_sub_header(result) }}
@@ -9,4 +9,8 @@
9
9
10{{ result.codelines|code_highlighter(result.code_language)|safe }}
10{{ result.codelines|code_highlighter(result.code_language)|safe }}
11
11
12+{% if rtl %}
13+{{ result_footer_rtl(result) }}
14+{% else %}
12{{ result_footer(result) }}
15{{ result_footer(result) }}
16+{% endif %}
searx/templates/oscar/result_templates/default.html+5−1
@@ -1,4 +1,4 @@
1−{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}
1+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
2
2
3{{ result_header(result, favicons) }}
3{{ result_header(result, favicons) }}
4{{ result_sub_header(result) }}
4{{ result_sub_header(result) }}
@@ -15,4 +15,8 @@
15
15
16{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
16{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
17
17
18+{% if rtl %}
19+{{ result_footer_rtl(result) }}
20+{% else %}
18{{ result_footer(result) }}
21{{ result_footer(result) }}
22+{% endif %}
searx/templates/oscar/result_templates/map.html+5−1
@@ -1,4 +1,4 @@
1−{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}
1+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
2
2
3{{ result_header(result, favicons) }}
3{{ result_header(result, favicons) }}
4{{ result_sub_header(result) }}
4{{ result_sub_header(result) }}
@@ -65,4 +65,8 @@
65 </div>
65 </div>
66{% endif %}
66{% endif %}
67
67
68+{% if rtl %}
69+{{ result_footer_rtl(result) }}
70+{% else %}
68{{ result_footer(result) }}
71{{ result_footer(result) }}
72+{% endif %}
searx/templates/oscar/result_templates/torrent.html+5−1
@@ -1,4 +1,4 @@
1−{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %}
1+{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, result_footer_rtl, icon %}
2
2
3{{ result_header(result, favicons) }}
3{{ result_header(result, favicons) }}
4{{ result_sub_header(result) }}
4{{ result_sub_header(result) }}
@@ -18,4 +18,8 @@
18
18
19</p>
19</p>
20
20
21+{% if rtl %}
22+{{ result_footer_rtl(result) }}
23+{% else %}
21{{ result_footer(result) }}
24{{ result_footer(result) }}
25+{% endif %}
searx/templates/oscar/result_templates/videos.html+4
@@ -20,4 +20,8 @@
20 </div>
20 </div>
21</div>
21</div>
22
22
23+{% if rtl %}
24+{{ result_footer_rtl(result) }}
25+{% else %}
23{{ result_footer(result) }}
26{{ result_footer(result) }}
27+{% endif %}
searx/templates/oscar/results.html+22
@@ -33,6 +33,27 @@
33 <div class="clearfix"></div>
33 <div class="clearfix"></div>
34
34
35 {% if paging %}
35 {% if paging %}
36+ {% if rtl %}
37+ <div id="pagination">
38+ <div class="pull-left">
39+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
40+ <input type="hidden" name="q" value="{{ q }}" />
41+ {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
42+ <input type="hidden" name="q" value="{{ q }}" />
43+ <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
44+ <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
45+ </form>
46+ </div>
47+ <div class="pull-right">
48+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
49+ {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
50+ <input type="hidden" name="pageno" value="{{ pageno-1 }}" />
51+ <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
52+ </form>
53+ </div>
54+ </div><!-- /#pagination -->
55+ <div class="clearfix"></div>
56+ {% else %}
36 <div id="pagination">
57 <div id="pagination">
37 <div class="pull-left">
58 <div class="pull-left">
38 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
59 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
@@ -53,6 +74,7 @@
53 </div><!-- /#pagination -->
74 </div><!-- /#pagination -->
54 <div class="clearfix"></div>
75 <div class="clearfix"></div>
55 {% endif %}
76 {% endif %}
77+ {% endif %}
56 </div><!-- /#main_results -->
78 </div><!-- /#main_results -->
57
79
58 <div class="col-sm-4" id="sidebar_results">
80 <div class="col-sm-4" id="sidebar_results">
searx/templates/oscar/search_full.html+4
@@ -1,7 +1,11 @@
1{% from 'oscar/macros.html' import icon %}
1{% from 'oscar/macros.html' import icon %}
2
2
3<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
3<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
4+ {% if rtl %}
5+ <div class="input-group">
6+ {% else %}
4 <div class="input-group col-md-8 col-md-offset-2">
7 <div class="input-group col-md-8 col-md-offset-2">
8+ {% endif %}
5 <input type="search" name="q" class="form-control input-lg autofocus" id="q" placeholder="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}">
9 <input type="search" name="q" class="form-control input-lg autofocus" id="q" placeholder="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}">
6 <span class="input-group-btn">
10 <span class="input-group-btn">
7 <button type="submit" class="btn btn-default input-lg"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
11 <button type="submit" class="btn btn-default input-lg"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
searx/webapp.py+10−3
@@ -20,7 +20,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
20if __name__ == '__main__':
20if __name__ == '__main__':
21 from sys import path
21 from sys import path
22 from os.path import realpath, dirname
22 from os.path import realpath, dirname
23− path.append(realpath(dirname(realpath(__file__))+'/../'))
23+ path.append(realpath(dirname(realpath(__file__)) + '/../'))
24
24
25import json
25import json
26import cStringIO
26import cStringIO
@@ -85,10 +85,13 @@ app.secret_key = settings['server']['secret_key']
85
85
86babel = Babel(app)
86babel = Babel(app)
87
87
88+rtl_locales = ['ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he',
89+ 'ku', 'mzn', 'pnb'', ''ps', 'sd', 'ug', 'ur', 'yi']
90+
88global_favicons = []
91global_favicons = []
89for indice, theme in enumerate(themes):
92for indice, theme in enumerate(themes):
90 global_favicons.append([])
93 global_favicons.append([])
91− theme_img_path = searx_dir+"/static/themes/"+theme+"/img/icons/"
94+ theme_img_path = searx_dir + "/static/themes/" + theme + "/img/icons/"
92 for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
95 for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
93 global_favicons[indice].extend(filenames)
96 global_favicons[indice].extend(filenames)
94
97
@@ -262,6 +265,9 @@ def render(template_name, override_theme=None, **kwargs):
262 if 'autocomplete' not in kwargs:
265 if 'autocomplete' not in kwargs:
263 kwargs['autocomplete'] = autocomplete
266 kwargs['autocomplete'] = autocomplete
264
267
268+ if get_locale() in rtl_locales and 'rtl' not in kwargs:
269+ kwargs['rtl'] = True
270+
265 kwargs['searx_version'] = VERSION_STRING
271 kwargs['searx_version'] = VERSION_STRING
266
272
267 kwargs['method'] = request.cookies.get('method', 'POST')
273 kwargs['method'] = request.cookies.get('method', 'POST')
@@ -396,6 +402,7 @@ def about():
396 """Render about page"""
402 """Render about page"""
397 return render(
403 return render(
398 'about.html',
404 'about.html',
405+ rtl=False,
399 )
406 )
400
407
401
408
@@ -592,7 +599,7 @@ def image_proxy():
592 img = ''
599 img = ''
593 chunk_counter = 0
600 chunk_counter = 0
594
601
595− for chunk in resp.iter_content(1024*1024):
602+ for chunk in resp.iter_content(1024 * 1024):
596 chunk_counter += 1
603 chunk_counter += 1
597 if chunk_counter > 5:
604 if chunk_counter > 5:
598 return '', 502 # Bad gateway - file is too big (>5M)
605 return '', 502 # Bad gateway - file is too big (>5M)