on master help sign in
oscar template: add infobox
commitc36c935b03cc87ddfcac5ce3ded333be73387a7a authorThomas Pointhuber <thomas.pointhuber@gmx.at> dateSun 5 Oct 2014, 15:29 (12 years ago) parent517e57b
5 files changed+49−6
searx/static/oscar/css/oscar.min.css+2 searx/static/oscar/less/oscar/infobox.less+9 searx/static/oscar/less/oscar/oscar.less+2 searx/templates/oscar/infobox.html+28 searx/templates/oscar/results.html+8−6
searx/static/oscar/css/oscar.min.css+2
@@ -11,5 +11,7 @@ input[type=checkbox]:not(:checked)~.label_hide_if_not_checked{display:none}
1111.suggestion_item{margin:2px 5px}
1212.result_download{margin-right:5px}
1313#pagination{margin-top:30px;padding-bottom:50px}
14+.infobox .infobox_part{margin-bottom:20px}
15+.infobox .infobox_part:last-child{margin-bottom:0}
1416.search_categories{margin:10px 0;text-transform:capitalize}
1517.cursor-text{cursor:text !important}
searx/static/oscar/less/oscar/infobox.lessnew file+9
@@ -0,0 +1,9 @@
1+.infobox {
2+ .infobox_part {
3+ margin-bottom: 20px;
4+ }
5+
6+ .infobox_part:last-child {
7+ margin-bottom: 0;
8+ }
9+}
searx/static/oscar/less/oscar/oscar.less+2
@@ -4,6 +4,8 @@
44
55@import "results.less";
66
7+@import "infobox.less";
8+
79@import "search.less";
810
911@import "cursor.less";
searx/templates/oscar/infobox.htmlnew file+28
@@ -0,0 +1,28 @@
1+<div class="panel panel-default infobox">
2+ <div class="panel-heading">
3+ <h4 class="panel-title">{{ infobox.infobox }}</h4>
4+ </div>
5+ <div class="panel-body">
6+ {% if infobox.img_src %}<img class="img-responsive center-block infobox_part" src="{{ infobox.img_src }}" />{% endif %}
7+ {% if infobox.content %}<p class="infobox_part">{{ infobox.content }}</p>{% endif %}
8+
9+ {% if infobox.attributes %}
10+ <table class="table table-striped infobox_part">
11+ {% for attribute in infobox.attributes %}
12+ <tr>
13+ <td>{{ attribute.label }}</td>
14+ <td>{{ attribute.value }}</td>
15+ </tr>
16+ {% endfor %}
17+ </table>
18+ {% endif %}
19+
20+ {% if infobox.urls %}
21+ <div class="infobox_part">
22+ {% for url in infobox.urls %}
23+ <p class="btn btn-default btn-xs"><a href="{{ url.url }}">{{ url.title }}</a></p>
24+ {% endfor %}
25+ </div>
26+ {% endif %}
27+ </div>
28+</div>
searx/templates/oscar/results.html+8−6
@@ -47,9 +47,7 @@
4747 {% if suggestions %}
4848 <div class="panel panel-default">
4949 <div class="panel-heading">
50− <h4 class="panel-title">
51− <a data-toggle="collapse" data-parent="#accordion" href="#suggestions">{{ _('Suggestions') }}</a>
52− </h4>
50+ <h4 class="panel-title">{{ _('Suggestions') }}</h4>
5351 </div>
5452 <div class="panel-body">
5553 {% for suggestion in suggestions %}
@@ -64,9 +62,7 @@
6462
6563 <div class="panel panel-default">
6664 <div class="panel-heading">
67− <h4 class="panel-title">
68− <a data-toggle="collapse" data-parent="#accordion" href="#links">{{ _('Links') }}</a>
69− </h4>
65+ <h4 class="panel-title">{{ _('Links') }}</h4>
7066 </div>
7167 <div class="panel-body">
7268 <form role="form">
@@ -91,6 +87,12 @@
9187 </div>
9288 </div>
9389
90+ {% if infoboxes %}
91+ {% for infobox in infoboxes %}
92+ {% include 'oscar/infobox.html' %}
93+ {% endfor %}
94+ {% endif %}
95+
9496 </div><!-- /#sidebar_results -->
9597 </div>
9698{% endblock %}