on master help sign in
Merge branch 'Cqoicebordel-rtl'
commitf8a5f7d6751ad72c877d6008f1a7d9792ba911f6 authorAdam Tauber <asciimoo@gmail.com> dateTue 10 Feb 2015, 15:28 (12 years ago) parentc711212df9cf9d
28 files changed+293−99
Makefile+2 searx/static/themes/courgette/css/style-rtl.css+1 searx/static/themes/courgette/css/style.css+1−1 searx/static/themes/courgette/less/style-rtl.less+38 searx/static/themes/courgette/less/style.less+1−1 searx/static/themes/default/css/style-rtl.css+1 searx/static/themes/default/less/style-rtl.less+11 searx/templates/courgette/base.html+4−1 searx/templates/courgette/index.html+5 searx/templates/courgette/preferences.html+1−1 searx/templates/courgette/results.html−1 searx/templates/default/base.html+4−1 searx/templates/default/index.html+5 searx/templates/default/preferences.html+2−2 searx/templates/default/results.html+2−2 searx/templates/oscar/base.html+1−1 searx/templates/oscar/categories.html+21−1 searx/templates/oscar/macros.html+31 searx/templates/oscar/navbar.html+19 searx/templates/oscar/preferences.html+83−80 searx/templates/oscar/result_templates/code.html+5−1 searx/templates/oscar/result_templates/default.html+5−1 searx/templates/oscar/result_templates/map.html+5−1 searx/templates/oscar/result_templates/torrent.html+5−1 searx/templates/oscar/result_templates/videos.html+4 searx/templates/oscar/results.html+22 searx/templates/oscar/search_full.html+4 searx/webapp.py+10−3
Makefile+2
@@ -46,7 +46,9 @@ minimal: bin/buildout minimal.cfg setup.py
4646
4747styles:
4848 @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
4950 @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
5052 @lessc -x searx/static/less/bootstrap/bootstrap.less > searx/static/css/bootstrap.min.css
5153 @lessc -x searx/static/themes/oscar/less/oscar/oscar.less > searx/static/themes/oscar/css/oscar.min.css
5254
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 {
278278}
279279
280280#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;
282282 padding-right: 1.8em;
283283}
284284
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 @@
11<!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 %}>
33 <head>
44 <meta charset="UTF-8" />
55 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
@@ -8,6 +8,9 @@
88 <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
99 <title>{% block title %}{% endblock %}searx</title>
1010 <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 %}
1114 {% if cookies['courgette-color'] %}
1215 <style type="text/css">
1316 {% include 'courgette/color.css' %}
searx/templates/courgette/index.html+5
@@ -5,8 +5,13 @@
55 <div class="title"><h1>searx</h1></div>
66 {% include 'courgette/search.html' %}
77 <p class="top_margin">
8+ {% if rtl %}
9+ <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
10+ {% endif %}
811 <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
12+ {% if not rtl %}
913 <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
14+ {% endif %}
1015 </p>
1116</div>
1217{% endblock %}
searx/templates/courgette/preferences.html+1−1
@@ -106,7 +106,7 @@
106106
107107 {% if not search_engine.private %}
108108 <tr>
109− <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</td>
109+ <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</td>
110110 <td>{{ _(categ) }}</td>
111111 <td class="engine_checkbox">
112112 <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 @@
88</div>
99<div id="results">
1010 <div id="sidebar">
11−
1211 <div id="search_url">
1312 {{ _('Search URL') }}:
1413 <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 @@
11<!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 %}>
33 <head>
44 <meta charset="UTF-8" />
55 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
@@ -8,6 +8,9 @@
88 <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
99 <title>{% block title %}{% endblock %}searx</title>
1010 <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 %}
1114 <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" />
1215 {% block styles %}
1316 {% endblock %}
searx/templates/default/index.html+5
@@ -4,8 +4,13 @@
44 <div class="title"><h1>searx</h1></div>
55 {% include 'default/search.html' %}
66 <p class="top_margin">
7+ {% if rtl %}
8+ <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
9+ {% endif %}
710 <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
11+ {% if not rtl %}
812 <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
13+ {% endif %}
914 </p>
1015</div>
1116{% include 'default/github_ribbon.html' %}
searx/templates/default/preferences.html+2−2
@@ -94,7 +94,7 @@
9494
9595 {% if not search_engine.private %}
9696 <tr>
97− <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</td>
97+ <td>{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</td>
9898 <td>{{ _(categ) }}</td>
9999 <td class="engine_checkbox">
100100 <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 @@
113113 </p>
114114
115115 <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>
117117 </form>
118118</div>
119119{% endblock %}
searx/templates/default/results.html+2−2
@@ -72,7 +72,7 @@
7272 <div id="pagination">
7373 {% if pageno > 1 %}
7474 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
75− <div class="left">
75+ <div class="{% if rtl %}right{% else %}left{% endif %}">
7676 <input type="hidden" name="q" value="{{ q }}" />
7777 {% for category in selected_categories %}
7878 <input type="hidden" name="category_{{ category }}" value="1"/>
@@ -83,7 +83,7 @@
8383 </form>
8484 {% endif %}
8585 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
86− <div class="right">
86+ <div class="{% if rtl %}left{% else %}right{% endif %}">
8787 {% for category in selected_categories %}
8888 <input type="hidden" name="category_{{ category }}" value="1"/>
8989 {% endfor %}
searx/templates/oscar/base.html+1−1
@@ -1,5 +1,5 @@
11<!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 %}>
33<head>
44 <meta charset="UTF-8" />
55 <meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
searx/templates/oscar/categories.html+21−1
@@ -1,6 +1,16 @@
11<!-- used if scripts are disabled -->
22<noscript>
33<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 %}
414{% for category in categories %}
515 <!--<div class="checkbox">-->
616 <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 @@
919 <!--</div>-->
1020 {% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %}
1121{% endfor %}
22+{% endif %}
1223</div>
1324</noscript>
1425
1526<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 %}
1634{% for category in categories %}
1735 <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>
1938{% endfor %}
39+{% endif %}
2040</div>
2141
2242
searx/templates/oscar/macros.html+31
@@ -28,3 +28,34 @@
2828 <span class="label label-default pull-right">{{ result.engine }}</span>
2929 <p class="text-muted">{{ result.pretty_url }}</p>
3030{%- 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 @@
11<!-- Static navbar -->
22<div class="navbar navbar-default" role="navigation">
33 <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 %}
422 <div class="navbar-header">
523 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
624 <span class="sr-only">{{ _('Toggle navigation') }}</span>
@@ -17,5 +35,6 @@
1735 <li{% if template_name == 'preferences.html' %} class="active"{% endif %}><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a></li>
1836 </ul>
1937 </div><!--/.nav-collapse -->
38+ {% endif %}
2039 </div><!--/.container-fluid -->
2140</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 %}
12{% extends "oscar/base.html" %}
23{% block title %}{{ _('preferences') }} - {% endblock %}
34{% block site_alert_warning_nojs %}
@@ -12,7 +13,7 @@
1213 <form method="post" action="{{ url_for('preferences') }}" id="search_form">
1314
1415 <!-- 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;">
1617 <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
1718 <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
1819 </ul>
@@ -26,96 +27,94 @@
2627 <fieldset>
2728 <div class="container-fluid">
2829 <div class="row form-group">
29− <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
30+ {% if rtl %}
3031 <div class="col-sm-11 col-md-10">
3132 {% include 'oscar/categories.html' %}
3233 </div>
33− </div>
34− <div class="row form-group">
35− <label class="col-sm-3 col-md-2">{{ _('Search language') }}</label>
36− <div class="col-sm-4 col-md-4">
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>
48− <div class="col-sm-4 col-md-4">
49− <select class="form-control" name='locale'>
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>
34+ <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
35+ {% else %}
36+ <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
37+ <div class="col-sm-11 col-md-10">
38+ {% include 'oscar/categories.html' %}
5439 </div>
55− <span class="col-sm-5 col-md-6 help-block">{{ _('Change the language of the layout') }}</span>
40+ {% endif %}
5641 </div>
57− <div class="row form-group">
58− <label class="col-sm-3 col-md-2">{{ _('Autocomplete') }}</label>
59− <div class="col-sm-4 col-md-4">
42+ {% set language_label = _('Search language') %}
43+ {% set language_info = _('What language do you prefer for search?') %}
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) }}
6052
61− <select class="form-control" name="autocomplete">
62− <option value=""> - </option>
63− {% for backend in autocomplete_backends %}
64− <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
65− {% endfor %}
66− </select>
67− </div>
68− <span class="col-sm-5 col-md-6 help-block">{{ _('Find stuff as you type') }}</span>
69− </div>
70− <div class="row form-group">
71− <label class="col-sm-3 col-md-2">{{ _('Image proxy') }}</label>
72− <div class="col-sm-4 col-md-4">
73− <select class="form-control" name='image_proxy'>
74− <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
75− <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
76− </select>
77− </div>
78− <span class="col-sm-5 col-md-6 help-block">{{ _('Proxying image results through searx') }}</span>
79− </div>
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>
89− </div>
90− <div class="row form-group">
91− <label class="col-sm-3 col-md-2">{{ _('SafeSearch') }}</label>
92− <div class="col-sm-4 col-md-4">
93− <select class="form-control" name='safesearch'>
94− <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
95− <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
96− <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
97− </select>
98− </div>
99− <span class="col-sm-5 col-md-6 help-block">{{ _('Filter explicite content') }}</span>
100− </div>
101− <div class="row form-group">
102− <label class="col-sm-3 col-md-2">{{ _('Themes') }}</label>
103− <div class="col-sm-4 col-md-4">
104− <select class="form-control" name="theme">
105− {% for name in themes %}
106− <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
107− {% endfor %}
108− </select>
109− </div>
110− <span class="col-sm-5 col-md-6 help-block">{{ _('Change searx layout') }}</span>
111− </div>
53+ {% set locale_label = _('Interface language') %}
54+ {% set locale_info = _('Change the language of the layout') %}
55+ {{ preferences_item_header(locale_info, locale_label) }}
56+ <select class="form-control" name='locale'>
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>
59+ {% endfor %}
60+ </select>
61+ {{ preferences_item_footer(locale_info, locale_label) }}
62+
63+ {% set autocomplete_label = _('Autocomplete') %}
64+ {% set autocomplete_info = _('Find stuff as you type') %}
65+ {{ preferences_item_header(autocomplete_info, autocomplete_label) }}
66+ <select class="form-control" name="autocomplete">
67+ <option value=""> - </option>
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) }}
77+ <select class="form-control" name='image_proxy'>
78+ <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
79+ <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
80+ </select>
81+ {{ preferences_item_footer(image_proxy_info, image_proxy_label) }}
82+
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>') %}
85+ {{ preferences_item_header(method_info, method_label) }}
86+ <select class="form-control" name='method'>
87+ <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
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) }}
95+ <select class="form-control" name='safesearch'>
96+ <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</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>
99+ </select>
100+ {{ preferences_item_footer(safesearch_info, safesearch_label) }}
101+
102+ {% set theme_label = _('Themes') %}
103+ {% set theme_info = _('Change searx layout') %}
104+ {{ preferences_item_header(theme_info, theme_label) }}
105+ <select class="form-control" name="theme">
106+ {% for name in themes %}
107+ <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
108+ {% endfor %}
109+ </select>
110+ {{ preferences_item_footer(theme_info, theme_label) }}
112111 </div>
113112 </fieldset>
114113 </div>
115114 <div class="tab-pane active_if_nojs" id="tab_engine">
116115
117116 <!-- 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;">
119118 {% for (categ,search_engines) in categs %}
120119 <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
121120 {% endfor %}
@@ -136,7 +135,9 @@
136135 {% for search_engine in search_engines %}
137136 {% if not search_engine.private %}
138137 <div class="row">
138+ {% if not rtl %}
139139 <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</div>
140+ {% endif %}
140141 <div class="col-xs-6 col-sm-4 col-md-4">
141142 <div class="checkbox">
142143 <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 @@
144145 <label class="btn btn-danger label_hide_if_not_checked" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label>
145146 </div>
146147 </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 %}
147151 </div>
148152 {% endif %}
149153 {% endfor %}
@@ -154,7 +158,6 @@
154158 </div>
155159 </div>
156160 </div>
157−
158161 <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.') }}
159162 <br />
160163 {{ _("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 %}
22
33{{ result_header(result, favicons) }}
44{{ result_sub_header(result) }}
@@ -9,4 +9,8 @@
99
1010{{ result.codelines|code_highlighter(result.code_language)|safe }}
1111
12+{% if rtl %}
13+{{ result_footer_rtl(result) }}
14+{% else %}
1215{{ 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 %}
22
33{{ result_header(result, favicons) }}
44{{ result_sub_header(result) }}
@@ -15,4 +15,8 @@
1515
1616{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
1717
18+{% if rtl %}
19+{{ result_footer_rtl(result) }}
20+{% else %}
1821{{ 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 %}
22
33{{ result_header(result, favicons) }}
44{{ result_sub_header(result) }}
@@ -65,4 +65,8 @@
6565 </div>
6666{% endif %}
6767
68+{% if rtl %}
69+{{ result_footer_rtl(result) }}
70+{% else %}
6871{{ 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 %}
22
33{{ result_header(result, favicons) }}
44{{ result_sub_header(result) }}
@@ -18,4 +18,8 @@
1818
1919</p>
2020
21+{% if rtl %}
22+{{ result_footer_rtl(result) }}
23+{% else %}
2124{{ result_footer(result) }}
25+{% endif %}
searx/templates/oscar/result_templates/videos.html+4
@@ -20,4 +20,8 @@
2020 </div>
2121</div>
2222
23+{% if rtl %}
24+{{ result_footer_rtl(result) }}
25+{% else %}
2326{{ result_footer(result) }}
27+{% endif %}
searx/templates/oscar/results.html+22
@@ -33,6 +33,27 @@
3333 <div class="clearfix"></div>
3434
3535 {% 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 %}
3657 <div id="pagination">
3758 <div class="pull-left">
3859 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
@@ -53,6 +74,7 @@
5374 </div><!-- /#pagination -->
5475 <div class="clearfix"></div>
5576 {% endif %}
77+ {% endif %}
5678 </div><!-- /#main_results -->
5779
5880 <div class="col-sm-4" id="sidebar_results">
searx/templates/oscar/search_full.html+4
@@ -1,7 +1,11 @@
11{% from 'oscar/macros.html' import icon %}
22
33<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form" role="search">
4+ {% if rtl %}
5+ <div class="input-group">
6+ {% else %}
47 <div class="input-group col-md-8 col-md-offset-2">
8+ {% endif %}
59 <input type="search" name="q" class="form-control input-lg autofocus" id="q" placeholder="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}">
610 <span class="input-group-btn">
711 <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/ >.
2020if __name__ == '__main__':
2121 from sys import path
2222 from os.path import realpath, dirname
23− path.append(realpath(dirname(realpath(__file__))+'/../'))
23+ path.append(realpath(dirname(realpath(__file__)) + '/../'))
2424
2525import json
2626import cStringIO
@@ -85,10 +85,13 @@ app.secret_key = settings['server']['secret_key']
8585
8686babel = Babel(app)
8787
88+rtl_locales = ['ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he',
89+ 'ku', 'mzn', 'pnb'', ''ps', 'sd', 'ug', 'ur', 'yi']
90+
8891global_favicons = []
8992for indice, theme in enumerate(themes):
9093 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/"
9295 for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
9396 global_favicons[indice].extend(filenames)
9497
@@ -262,6 +265,9 @@ def render(template_name, override_theme=None, **kwargs):
262265 if 'autocomplete' not in kwargs:
263266 kwargs['autocomplete'] = autocomplete
264267
268+ if get_locale() in rtl_locales and 'rtl' not in kwargs:
269+ kwargs['rtl'] = True
270+
265271 kwargs['searx_version'] = VERSION_STRING
266272
267273 kwargs['method'] = request.cookies.get('method', 'POST')
@@ -396,6 +402,7 @@ def about():
396402 """Render about page"""
397403 return render(
398404 'about.html',
405+ rtl=False,
399406 )
400407
401408
@@ -592,7 +599,7 @@ def image_proxy():
592599 img = ''
593600 chunk_counter = 0
594601
595− for chunk in resp.iter_content(1024*1024):
602+ for chunk in resp.iter_content(1024 * 1024):
596603 chunk_counter += 1
597604 if chunk_counter > 5:
598605 return '', 502 # Bad gateway - file is too big (>5M)