on master help sign in
[Fix] oscar: move info box at top of the page

In low width devices like mobile, tablet etc, info box is present at bottom of the page. This change addresses the issue by rearranging column grids for low width devices and move side bar at top of the page. See - https://getbootstrap.com/docs/3.3/css/#grid-column-ordering. - and Searx issue tracker (issue#1777), for more information. Effect: Along with Info, Suggestion and Link boxes also move to top of the page. Resolves: #1777

commit36ca2dcc56651688cd7ca8b8d925a9370bdc1dec authorVipul <finn02@disroot.org> dateFri 20 Dec 2019, 23:34 (7 years ago) parentda56bda
1 file changed+62−62
searx/templates/oscar/results.html+62−62
searx/templates/oscar/results.html+62−62
@@ -15,7 +15,68 @@
1515 {% include 'oscar/search.html' %}
1616
1717 <div class="row">
18− <div class="col-sm-8" id="main_results">
18+ <div class="col-sm-4 col-sm-push-8" id="sidebar_results">
19+ {% if number_of_results != '0' -%}
20+ <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
21+ {%- endif %}
22+
23+ {% if unresponsive_engines and results|length >= 1 -%}
24+ <div class="alert alert-danger fade in" role="alert">
25+ <p>{{ _('Engines cannot retrieve results') }}:</p>
26+ {%- for engine_name, error_type in unresponsive_engines -%}
27+ {{- engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}{{- "" -}}
28+ {%- endfor -%}
29+ </div>
30+ {%- endif %}
31+
32+ {% if infoboxes -%}
33+ {% for infobox in infoboxes %}
34+ {% include 'oscar/infobox.html' %}{{- "\n\n" -}}
35+ {% endfor %}
36+ {%- endif %}
37+
38+ {% if suggestions %}
39+ <div class="panel panel-default">
40+ <div class="panel-heading">
41+ <h4 class="panel-title">{{ _('Suggestions') }}</h4>
42+ </div>
43+ <div class="panel-body">
44+ {% for suggestion in suggestions %}
45+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
46+ <input type="hidden" name="q" value="{{ suggestion.url }}">
47+ <button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button>
48+ </form>
49+ {% endfor %}
50+ </div>
51+ </div>
52+ {%- endif %}
53+
54+ <div class="panel panel-default">
55+ <div class="panel-heading">{{- "" -}}
56+ <h4 class="panel-title">{{ _('Links') }}</h4>{{- "" -}}
57+ </div>
58+ <div class="panel-body">
59+ <form role="form">{{- "" -}}
60+ <div class="form-group">{{- "" -}}
61+ <label for="search_url">{{ _('Search URL') }}</label>{{- "" -}}
62+ <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>{{- "" -}}
63+ </div>{{- "" -}}
64+ </form>
65+ <label>{{ _('Download results') }}</label>
66+ <div class="clearfix"></div>
67+ {% for output_type in ('csv', 'json', 'rss') %}
68+ <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
69+ {{- search_form_attrs(pageno) -}}
70+ <input type="hidden" name="format" value="{{ output_type }}">{{- "" -}}
71+ <button type="submit" class="btn btn-default">{{ output_type }}</button>{{- "" -}}
72+ </form>
73+ {% endfor %}
74+ <div class="clearfix"></div>
75+ </div>
76+ </div>
77+ </div><!-- /#sidebar_results -->
78+
79+ <div class="col-sm-8 col-sm-pull-4" id="main_results">
1980 <h1 class="sr-only">{{ _('Search results') }}</h1>
2081
2182 {% if corrections -%}
@@ -91,66 +152,5 @@
91152 {% endif %}
92153 {% endif %}
93154 </div><!-- /#main_results -->
94−
95− <div class="col-sm-4" id="sidebar_results">
96− {% if number_of_results != '0' -%}
97− <p><small>{{ _('Number of results') }}: {{ number_of_results }}</small></p>
98− {%- endif %}
99−
100− {% if unresponsive_engines and results|length >= 1 -%}
101− <div class="alert alert-danger fade in" role="alert">
102− <p>{{ _('Engines cannot retrieve results') }}:</p>
103− {%- for engine_name, error_type in unresponsive_engines -%}
104− {{- engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}{{- "" -}}
105− {%- endfor -%}
106− </div>
107− {%- endif %}
108−
109− {% if infoboxes -%}
110− {% for infobox in infoboxes %}
111− {% include 'oscar/infobox.html' %}{{- "\n\n" -}}
112− {% endfor %}
113− {%- endif %}
114−
115− {% if suggestions %}
116− <div class="panel panel-default">
117− <div class="panel-heading">
118− <h4 class="panel-title">{{ _('Suggestions') }}</h4>
119− </div>
120− <div class="panel-body">
121− {% for suggestion in suggestions %}
122− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
123− <input type="hidden" name="q" value="{{ suggestion.url }}">
124− <button type="submit" class="btn btn-default btn-xs">{{ suggestion.title }}</button>
125− </form>
126− {% endfor %}
127− </div>
128− </div>
129− {%- endif %}
130−
131− <div class="panel panel-default">
132− <div class="panel-heading">{{- "" -}}
133− <h4 class="panel-title">{{ _('Links') }}</h4>{{- "" -}}
134− </div>
135− <div class="panel-body">
136− <form role="form">{{- "" -}}
137− <div class="form-group">{{- "" -}}
138− <label for="search_url">{{ _('Search URL') }}</label>{{- "" -}}
139− <input id="search_url" type="url" class="form-control select-all-on-click cursor-text" name="search_url" value="{{ search_url() }}" readonly>{{- "" -}}
140− </div>{{- "" -}}
141− </form>
142− <label>{{ _('Download results') }}</label>
143− <div class="clearfix"></div>
144− {% for output_type in ('csv', 'json', 'rss') %}
145− <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} result_download">
146− {{- search_form_attrs(pageno) -}}
147− <input type="hidden" name="format" value="{{ output_type }}">{{- "" -}}
148− <button type="submit" class="btn btn-default">{{ output_type }}</button>{{- "" -}}
149− </form>
150− {% endfor %}
151− <div class="clearfix"></div>
152− </div>
153− </div>
154− </div><!-- /#sidebar_results -->
155155 </div>
156156{% endblock %}