on master help sign in
Merge pull request #634 from kvch/advanced-search

support time range search

commit7d9c898170df497036b8a7a70a1a5c86c3859670 authorAdam Tauber <asciimoo@gmail.com> dateTue 26 Jul 2016, 00:06 (10 years ago) parent54d987690e74fb
25 files changed+291−95
searx/engines/__init__.py+2−1 searx/engines/deviantart.py+8 searx/engines/duckduckgo.py+9 searx/engines/google.py+8 searx/engines/google_images.py+7 searx/engines/yahoo.py+26−8 searx/search.py+10−2 searx/static/plugins/js/search_on_category_select.js+6−3 searx/static/themes/oscar/css/logicodev.min.css+1−1 searx/static/themes/oscar/css/pointhi.min.css+1−1 searx/static/themes/oscar/less/logicodev/advanced.less+68 searx/static/themes/oscar/less/logicodev/oscar.less+2 searx/static/themes/oscar/less/logicodev/search.less+18−26 searx/static/themes/oscar/less/logicodev/variables.less+2 searx/static/themes/oscar/less/pointhi/advanced.less+45 searx/static/themes/oscar/less/pointhi/oscar.less+2 searx/static/themes/oscar/less/pointhi/search.less+27−3 searx/templates/oscar/advanced.html+11 searx/templates/oscar/categories.html+10−38 searx/templates/oscar/preferences.html+1−1 searx/templates/oscar/results.html+7−2 searx/templates/oscar/search.html+1−3 searx/templates/oscar/search_full.html+3−6 searx/templates/oscar/time-range.html+14 searx/webapp.py+2
searx/engines/__init__.py+2−1
@@ -42,7 +42,8 @@ engine_default_args = {'paging': False,
4242 'shortcut': '-',
4343 'disabled': False,
4444 'suspend_end_time': 0,
45− 'continuous_errors': 0}
45+ 'continuous_errors': 0,
46+ 'time_range_support': False}
4647
4748
4849def load_module(filename):
searx/engines/deviantart.py+8
@@ -21,10 +21,16 @@ from searx.engines.xpath import extract_text
2121# engine dependent config
2222categories = ['images']
2323paging = True
24+time_range_support = True
2425
2526# search-url
2627base_url = 'https://www.deviantart.com/'
2728search_url = base_url + 'browse/all/?offset={offset}&{query}'
29+time_range_url = '&order={range}'
30+
31+time_range_dict = {'day': 11,
32+ 'week': 14,
33+ 'month': 15}
2834
2935
3036# do search-request
@@ -33,6 +39,8 @@ def request(query, params):
3339
3440 params['url'] = search_url.format(offset=offset,
3541 query=urlencode({'q': query}))
42+ if params['time_range']:
43+ params['url'] += time_range_url.format(range=time_range_dict[params['time_range']])
3644
3745 return params
3846
searx/engines/duckduckgo.py+9
@@ -22,9 +22,15 @@ from searx.languages import language_codes
2222categories = ['general']
2323paging = True
2424language_support = True
25+time_range_support = True
2526
2627# search-url
2728url = 'https://duckduckgo.com/html?{query}&s={offset}'
29+time_range_url = '&df={range}'
30+
31+time_range_dict = {'day': 'd',
32+ 'week': 'w',
33+ 'month': 'm'}
2834
2935# specific xpath variables
3036result_xpath = '//div[@class="result results_links results_links_deep web-result "]' # noqa
@@ -61,6 +67,9 @@ def request(query, params):
6167 params['url'] = url.format(
6268 query=urlencode({'q': query}), offset=offset)
6369
70+ if params['time_range']:
71+ params['url'] += time_range_url.format(range=time_range_dict[params['time_range']])
72+
6473 return params
6574
6675
searx/engines/google.py+8
@@ -24,6 +24,7 @@ categories = ['general']
2424paging = True
2525language_support = True
2626use_locale_domain = True
27+time_range_support = True
2728
2829# based on https://en.wikipedia.org/wiki/List_of_Google_domains and tests
2930default_hostname = 'www.google.com'
@@ -92,6 +93,11 @@ search_url = ('https://{hostname}' +
9293 search_path +
9394 '?{query}&start={offset}&gws_rd=cr&gbv=1&lr={lang}&ei=x')
9495
96+time_range_search = "&tbs=qdr:{range}"
97+time_range_dict = {'day': 'd',
98+ 'week': 'w',
99+ 'month': 'm'}
100+
95101# other URLs
96102map_hostname_start = 'maps.google.'
97103maps_path = '/maps'
@@ -179,6 +185,8 @@ def request(query, params):
179185 query=urlencode({'q': query}),
180186 hostname=google_hostname,
181187 lang=url_lang)
188+ if params['time_range']:
189+ params['url'] += time_range_search.format(range=time_range_dict[params['time_range']])
182190
183191 params['headers']['Accept-Language'] = language
184192 params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
searx/engines/google_images.py+7
@@ -19,12 +19,17 @@ from lxml import html
1919categories = ['images']
2020paging = True
2121safesearch = True
22+time_range_support = True
2223
2324search_url = 'https://www.google.com/search'\
2425 '?{query}'\
2526 '&tbm=isch'\
2627 '&ijn=1'\
2728 '&start={offset}'
29+time_range_search = "&tbs=qdr:{range}"
30+time_range_dict = {'day': 'd',
31+ 'week': 'w',
32+ 'month': 'm'}
2833
2934
3035# do search-request
@@ -34,6 +39,8 @@ def request(query, params):
3439 params['url'] = search_url.format(query=urlencode({'q': query}),
3540 offset=offset,
3641 safesearch=safesearch)
42+ if params['time_range']:
43+ params['url'] += time_range_search.format(range=time_range_dict[params['time_range']])
3744
3845 if safesearch and params['safesearch']:
3946 params['url'] += '&' + urlencode({'safe': 'active'})
searx/engines/yahoo.py+26−8
@@ -20,10 +20,12 @@ from searx.engines.xpath import extract_text, extract_url
2020categories = ['general']
2121paging = True
2222language_support = True
23+time_range_support = True
2324
2425# search-url
2526base_url = 'https://search.yahoo.com/'
2627search_url = 'search?{query}&b={offset}&fl=1&vl=lang_{lang}'
28+search_url_with_time = 'search?{query}&b={offset}&fl=1&vl=lang_{lang}&age={age}&btf={btf}&fr2=time'
2729
2830# specific xpath variables
2931results_xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' Sr ')]"
@@ -32,6 +34,10 @@ title_xpath = './/h3/a'
3234content_xpath = './/div[@class="compText aAbs"]'
3335suggestion_xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' AlsoTry ')]//a"
3436
37+time_range_dict = {'day': ['1d', 'd'],
38+ 'week': ['1w', 'w'],
39+ 'month': ['1m', 'm']}
40+
3541
3642# remove yahoo-specific tracking-url
3743def parse_url(url_string):
@@ -51,18 +57,30 @@ def parse_url(url_string):
5157 return unquote(url_string[start:end])
5258
5359
60+def _get_url(query, offset, language, time_range):
61+ if time_range:
62+ return base_url + search_url_with_time.format(offset=offset,
63+ query=urlencode({'p': query}),
64+ lang=language,
65+ age=time_range_dict[time_range][0],
66+ btf=time_range_dict[time_range][1])
67+ return base_url + search_url.format(offset=offset,
68+ query=urlencode({'p': query}),
69+ lang=language)
70+
71+
72+def _get_language(params):
73+ if params['language'] == 'all':
74+ return 'en'
75+ return params['language'].split('_')[0]
76+
77+
5478# do search-request
5579def request(query, params):
5680 offset = (params['pageno'] - 1) * 10 + 1
81+ language = _get_language(params)
5782
58− if params['language'] == 'all':
59− language = 'en'
60− else:
61− language = params['language'].split('_')[0]
62−
63− params['url'] = base_url + search_url.format(offset=offset,
64− query=urlencode({'p': query}),
65− lang=language)
83+ params['url'] = _get_url(query, offset, language, params['time_range'])
6684
6785 # TODO required?
6886 params['cookies']['sB'] = 'fl=1&vl=lang_{lang}&sh=1&rw=new&v=1'\
searx/search.py+10−2
@@ -138,6 +138,8 @@ class Search(object):
138138 self.paging = False
139139 self.pageno = 1
140140 self.lang = 'all'
141+ self.time_range = None
142+ self.is_advanced = None
141143
142144 # set blocked engines
143145 self.disabled_engines = request.preferences.engines.get_disabled()
@@ -178,9 +180,10 @@ class Search(object):
178180 if len(query_obj.languages):
179181 self.lang = query_obj.languages[-1]
180182
181− self.engines = query_obj.engines
183+ self.time_range = self.request_data.get('time_range')
184+ self.is_advanced = self.request_data.get('advanced_search')
182185
183− self.categories = []
186+ self.engines = query_obj.engines
184187
185188 # if engines are calculated from query,
186189 # set categories by using that informations
@@ -279,6 +282,9 @@ class Search(object):
279282 if self.lang != 'all' and not engine.language_support:
280283 continue
281284
285+ if self.time_range and not engine.time_range_support:
286+ continue
287+
282288 # set default request parameters
283289 request_params = default_request_params()
284290 request_params['headers']['User-Agent'] = user_agent
@@ -293,6 +299,8 @@ class Search(object):
293299
294300 # 0 = None, 1 = Moderate, 2 = Strict
295301 request_params['safesearch'] = request.preferences.get_value('safesearch')
302+ request_params['time_range'] = self.time_range
303+ request_params['advanced_search'] = self.is_advanced
296304
297305 # update request parameters dependent on
298306 # search-engine (contained in engines folder)
searx/static/plugins/js/search_on_category_select.js+6−3
@@ -4,13 +4,16 @@ $(document).ready(function() {
44 $('#categories input[type="checkbox"]').each(function(i, checkbox) {
55 $(checkbox).prop('checked', false);
66 });
7− $('#categories label').removeClass('btn-primary').removeClass('active').addClass('btn-default');
8− $(this).removeClass('btn-default').addClass('btn-primary').addClass('active');
9− $($(this).children()[0]).prop('checked', 'checked');
7+ $(document.getElementById($(this).attr("for"))).prop('checked', true);
108 if($('#q').val()) {
119 $('#search_form').submit();
1210 }
1311 return false;
1412 });
13+ $('#time-range > option').click(function(e) {
14+ if($('#q').val()) {
15+ $('#search_form').submit();
16+ }
17+ });
1518 }
1619});
searx/static/themes/oscar/css/logicodev.min.css+1−1
@@ -1 +1 @@
1−.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{background:#29314d;color:#01d7d4}.navbar>li>a{padding:0;margin:0}.navbar-nav>li>a{background:#29314d;padding:0 8px;margin:0;line-height:30px}.navbar,.navbar-default{background-color:#29314d;border:none;border-top:4px solid #01d7d4;padding-top:5px;color:#f6f9fa!important;font-weight:700;font-size:1.1em;text-transform:lowercase;margin-bottom:24px;height:30px;line-height:30px;z-index:10}.navbar .navbar-nav>li>a,.navbar-default .navbar-nav>li>a{color:#f6f9fa}.navbar .navbar-brand,.navbar-default .navbar-brand{font-weight:700;color:#01d7d4;line-height:30px;padding:0 30px;margin:0}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#01d7d4;background:#29314d}.navbar-toggle{margin-top:0}*{border-radius:0!important}html{position:relative;min-height:100%;color:#29314d}body{font-family:Roboto,Helvetica,Arial,sans-serif;margin-bottom:80px;background-color:#fff}body a{color:#08c}.footer{position:absolute;bottom:0;width:100%;height:60px;text-align:center;color:#999}input[type=checkbox]:checked+.label_hide_if_checked,input[type=checkbox]:checked+.label_hide_if_not_checked+.label_hide_if_checked{display:none}input[type=checkbox]:not(:checked)+.label_hide_if_not_checked,input[type=checkbox]:not(:checked)+.label_hide_if_checked+.label_hide_if_not_checked{display:none}.result_header{margin-top:6px;margin-bottom:4px;font-size:16px}.result_header .favicon{margin-bottom:-3px}.result_header a{color:#29314d;text-decoration:none}.result_header a:hover{color:#08c}.result_header a:visited{color:#684898}.result_header a .highlight{background-color:#f6f9fa}.result-content{margin-top:2px;margin-bottom:0;word-wrap:break-word;color:#666;font-size:13px}.result-content .highlight{font-weight:700}.external-link,.external-link a{color:#2ecc71}.external-link a,.external-link a a{margin-right:3px}.result-default,.result-code,.result-torrent,.result-videos,.result-map{clear:both;padding:2px 4px}.result-default:hover,.result-code:hover,.result-torrent:hover,.result-videos:hover,.result-map:hover{background-color:#f6f9fa}.result-images{float:left!important;width:24%;margin:.5%}.result-images a{display:block;width:100%;height:170px;background-size:cover}.img-thumbnail{margin:5px;max-height:128px;min-height:128px}.result-videos{clear:both}.result-videos hr{margin:5px 0 15px 0}.result-videos .collapse{width:100%}.result-videos .in{margin-bottom:8px}.result-torrent{clear:both}.result-torrent b{margin-right:5px;margin-left:5px}.result-torrent .seeders{color:#2ecc71}.result-torrent .leechers{color:#f35e77}.result-map{clear:both}.result-code{clear:both}.result-code .code-fork,.result-code .code-fork a{color:#666}.suggestion_item{margin:2px 5px}.result_download{margin-right:5px}#pagination{margin-top:30px;padding-bottom:60px}.label-default{color:#a4a4a4;background:0 0}.infobox .panel-heading{background-color:#f6f9fa}.infobox .panel-heading .panel-title{font-weight:700}.infobox p{font-family:"DejaVu Serif",Georgia,Cambria,"Times New Roman",Times,serif!important;font-style:italic}.infobox .btn{background-color:#2ecc71;border:none}.infobox .btn a{color:#fff;margin:5px}.infobox .infobox_part{margin-bottom:20px;word-wrap:break-word;table-layout:fixed}.infobox .infobox_part:last-child{margin-bottom:0}.search_categories,#categories{margin:10px 0 4px 0;text-transform:capitalize}.search_categories label,#categories label{border:none;box-shadow:none;font-size:13px;padding-bottom:2px;color:#a4a4a4;margin-bottom:5px}.search_categories label:hover,#categories label:hover{color:#29314d;background-color:transparent}.search_categories label:active,#categories label:active{box-shadow:none}.search_categories .active,#categories .active,.search_categories .btn-primary,#categories .btn-primary{color:#29314d;font-weight:700;border-bottom:5px solid #01d7d4;background-color:transparent}#categories{margin:0}#main-logo{margin-top:10vh;margin-bottom:25px}#main-logo>img{max-width:350px;width:80%}#q{box-shadow:none;border-right:none;border-color:#a4a4a4}#search_form .input-group-btn .btn{border-color:#a4a4a4}#search_form .input-group-btn .btn:hover{background-color:#2ecc71;color:#fff}.cursor-text{cursor:text!important}.cursor-pointer{cursor:pointer!important}pre,code{font-family:'Ubuntu Mono','Courier New','Lucida Console',monospace!important}.lineno{margin-right:5px}.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#556366;font-style:italic}.highlight .err{border:1px solid #ffa92f}.highlight .k{color:#BE74D5;font-weight:700}.highlight .o{color:#d19a66}.highlight .cm{color:#556366;font-style:italic}.highlight .cp{color:#bc7a00}.highlight .c1{color:#556366;font-style:italic}.highlight .cs{color:#556366;font-style:italic}.highlight .gd{color:#a00000}.highlight .ge{font-style:italic}.highlight .gr{color:red}.highlight .gh{color:navy;font-weight:700}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:navy;font-weight:700}.highlight .gs{font-weight:700}.highlight .gu{color:purple;font-weight:700}.highlight .gt{color:#04d}.highlight .kc{color:#BE74D5;font-weight:700}.highlight .kd{color:#BE74D5;font-weight:700}.highlight .kn{color:#BE74D5;font-weight:700}.highlight .kp{color:#be74d5}.highlight .kr{color:#BE74D5;font-weight:700}.highlight .kt{color:#d46c72}.highlight .m{color:#d19a66}.highlight .s{color:#86c372}.highlight .na{color:#7d9029}.highlight .nb{color:#be74d5}.highlight .nc{color:#61AFEF;font-weight:700}.highlight .no{color:#d19a66}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:700}.highlight .ne{color:#D2413A;font-weight:700}.highlight .nf{color:#61afef}.highlight .nl{color:#a0a000}.highlight .nn{color:#61AFEF;font-weight:700}.highlight .nt{color:#BE74D5;font-weight:700}.highlight .nv{color:#dfc06f}.highlight .ow{color:#A2F;font-weight:700}.highlight .w{color:#d7dae0}.highlight .mf{color:#d19a66}.highlight .mh{color:#d19a66}.highlight .mi{color:#d19a66}.highlight .mo{color:#d19a66}.highlight .sb{color:#86c372}.highlight .sc{color:#86c372}.highlight .sd{color:#86C372;font-style:italic}.highlight .s2{color:#86c372}.highlight .se{color:#B62;font-weight:700}.highlight .sh{color:#86c372}.highlight .si{color:#B68;font-weight:700}.highlight .sx{color:#be74d5}.highlight .sr{color:#b68}.highlight .s1{color:#86c372}.highlight .ss{color:#dfc06f}.highlight .bp{color:#be74d5}.highlight .vc{color:#dfc06f}.highlight .vg{color:#dfc06f}.highlight .vi{color:#dfc06f}.highlight .il{color:#d19a66}.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;color:#556366}.highlight .lineno::selection{background:0 0}.highlight .lineno::-moz-selection{background:0 0}.highlight pre{background-color:#282C34;color:#D7DAE0;border:none;margin-bottom:25px;font-size:15px;padding:20px 10px}.highlight{font-weight:700}
1+.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{background:#29314d;color:#01d7d4}.navbar>li>a{padding:0;margin:0}.navbar-nav>li>a{background:#29314d;padding:0 8px;margin:0;line-height:30px}.navbar,.navbar-default{background-color:#29314d;border:none;border-top:4px solid #01d7d4;padding-top:5px;color:#f6f9fa!important;font-weight:700;font-size:1.1em;text-transform:lowercase;margin-bottom:24px;height:30px;line-height:30px;z-index:10}.navbar .navbar-nav>li>a,.navbar-default .navbar-nav>li>a{color:#f6f9fa}.navbar .navbar-brand,.navbar-default .navbar-brand{font-weight:700;color:#01d7d4;line-height:30px;padding:0 30px;margin:0}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#01d7d4;background:#29314d}.navbar-toggle{margin-top:0}*{border-radius:0!important}html{position:relative;min-height:100%;color:#29314d}body{font-family:Roboto,Helvetica,Arial,sans-serif;margin-bottom:80px;background-color:#fff}body a{color:#08c}.footer{position:absolute;bottom:0;width:100%;height:60px;text-align:center;color:#999}input[type=checkbox]:checked+.label_hide_if_checked,input[type=checkbox]:checked+.label_hide_if_not_checked+.label_hide_if_checked{display:none}input[type=checkbox]:not(:checked)+.label_hide_if_not_checked,input[type=checkbox]:not(:checked)+.label_hide_if_checked+.label_hide_if_not_checked{display:none}.result_header{margin-top:6px;margin-bottom:4px;font-size:16px}.result_header .favicon{margin-bottom:-3px}.result_header a{color:#29314d;text-decoration:none}.result_header a:hover{color:#08c}.result_header a:visited{color:#684898}.result_header a .highlight{background-color:#f6f9fa}.result-content{margin-top:2px;margin-bottom:0;word-wrap:break-word;color:#666;font-size:13px}.result-content .highlight{font-weight:700}.external-link,.external-link a{color:#2ecc71}.external-link a,.external-link a a{margin-right:3px}.result-default,.result-code,.result-torrent,.result-videos,.result-map{clear:both;padding:2px 4px}.result-default:hover,.result-code:hover,.result-torrent:hover,.result-videos:hover,.result-map:hover{background-color:#f6f9fa}.result-images{float:left!important;width:24%;margin:.5%}.result-images a{display:block;width:100%;height:170px;background-size:cover}.img-thumbnail{margin:5px;max-height:128px;min-height:128px}.result-videos{clear:both}.result-videos hr{margin:5px 0 15px 0}.result-videos .collapse{width:100%}.result-videos .in{margin-bottom:8px}.result-torrent{clear:both}.result-torrent b{margin-right:5px;margin-left:5px}.result-torrent .seeders{color:#2ecc71}.result-torrent .leechers{color:#f35e77}.result-map{clear:both}.result-code{clear:both}.result-code .code-fork,.result-code .code-fork a{color:#666}.suggestion_item{margin:2px 5px}.result_download{margin-right:5px}#pagination{margin-top:30px;padding-bottom:60px}.label-default{color:#a4a4a4;background:0 0}.infobox .panel-heading{background-color:#f6f9fa}.infobox .panel-heading .panel-title{font-weight:700}.infobox p{font-family:"DejaVu Serif",Georgia,Cambria,"Times New Roman",Times,serif!important;font-style:italic}.infobox .btn{background-color:#2ecc71;border:none}.infobox .btn a{color:#fff;margin:5px}.infobox .infobox_part{margin-bottom:20px;word-wrap:break-word;table-layout:fixed}.infobox .infobox_part:last-child{margin-bottom:0}.search_categories,#categories{text-transform:capitalize;margin-bottom:.5rem}.search_categories label,#categories label,.search_categories .input-group-addon,#categories .input-group-addon{font-size:1.2rem;font-weight:400;background-color:#fff;border:#ddd 1px solid;border-right:none;color:#666;padding-bottom:.4rem;padding-top:.4rem;padding-left:.5rem;padding-right:.5rem}.search_categories label:last-child,#categories label:last-child,.search_categories .input-group-addon:last-child,#categories .input-group-addon:last-child{border-right:#ddd 1px solid}.search_categories input[type=checkbox]:checked+label,#categories input[type=checkbox]:checked+label{color:#29314d;font-weight:700;border-bottom:#01d7d4 5px solid}#main-logo{margin-top:10vh;margin-bottom:25px}#main-logo>img{max-width:350px;width:80%}#q{box-shadow:none;border-right:none;border-color:#a4a4a4}#search_form .input-group-btn .btn{border-color:#a4a4a4}#search_form .input-group-btn .btn:hover{background-color:#2ecc71;color:#fff}#advanced-search-container{display:none;text-align:left;margin-bottom:1rem}#advanced-search-container label,#advanced-search-container .input-group-addon{font-size:1.2rem;font-weight:400;background-color:#fff;border:#ddd 1px solid;border-right:none;color:#666;padding-bottom:.4rem;padding-top:.4rem;padding-left:.5rem;padding-right:.5rem}#advanced-search-container label:last-child,#advanced-search-container .input-group-addon:last-child{border-right:#ddd 1px solid}#advanced-search-container input[type=radio]{display:none}#advanced-search-container input[type=radio]:checked+label{color:#29314d;font-weight:700;border-bottom:#01d7d4 5px solid}#advanced-search-container select{appearance:none;-webkit-appearance:none;-moz-appearance:none;font-size:1.2rem;font-weight:400;background-color:#fff;border:#ddd 1px solid;color:#666;padding-bottom:.4rem;padding-top:.4rem;padding-left:1rem;padding-right:5rem;margin-right:.5rem;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAABFkAAARZAVnbJUkAAAAHdElNRQfgBxgLDwB20OFsAAAAbElEQVQY073OsQ3CMAAEwJMYwJGnsAehpoXJItltBkmcdZBYgIIiQoLglnz3ui+eP+bk5uneteTMZJa6OJuIqvYzSJoqwqBq8gdmTTW86/dghxAUq4xsVYT9laBYXCw93Aajh7GPEF23t4fkBYevGFTANkPRAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE2LTA3LTI0VDExOjU1OjU4KzAyOjAwRFqFOQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNi0wNy0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC) 96% no-repeat}#check-advanced{display:none}#check-advanced:checked~#advanced-search-container{display:block}.advanced{margin-top:1rem;text-align:right}.cursor-text{cursor:text!important}.cursor-pointer{cursor:pointer!important}pre,code{font-family:'Ubuntu Mono','Courier New','Lucida Console',monospace!important}.lineno{margin-right:5px}.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#556366;font-style:italic}.highlight .err{border:1px solid #ffa92f}.highlight .k{color:#BE74D5;font-weight:700}.highlight .o{color:#d19a66}.highlight .cm{color:#556366;font-style:italic}.highlight .cp{color:#bc7a00}.highlight .c1{color:#556366;font-style:italic}.highlight .cs{color:#556366;font-style:italic}.highlight .gd{color:#a00000}.highlight .ge{font-style:italic}.highlight .gr{color:red}.highlight .gh{color:navy;font-weight:700}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:navy;font-weight:700}.highlight .gs{font-weight:700}.highlight .gu{color:purple;font-weight:700}.highlight .gt{color:#04d}.highlight .kc{color:#BE74D5;font-weight:700}.highlight .kd{color:#BE74D5;font-weight:700}.highlight .kn{color:#BE74D5;font-weight:700}.highlight .kp{color:#be74d5}.highlight .kr{color:#BE74D5;font-weight:700}.highlight .kt{color:#d46c72}.highlight .m{color:#d19a66}.highlight .s{color:#86c372}.highlight .na{color:#7d9029}.highlight .nb{color:#be74d5}.highlight .nc{color:#61AFEF;font-weight:700}.highlight .no{color:#d19a66}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:700}.highlight .ne{color:#D2413A;font-weight:700}.highlight .nf{color:#61afef}.highlight .nl{color:#a0a000}.highlight .nn{color:#61AFEF;font-weight:700}.highlight .nt{color:#BE74D5;font-weight:700}.highlight .nv{color:#dfc06f}.highlight .ow{color:#A2F;font-weight:700}.highlight .w{color:#d7dae0}.highlight .mf{color:#d19a66}.highlight .mh{color:#d19a66}.highlight .mi{color:#d19a66}.highlight .mo{color:#d19a66}.highlight .sb{color:#86c372}.highlight .sc{color:#86c372}.highlight .sd{color:#86C372;font-style:italic}.highlight .s2{color:#86c372}.highlight .se{color:#B62;font-weight:700}.highlight .sh{color:#86c372}.highlight .si{color:#B68;font-weight:700}.highlight .sx{color:#be74d5}.highlight .sr{color:#b68}.highlight .s1{color:#86c372}.highlight .ss{color:#dfc06f}.highlight .bp{color:#be74d5}.highlight .vc{color:#dfc06f}.highlight .vg{color:#dfc06f}.highlight .vi{color:#dfc06f}.highlight .il{color:#d19a66}.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;color:#556366}.highlight .lineno::selection{background:0 0}.highlight .lineno::-moz-selection{background:0 0}.highlight pre{background-color:#282C34;color:#D7DAE0;border:none;margin-bottom:25px;font-size:15px;padding:20px 10px}.highlight{font-weight:700}
searx/static/themes/oscar/css/pointhi.min.css+1−1
@@ -1 +1 @@
1−html{position:relative;min-height:100%}body{margin-bottom:80px}.footer{position:absolute;bottom:0;width:100%;height:60px}input[type=checkbox]:checked+.label_hide_if_checked,input[type=checkbox]:checked+.label_hide_if_not_checked+.label_hide_if_checked{display:none}input[type=checkbox]:not(:checked)+.label_hide_if_not_checked,input[type=checkbox]:not(:checked)+.label_hide_if_checked+.label_hide_if_not_checked{display:none}.result_header{margin-bottom:5px;margin-top:20px}.result_header .favicon{margin-bottom:-3px}.result_header a{vertical-align:bottom}.result_header a .highlight{font-weight:700}.result-content{margin-top:5px;word-wrap:break-word}.result-content .highlight{font-weight:700}.result-default{clear:both}.result-images{float:left!important}.img-thumbnail{margin:5px;max-height:128px;min-height:128px}.result-videos{clear:both}.result-torrents{clear:both}.result-map{clear:both}.result-code{clear:both}.suggestion_item{margin:2px 5px}.result_download{margin-right:5px}#pagination{margin-top:30px;padding-bottom:50px}.label-default{color:#AAA;background:#FFF}.infobox .infobox_part{margin-bottom:20px;word-wrap:break-word;table-layout:fixed}.infobox .infobox_part:last-child{margin-bottom:0}.search_categories{margin:10px 0;text-transform:capitalize}.cursor-text{cursor:text!important}.cursor-pointer{cursor:pointer!important}.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#408080;font-style:italic}.highlight .err{border:1px solid red}.highlight .k{color:green;font-weight:700}.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:red}.highlight .gh{color:navy;font-weight:700}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:navy;font-weight:700}.highlight .gs{font-weight:700}.highlight .gu{color:purple;font-weight:700}.highlight .gt{color:#04d}.highlight .kc{color:green;font-weight:700}.highlight .kd{color:green;font-weight:700}.highlight .kn{color:green;font-weight:700}.highlight .kp{color:green}.highlight .kr{color:green;font-weight:700}.highlight .kt{color:#b00040}.highlight .m{color:#666}.highlight .s{color:#ba2121}.highlight .na{color:#7d9029}.highlight .nb{color:green}.highlight .nc{color:#00F;font-weight:700}.highlight .no{color:#800}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:700}.highlight .ne{color:#D2413A;font-weight:700}.highlight .nf{color:#00f}.highlight .nl{color:#a0a000}.highlight .nn{color:#00F;font-weight:700}.highlight .nt{color:green;font-weight:700}.highlight .nv{color:#19177c}.highlight .ow{color:#A2F;font-weight:700}.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:700}.highlight .sh{color:#ba2121}.highlight .si{color:#B68;font-weight:700}.highlight .sx{color:green}.highlight .sr{color:#b68}.highlight .s1{color:#ba2121}.highlight .ss{color:#19177c}.highlight .bp{color:green}.highlight .vc{color:#19177c}.highlight .vg{color:#19177c}.highlight .vi{color:#19177c}.highlight .il{color:#666}.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:0 0}.highlight .lineno::-moz-selection{background:0 0}
1+html{position:relative;min-height:100%}body{margin-bottom:80px}.footer{position:absolute;bottom:0;width:100%;height:60px}input[type=checkbox]:checked+.label_hide_if_checked,input[type=checkbox]:checked+.label_hide_if_not_checked+.label_hide_if_checked{display:none}input[type=checkbox]:not(:checked)+.label_hide_if_not_checked,input[type=checkbox]:not(:checked)+.label_hide_if_checked+.label_hide_if_not_checked{display:none}.result_header{margin-bottom:5px;margin-top:20px}.result_header .favicon{margin-bottom:-3px}.result_header a{vertical-align:bottom}.result_header a .highlight{font-weight:700}.result-content{margin-top:5px;word-wrap:break-word}.result-content .highlight{font-weight:700}.result-default{clear:both}.result-images{float:left!important}.img-thumbnail{margin:5px;max-height:128px;min-height:128px}.result-videos{clear:both}.result-torrents{clear:both}.result-map{clear:both}.result-code{clear:both}.suggestion_item{margin:2px 5px}.result_download{margin-right:5px}#pagination{margin-top:30px;padding-bottom:50px}.label-default{color:#AAA;background:#FFF}.infobox .infobox_part{margin-bottom:20px;word-wrap:break-word;table-layout:fixed}.infobox .infobox_part:last-child{margin-bottom:0}.search_categories,#categories{text-transform:capitalize;margin-bottom:1.5rem;margin-top:1.5rem}.search_categories label,#categories label,.search_categories .input-group-addon,#categories .input-group-addon{font-size:1.3rem;font-weight:400;background-color:#fff;border:#DDD 1px solid;border-right:none;color:#333;padding-bottom:.8rem;padding-top:.8rem;padding-left:1.2rem;padding-right:1.2rem}.search_categories label:last-child,#categories label:last-child,.search_categories .input-group-addon:last-child,#categories .input-group-addon:last-child{border-right:#DDD 1px solid}.search_categories input[type=checkbox]:checked+label,#categories input[type=checkbox]:checked+label{color:#000;font-weight:700;background-color:#EEE}#advanced-search-container{display:none;text-align:center;margin-bottom:1rem}#advanced-search-container label,#advanced-search-container .input-group-addon{font-size:1.3rem;font-weight:400;background-color:#fff;border:#DDD 1px solid;border-right:none;color:#333;padding-bottom:.8rem;padding-top:.8rem;padding-left:1.2rem;padding-right:1.2rem}#advanced-search-container label:last-child,#advanced-search-container .input-group-addon:last-child{border-right:#DDD 1px solid}#advanced-search-container input[type=radio]{display:none}#advanced-search-container input[type=radio]:checked+label{color:#000;font-weight:700;background-color:#EEE}#check-advanced{display:none}#check-advanced:checked~#advanced-search-container{display:block}.advanced{margin-top:1rem;text-align:right}.cursor-text{cursor:text!important}.cursor-pointer{cursor:pointer!important}.highlight .hll{background-color:#ffc}.highlight{background:#f8f8f8}.highlight .c{color:#408080;font-style:italic}.highlight .err{border:1px solid red}.highlight .k{color:green;font-weight:700}.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:red}.highlight .gh{color:navy;font-weight:700}.highlight .gi{color:#00a000}.highlight .go{color:#888}.highlight .gp{color:navy;font-weight:700}.highlight .gs{font-weight:700}.highlight .gu{color:purple;font-weight:700}.highlight .gt{color:#04d}.highlight .kc{color:green;font-weight:700}.highlight .kd{color:green;font-weight:700}.highlight .kn{color:green;font-weight:700}.highlight .kp{color:green}.highlight .kr{color:green;font-weight:700}.highlight .kt{color:#b00040}.highlight .m{color:#666}.highlight .s{color:#ba2121}.highlight .na{color:#7d9029}.highlight .nb{color:green}.highlight .nc{color:#00F;font-weight:700}.highlight .no{color:#800}.highlight .nd{color:#a2f}.highlight .ni{color:#999;font-weight:700}.highlight .ne{color:#D2413A;font-weight:700}.highlight .nf{color:#00f}.highlight .nl{color:#a0a000}.highlight .nn{color:#00F;font-weight:700}.highlight .nt{color:green;font-weight:700}.highlight .nv{color:#19177c}.highlight .ow{color:#A2F;font-weight:700}.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:700}.highlight .sh{color:#ba2121}.highlight .si{color:#B68;font-weight:700}.highlight .sx{color:green}.highlight .sr{color:#b68}.highlight .s1{color:#ba2121}.highlight .ss{color:#19177c}.highlight .bp{color:green}.highlight .vc{color:#19177c}.highlight .vg{color:#19177c}.highlight .vi{color:#19177c}.highlight .il{color:#666}.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:0 0}.highlight .lineno::-moz-selection{background:0 0}
searx/static/themes/oscar/less/logicodev/advanced.lessnew file+68
@@ -0,0 +1,68 @@
1+#advanced-search-container {
2+ display:none;
3+ text-align:left;
4+ margin-bottom:1rem;
5+
6+ label, .input-group-addon {
7+ font-size: 1.2rem;
8+ font-weight:normal;
9+ background-color: white;
10+ border: @mild-gray 1px solid;
11+ border-right: none;
12+ color: @dark-gray;
13+ padding-bottom: 0.4rem;
14+ padding-top: 0.4rem;
15+ padding-left: 0.5rem;
16+ padding-right: 0.5rem;
17+ }
18+
19+ label:last-child, .input-group-addon:last-child {
20+ border-right: @mild-gray 1px solid;
21+ }
22+
23+ input[type="radio"] {
24+ display: none;
25+ }
26+
27+ input[type="radio"]:checked + label{
28+ color: @black;
29+ font-weight:bold;
30+ border-bottom: @light-green 5px solid;
31+ }
32+ select {
33+ appearance: none;
34+ -webkit-appearance: none;
35+ -moz-appearance: none;
36+ font-size: 1.2rem;
37+ font-weight:normal;
38+ background-color: white;
39+ border: @mild-gray 1px solid;
40+ color: @dark-gray;
41+ padding-bottom: 0.4rem;
42+ padding-top: 0.4rem;
43+ padding-left: 1rem;
44+ padding-right: 5rem;
45+ margin-right: 0.5rem;
46+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
47+AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZ
48+cwAABFkAAARZAVnbJUkAAAAHdElNRQfgBxgLDwB20OFsAAAAbElEQVQY073OsQ3CMAAEwJMYwJGn
49+sAehpoXJItltBkmcdZBYgIIiQoLglnz3ui+eP+bk5uneteTMZJa6OJuIqvYzSJoqwqBq8gdmTTW8
50+6/dghxAUq4xsVYT9laBYXCw93Aajh7GPEF23t4fkBYevGFTANkPRAAAAJXRFWHRkYXRlOmNyZWF0
51+ZQAyMDE2LTA3LTI0VDExOjU1OjU4KzAyOjAwRFqFOQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNi0w
52+Ny0yNFQxMToxNTowMCswMjowMP7RDgQAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb
53+7jwaAAAAAElFTkSuQmCC) 96% no-repeat;
54+ }
55+}
56+
57+#check-advanced {
58+ display: none;
59+}
60+
61+#check-advanced:checked ~ #advanced-search-container {
62+ display:block;
63+}
64+
65+.advanced {
66+ margin-top:1rem;
67+ text-align:right;
68+}
searx/static/themes/oscar/less/logicodev/oscar.less+2
@@ -12,6 +12,8 @@
1212
1313@import "search.less";
1414
15+@import "advanced.less";
16+
1517@import "cursor.less";
1618
1719@import "code.less";
searx/static/themes/oscar/less/logicodev/search.less+18−26
@@ -1,36 +1,28 @@
11.search_categories, #categories {
2− margin: 10px 0 4px 0;
32 text-transform: capitalize;
4−
5− label{
6− border: none;
7− box-shadow: none;
8− font-size: 13px;
9− padding-bottom: 2px;
10− color: @gray;
11− margin-bottom: 5px;
12−
13− &:hover{
14− color: @black;
15− background-color: transparent;
16− }
3+ margin-bottom: 0.5rem;
174
18− &:active{
19− box-shadow: none;
20− }
5+ label, .input-group-addon {
6+ font-size: 1.2rem;
7+ font-weight:normal;
8+ background-color: white;
9+ border: @mild-gray 1px solid;
10+ border-right: none;
11+ color: @dark-gray;
12+ padding-bottom: 0.4rem;
13+ padding-top: 0.4rem;
14+ padding-left: 0.5rem;
15+ padding-right: 0.5rem;
16+ }
17+ label:last-child, .input-group-addon:last-child {
18+ border-right: @mild-gray 1px solid;
2119 }
2220
23− .active, .btn-primary{
21+ input[type="checkbox"]:checked + label {
2422 color: @black;
25− font-weight: 700;
26− border-bottom: 5px solid @light-green;
27− background-color: transparent;
23+ font-weight:bold;
24+ border-bottom: @light-green 5px solid;
2825 }
29−
30−}
31−
32−#categories{
33− margin: 0;
3426}
3527
3628#main-logo{
searx/static/themes/oscar/less/logicodev/variables.less+2
@@ -2,6 +2,8 @@
22@gray: #A4A4A4;
33@dim-gray: #F6F9FA;
44@dark-gray: #666;
5+@middle-gray: #F5F5F5;
6+@mild-gray: #DDD;
57@blue: #0088CC;
68@red: #F35E77;
79@violet: #684898;
searx/static/themes/oscar/less/pointhi/advanced.lessnew file+45
@@ -0,0 +1,45 @@
1+#advanced-search-container {
2+ display:none;
3+ text-align:center;
4+ margin-bottom:1rem;
5+
6+ label, .input-group-addon {
7+ font-size: 1.3rem;
8+ font-weight:normal;
9+ background-color: white;
10+ border: #DDD 1px solid;
11+ border-right: none;
12+ color: #333;
13+ padding-bottom: 0.8rem;
14+ padding-top: 0.8rem;
15+ padding-left: 1.2rem;
16+ padding-right: 1.2rem;
17+ }
18+
19+ label:last-child, .input-group-addon:last-child {
20+ border-right: #DDD 1px solid;
21+ }
22+
23+ input[type="radio"] {
24+ display: none;
25+ }
26+
27+ input[type="radio"]:checked + label{
28+ color: black;
29+ font-weight:bold;
30+ background-color: #EEE;
31+ }
32+}
33+
34+#check-advanced {
35+ display: none;
36+}
37+
38+#check-advanced:checked ~ #advanced-search-container {
39+ display:block;
40+}
41+
42+.advanced {
43+ margin-top:1rem;
44+ text-align:right;
45+}
searx/static/themes/oscar/less/pointhi/oscar.less+2
@@ -8,6 +8,8 @@
88
99@import "search.less";
1010
11+@import "advanced.less";
12+
1113@import "cursor.less";
1214
1315@import "code.less";
searx/static/themes/oscar/less/pointhi/search.less+27−3
@@ -1,4 +1,28 @@
1−.search_categories {
2− margin:10px 0;
3− text-transform: capitalize;
1+.search_categories, #categories {
2+ text-transform: capitalize;
3+ margin-bottom:1.5rem;
4+ margin-top:1.5rem;
5+
6+ label, .input-group-addon {
7+ font-size: 1.3rem;
8+ font-weight:normal;
9+ background-color: white;
10+ border: #DDD 1px solid;
11+ border-right: none;
12+ color: #333;
13+ padding-bottom: 0.8rem;
14+ padding-top: 0.8rem;
15+ padding-left: 1.2rem;
16+ padding-right: 1.2rem;
17+ }
18+
19+ label:last-child, .input-group-addon:last-child {
20+ border-right: #DDD 1px solid;
21+ }
22+
23+ input[type="checkbox"]:checked + label{
24+ color: black;
25+ font-weight:bold;
26+ background-color: #EEE;
27+ }
428}
searx/templates/oscar/advanced.htmlnew file+11
@@ -0,0 +1,11 @@
1+<div class="input-group col-sm-12 advanced">
2+ <input type="checkbox" name="advanced_search" id="check-advanced" {% if advanced_search %} checked="checked"{% endif %}>
3+ <label for="check-advanced">
4+ <span class="glyphicon glyphicon-cog"></span>
5+ {{ _('Advanced settings') }}
6+ </label>
7+ <div id="advanced-search-container">
8+ {% include 'oscar/categories.html' %}
9+ {% include 'oscar/time-range.html' %}
10+ </div>
11+</div>
searx/templates/oscar/categories.html+10−38
@@ -1,42 +1,14 @@
1−<!-- used if scripts are disabled -->
2−<noscript>
3−<div id="categories" class="btn-group btn-toggle">
1+<div id="categories">
42{% 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 %}
3+ {% for category in categories | reverse %}
4+ <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
5+ <label class="input-group-addon" for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
6+ </label>
7+ {% endfor %}
138{% else %}
14−{% for category in categories %}
15− <!--<div class="checkbox">-->
16− <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
17− <label class="btn btn-sm btn-primary active label_hide_if_not_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
18− <label class="btn btn-sm btn-default label_hide_if_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
19− <!--</div>-->
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 %}
21−{% endfor %}
9+ {% for category in categories %}
10+ <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
11+ <label class="input-group-addon" for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
12+ {% endfor %}
2213{% endif %}
2314</div>
24−</noscript>
25−
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 %}
34−{% for category in categories %}
35− <label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
36− <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }}
37− </label>
38−{% endfor %}
39−{% endif %}
40−</div>
41−
42−
searx/templates/oscar/preferences.html+1−1
@@ -36,7 +36,7 @@
3636 <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
3737 {% else %}
3838 <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
39− <div class="col-sm-11 col-md-10">
39+ <div class="col-sm-11 col-md-10 search-categories">
4040 {% include 'oscar/categories.html' %}
4141 </div>
4242 {% endif %}
searx/templates/oscar/results.html+7−2
@@ -1,6 +1,6 @@
11{% extends "oscar/base.html" %}
22{% block title %}{{ q }} - {% endblock %}
3−{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&amp;format=rss&amp;{% for category in selected_categories %}category_{{ category }}=1&amp;{% endfor %}pageno={{ pageno }}">{% endblock %}
3+{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&amp;format=rss&amp;{% for category in selected_categories %}category_{{ category }}=1&amp;{% endfor %}pageno={{ pageno }}&amp;time_range={{ time_range }}">{% endblock %}
44{% block content %}
55 <div class="row">
66 <div class="col-sm-8" id="main_results">
@@ -41,6 +41,7 @@
4141 {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
4242 <input type="hidden" name="q" value="{{ q }}" />
4343 <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
44+ <input type="hidden" name="time_range" value="{{ time_range }}" />
4445 <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
4546 </form>
4647 </div>
@@ -48,6 +49,7 @@
4849 <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
4950 {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
5051 <input type="hidden" name="pageno" value="{{ pageno-1 }}" />
52+ <input type="hidden" name="time_range" value="{{ time_range }}" />
5153 <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
5254 </form>
5355 </div>
@@ -60,6 +62,7 @@
6062 <input type="hidden" name="q" value="{{ q }}" />
6163 {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
6264 <input type="hidden" name="pageno" value="{{ pageno-1 }}" />
65+ <input type="hidden" name="time_range" value="{{ time_range }}" />
6366 <button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
6467 </form>
6568 </div>
@@ -68,6 +71,7 @@
6871 {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
6972 <input type="hidden" name="q" value="{{ q }}" />
7073 <input type="hidden" name="pageno" value="{{ pageno+1 }}" />
74+ <input type="hidden" name="time_range" value="{{ time_range }}" />
7175 <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
7276 </form>
7377 </div>
@@ -118,7 +122,7 @@
118122 <form role="form">
119123 <div class="form-group">
120124 <label for="search_url">{{ _('Search URL') }}</label>
121− <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}" readonly>
125+ <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&amp;categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&amp;pageno={{ pageno }}{% endif %}{% if time_range %}&amp;time_range={{ time_range }}{% endif %}" readonly>
122126 </div>
123127 </form>
124128
@@ -130,6 +134,7 @@
130134 <input type="hidden" name="format" value="{{ output_type }}">
131135 {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1">{% endfor %}
132136 <input type="hidden" name="pageno" value="{{ pageno }}">
137+ <input type="hidden" name="time_range" value="{{ time_range }}" />
133138 <button type="submit" class="btn btn-default">{{ output_type }}</button>
134139 </form>
135140 {% endfor %}
searx/templates/oscar/search.html+1−3
@@ -6,7 +6,5 @@
66 <button type="submit" class="btn btn-default"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button>
77 </span>
88 </div>
9− <div class="search_categories">
10− {% include 'oscar/categories.html' %}
11− </div><!-- / #search_categories -->
9+ {% include 'oscar/advanced.html' %}
1210</form><!-- / #search_form_full -->
searx/templates/oscar/search_full.html+3−6
@@ -11,11 +11,8 @@
1111 <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>
1212 </span>
1313 </div>
14+ <div class="input-group col-md-8 col-md-offset-2">
15+ {% include 'oscar/advanced.html' %}
16+ </div>
1417
15− <button type="button" class="btn btn-link btn-collapse center-block collapsed hide_if_nojs" data-toggle="collapse" data-target="#search_categories" data-btn-text-collapsed="{{ _('Show search filters') }}" data-btn-text-not-collapsed="{{ _('Hide search filters') }}">{{ _('Show search filters') }}</button>
16− <div class="row collapse active_if_nojs margin_top_if_nojs" id="search_categories">
17− <div class="col-md-12 text-center">
18− {% include 'oscar/categories.html' %}
19− </div>
20− </div><!-- / #search_categories -->
2118</form><!-- / #search_form_full -->
searx/templates/oscar/time-range.htmlnew file+14
@@ -0,0 +1,14 @@
1+<select name="time_range" id="time-range">
2+ <option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}>
3+ {{ _('Anytime') }}
4+ </option>
5+ <option id="time-range-day" value="day" {{ "selected" if time_range=="day" else ""}}>
6+ {{ _('Last day') }}
7+ </option>
8+ <option id="time-range-week" value="week" {{ "selected" if time_range=="week" else ""}}>
9+ {{ _('Last week') }}
10+ </option>
11+ <option id="time-range-month" value="month" {{ "selected" if time_range=="month" else ""}}>
12+ {{ _('Last month') }}
13+ </option>
14+</select>
searx/webapp.py+2
@@ -459,6 +459,8 @@ def index():
459459 paging=search.paging,
460460 number_of_results=format_decimal(number_of_results),
461461 pageno=search.pageno,
462+ advanced_search=search.is_advanced,
463+ time_range=search.time_range,
462464 base_url=get_base_url(),
463465 suggestions=search.result_container.suggestions,
464466 answers=search.result_container.answers,