Browse Source

oscar template: add infobox

Thomas Pointhuber 10 years ago
parent
commit
c36c935b03

+ 2
- 0
searx/static/oscar/css/oscar.min.css View File

11
 .suggestion_item{margin:2px 5px}
11
 .suggestion_item{margin:2px 5px}
12
 .result_download{margin-right:5px}
12
 .result_download{margin-right:5px}
13
 #pagination{margin-top:30px;padding-bottom:50px}
13
 #pagination{margin-top:30px;padding-bottom:50px}
14
+.infobox .infobox_part{margin-bottom:20px}
15
+.infobox .infobox_part:last-child{margin-bottom:0}
14
 .search_categories{margin:10px 0;text-transform:capitalize}
16
 .search_categories{margin:10px 0;text-transform:capitalize}
15
 .cursor-text{cursor:text !important}
17
 .cursor-text{cursor:text !important}

+ 9
- 0
searx/static/oscar/less/oscar/infobox.less View File

1
+.infobox {
2
+    .infobox_part {
3
+        margin-bottom: 20px;
4
+    }
5
+    
6
+    .infobox_part:last-child {
7
+        margin-bottom: 0;
8
+    }
9
+}

+ 2
- 0
searx/static/oscar/less/oscar/oscar.less View File

4
 
4
 
5
 @import "results.less";
5
 @import "results.less";
6
 
6
 
7
+@import "infobox.less";
8
+
7
 @import "search.less";
9
 @import "search.less";
8
 
10
 
9
 @import "cursor.less";
11
 @import "cursor.less";

+ 28
- 0
searx/templates/oscar/infobox.html View File

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>

+ 8
- 6
searx/templates/oscar/results.html View File

47
             {% if suggestions %}
47
             {% if suggestions %}
48
             <div class="panel panel-default">
48
             <div class="panel panel-default">
49
                 <div class="panel-heading">
49
                 <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>
53
                 </div>
51
                 </div>
54
                 <div class="panel-body">
52
                 <div class="panel-body">
55
                     {% for suggestion in suggestions %}
53
                     {% for suggestion in suggestions %}
64
 
62
 
65
             <div class="panel panel-default">
63
             <div class="panel panel-default">
66
                 <div class="panel-heading">
64
                 <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>
70
                 </div>
66
                 </div>
71
                 <div class="panel-body">
67
                 <div class="panel-body">
72
                     <form role="form">
68
                     <form role="form">
91
                 </div>
87
                 </div>
92
             </div>
88
             </div>
93
         
89
         
90
+        {% if infoboxes %}
91
+            {% for infobox in infoboxes %}
92
+                {% include 'oscar/infobox.html' %}
93
+            {% endfor %}
94
+        {% endif %}    
95
+        
94
         </div><!-- /#sidebar_results -->
96
         </div><!-- /#sidebar_results -->
95
     </div>
97
     </div>
96
 {% endblock %}
98
 {% endblock %}