diff options
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/oscar/advanced.html | 11 | ||||
-rw-r--r-- | searx/templates/oscar/categories.html | 48 | ||||
-rw-r--r-- | searx/templates/oscar/preferences.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/results.html | 9 | ||||
-rw-r--r-- | searx/templates/oscar/search.html | 4 | ||||
-rw-r--r-- | searx/templates/oscar/search_full.html | 9 | ||||
-rw-r--r-- | searx/templates/oscar/time-range.html | 11 |
7 files changed, 44 insertions, 50 deletions
diff --git a/searx/templates/oscar/advanced.html b/searx/templates/oscar/advanced.html new file mode 100644 index 000000000..f2e5de513 --- /dev/null +++ b/searx/templates/oscar/advanced.html @@ -0,0 +1,11 @@ +<div class="input-group col-sm-12 advanced"> + <input type="checkbox" id="check-advanced"> + <label for="check-advanced"> + <span class="glyphicon glyphicon-cog"></span> + Advanced settings + </label> + <div id="advanced-search-container"> + {% include 'oscar/categories.html' %} + {% include 'oscar/time-range.html' %} + </div> +</div> diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html index 834cffcce..d850bb744 100644 --- a/searx/templates/oscar/categories.html +++ b/searx/templates/oscar/categories.html @@ -1,42 +1,14 @@ -<!-- used if scripts are disabled --> -<noscript> -<div id="categories" class="btn-group btn-toggle"> +<div id="categories"> {% if rtl %} -{% for category in categories | reverse %} - <!--<div class="checkbox">--> - <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> - <label class="btn btn-sm btn-primary active label_hide_if_not_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label> - <label class="btn btn-sm btn-default label_hide_if_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label> - <!--</div>--> - {% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %} -{% endfor %} + {% for category in categories | reverse %} + <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> + <label class="input-group-addon" for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> + </label> + {% endfor %} {% else %} -{% for category in categories %} - <!--<div class="checkbox">--> - <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> - <label class="btn btn-sm btn-primary active label_hide_if_not_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label> - <label class="btn btn-sm btn-default label_hide_if_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label> - <!--</div>--> - {% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %} -{% endfor %} + {% for category in categories %} + <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /> + <label class="input-group-addon" for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> + {% endfor %} {% endif %} </div> -</noscript> - -<div id="categories" class="btn-group btn-toggle hide_if_nojs" data-toggle="buttons"> -{% if rtl %} -{% for category in categories | reverse %} - <label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary"> - <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }} - </label> -{% endfor %} -{% else %} -{% for category in categories %} - <label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary"> - <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }} - </label> -{% endfor %} -{% endif %} -</div> - - diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 18308bd23..89e4f499a 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -36,7 +36,7 @@ <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label> {% else %} <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label> - <div class="col-sm-11 col-md-10"> + <div class="col-sm-11 col-md-10 search-categories"> {% include 'oscar/categories.html' %} </div> {% endif %} diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index 39cdff494..e71be325a 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -1,6 +1,6 @@ {% extends "oscar/base.html" %}
{% block title %}{{ q }} - {% endblock %}
-{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&format=rss&{% for category in selected_categories %}category_{{ category }}=1&{% endfor %}pageno={{ pageno }}">{% endblock %}
+{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&format=rss&{% for category in selected_categories %}category_{{ category }}=1&{% endfor %}pageno={{ pageno }}&time_range={{ time_range }}">{% endblock %}
{% block content %}
<div class="row">
<div class="col-sm-8" id="main_results">
@@ -41,6 +41,7 @@ {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="q" value="{{ q }}" />
<input type="hidden" name="pageno" value="{{ pageno+1 }}" />
+ <input type="hidden" name="time_range" value="{{ time_range }}" />
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
</form>
</div>
@@ -48,6 +49,7 @@ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="pageno" value="{{ pageno-1 }}" />
+ <input type="hidden" name="time_range" value="{{ time_range }}" />
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
</form>
</div>
@@ -60,6 +62,7 @@ <input type="hidden" name="q" value="{{ q }}" />
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="pageno" value="{{ pageno-1 }}" />
+ <input type="hidden" name="time_range" value="{{ time_range }}" />
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
</form>
</div>
@@ -68,6 +71,7 @@ {% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="q" value="{{ q }}" />
<input type="hidden" name="pageno" value="{{ pageno+1 }}" />
+ <input type="hidden" name="time_range" value="{{ time_range }}" />
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
</form>
</div>
@@ -118,7 +122,7 @@ <form role="form">
<div class="form-group">
<label for="search_url">{{ _('Search URL') }}</label>
- <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 %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}" readonly>
+ <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 %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if time_range %}&time_range={{ time_range }}{% endif %}" readonly>
</div>
</form>
@@ -130,6 +134,7 @@ <input type="hidden" name="format" value="{{ output_type }}">
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1">{% endfor %}
<input type="hidden" name="pageno" value="{{ pageno }}">
+ <input type="hidden" name="time_range" value="{{ time_range }}" />
<button type="submit" class="btn btn-default">{{ output_type }}</button>
</form>
{% endfor %}
diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html index e48c80fd5..6e0650a7c 100644 --- a/searx/templates/oscar/search.html +++ b/searx/templates/oscar/search.html @@ -6,7 +6,5 @@ <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>
</span>
</div>
- <div class="search_categories">
- {% include 'oscar/categories.html' %}
- </div><!-- / #search_categories -->
+ {% include 'oscar/advanced.html' %}
</form><!-- / #search_form_full -->
diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html index 26dae418c..4d16ef2dc 100644 --- a/searx/templates/oscar/search_full.html +++ b/searx/templates/oscar/search_full.html @@ -11,11 +11,8 @@ <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>
</span>
</div>
+ <div class="input-group col-md-8 col-md-offset-2">
+ {% include 'oscar/advanced.html' %}
+ </div>
- <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>
- <div class="row collapse active_if_nojs margin_top_if_nojs" id="search_categories">
- <div class="col-md-12 text-center">
- {% include 'oscar/categories.html' %}
- </div>
- </div><!-- / #search_categories -->
</form><!-- / #search_form_full -->
diff --git a/searx/templates/oscar/time-range.html b/searx/templates/oscar/time-range.html new file mode 100644 index 000000000..652107817 --- /dev/null +++ b/searx/templates/oscar/time-range.html @@ -0,0 +1,11 @@ +<!-- Time range --> +<div class="input-group"> + <input type="radio" id="time-range-anytime" name="time_range" value="" {{ "checked" if time_range=="" or not time_range else ""}}> + <label for="time-range-anytime" class="input-group-addon">Anytime</label> + <input type="radio" id="time-range-day" name="time_range" value="day" {{ "checked" if time_range=="day" else ""}}> + <label for="time-range-day" class="input-group-addon">Last day</label> + <input type="radio" id="time-range-week" name="time_range" value="week" {{ "checked" if time_range=="week" else ""}}> + <label for="time-range-week" class="input-group-addon">Last week</label> + <input type="radio" id="time-range-month" name="time_range" value="month" {{ "checked" if time_range=="month" else ""}}> + <label for="time-range-month" class="input-group-addon">Last month</label> +</div> |