diff --git a/searx/search.py b/searx/search.py index 427da3bab..0324d4aaf 100644 --- a/searx/search.py +++ b/searx/search.py @@ -384,12 +384,17 @@ class Search(object): for pd_name, pd in self.request_data.items(): if pd_name.startswith('category_'): category = pd_name[9:] + # if category is not found in list, skip if category not in categories: continue - # add category to list - self.categories.append(category) + if pd != 'off': + # add category to list + self.categories.append(category) + elif category in self.categories: + # remove category from list if property is set to 'off' + self.categories.remove(category) # if no category is specified for this search, # using user-defined default-configuration which diff --git a/searx/static/themes/oscar/css/oscar.min.css b/searx/static/themes/oscar/css/oscar.min.css index b8d6fba15..72be92c46 100644 Binary files a/searx/static/themes/oscar/css/oscar.min.css and b/searx/static/themes/oscar/css/oscar.min.css differ diff --git a/searx/static/themes/oscar/less/oscar/checkbox.less b/searx/static/themes/oscar/less/oscar/checkbox.less index 712e53d49..6428b36ed 100644 --- a/searx/static/themes/oscar/less/oscar/checkbox.less +++ b/searx/static/themes/oscar/less/oscar/checkbox.less @@ -1,9 +1,9 @@ // Hide element if checkbox is checked -input[type=checkbox]:checked ~ .label_hide_if_checked { +input[type=checkbox]:checked + .label_hide_if_checked, input[type=checkbox]:checked + .label_hide_if_not_checked + .label_hide_if_checked { display:none; } // Hide element if checkbox is not checked -input[type=checkbox]:not(:checked) ~ .label_hide_if_not_checked { +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; } diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index 466756b6f..c0393a66d 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -36,7 +36,8 @@ diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html index 82ddcf686..f38cce5bd 100644 --- a/searx/templates/oscar/categories.html +++ b/searx/templates/oscar/categories.html @@ -1,6 +1,22 @@ -
+ + + +
{% for category in categories %} {% endfor %}
+ + diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html index 673f23969..5818286ec 100644 --- a/searx/templates/oscar/search_full.html +++ b/searx/templates/oscar/search_full.html @@ -8,8 +8,8 @@
- -
+ +
{% include 'oscar/categories.html' %}