summaryrefslogtreecommitdiff
path: root/searx/templates/oscar
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2022-01-23 11:37:57 +0100
committerAlexandre Flament <alex@al-f.net>2022-02-20 22:58:51 +0100
commit56e34947a6368e6154064c52fa23d21ecda7ab4c (patch)
treebad1463a0c3056896cfacb205039586b85a2c04d /searx/templates/oscar
parent36aee70c247fe347c69abb17ec3bdc31781204c6 (diff)
downloadsearxng-56e34947a6368e6154064c52fa23d21ecda7ab4c.tar.gz
searxng-56e34947a6368e6154064c52fa23d21ecda7ab4c.zip
[mod] infinite_scroll as preference
* oscar theme: code from searx/plugins/infinite_scroll.py * simple theme: new implementation Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
Diffstat (limited to 'searx/templates/oscar')
-rw-r--r--searx/templates/oscar/base.html1
-rw-r--r--searx/templates/oscar/preferences.html11
2 files changed, 12 insertions, 0 deletions
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html
index de7d05bf6..dbc0699df 100644
--- a/searx/templates/oscar/base.html
+++ b/searx/templates/oscar/base.html
@@ -100,6 +100,7 @@
<script src="{{ url_for('static', filename='js/searxng.min.js') }}"
data-method="{{ method or 'POST' }}"
data-autocompleter="{% if autocomplete %}true{% else %}false{% endif %}"
+ data-infinite-scroll="{% if infinite_scroll %}true{% else %}false{% endif %}"
data-translations="{{ translations }}"></script>
{% for script in scripts %}
{{""}}<script src="{{ url_for('static', filename=script) }}"></script>
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html
index 71ee57a62..1a5219b07 100644
--- a/searx/templates/oscar/preferences.html
+++ b/searx/templates/oscar/preferences.html
@@ -248,6 +248,17 @@
{{ preferences_item_footer(info, label, rtl) }}
{% endif %}
+ {% if 'infinite_scroll' not in locked_preferences %}
+ {% set label = _('Infinite scroll') %}
+ {% set info = _('Automatically load next page when scrolling to bottom of current page') %}
+ {{ preferences_item_header(info, label, rtl, 'infinite_scroll') }}
+ <select class="form-control {{ custom_select_class(rtl) }}" name="infinite_scroll" id="infinite_scroll">
+ <option value="1" {% if infinite_scroll %}selected="selected"{% endif %}>{{ _('On') }}</option>
+ <option value="0" {% if not infinite_scroll %}selected="selected"{% endif %}>{{ _('Off')}}</option>
+ </select>
+ {{ preferences_item_footer(info, label, rtl) }}
+ {% endif %}
+
{{ plugin_of_category('ui' )}}
</div>
</fieldset>