diff options
author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2014-11-02 13:00:28 +0100 |
---|---|---|
committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2014-11-02 13:00:28 +0100 |
commit | 740594a4b73952ad3f5fa52dd1bb939c73dcc7c2 (patch) | |
tree | 07966947a2c61b7de99b9c52cd1bd4eebcc85759 /searx/templates | |
parent | b4829891f93515c7d19af2472a855eccd7807c4a (diff) | |
download | searxng-740594a4b73952ad3f5fa52dd1bb939c73dcc7c2.tar.gz searxng-740594a4b73952ad3f5fa52dd1bb939c73dcc7c2.zip |
[enh] oscar_template: initial osm-map support for map results
* TODO: remove leaflet.min.css if not required
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/courgette/result_templates/map.html | 13 | ||||
-rw-r--r-- | searx/templates/default/result_templates/map.html | 13 | ||||
-rw-r--r-- | searx/templates/oscar/base.html | 6 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/default.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/images.html | 1 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/map.html | 18 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/torrent.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/videos.html | 2 |
8 files changed, 55 insertions, 2 deletions
diff --git a/searx/templates/courgette/result_templates/map.html b/searx/templates/courgette/result_templates/map.html new file mode 100644 index 000000000..734f9066c --- /dev/null +++ b/searx/templates/courgette/result_templates/map.html @@ -0,0 +1,13 @@ +<div class="result {{ result.class }}"> + + {% if result['favicon'] %} + <img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" /> + {% endif %} + + <div> + <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3> + {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %} + <p class="content">{% if result.content %}{{ result.content|safe }}<br />{% endif %}</p> + <p class="url">{{ result.pretty_url }}</p> + </div> +</div> diff --git a/searx/templates/default/result_templates/map.html b/searx/templates/default/result_templates/map.html new file mode 100644 index 000000000..78221aa01 --- /dev/null +++ b/searx/templates/default/result_templates/map.html @@ -0,0 +1,13 @@ +<div class="result {{ result.class }}"> + + {% if result['favicon'] %} + <img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" /> + {% endif %} + + <div> + <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3> + <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p> + {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %} + <p class="content">{% if result.img_src %}<img src="{{ result.img_src }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p> + </div> +</div> diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index 544820060..8c4dd3edc 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -10,7 +10,8 @@ <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" /> <link rel="stylesheet" href="{{ url_for('static', filename='css/oscar.min.css') }}" type="text/css" /> - + <link rel="stylesheet" href="{{ url_for('static', filename='css/leaflet.min.css') }}" type="text/css" /> + <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="{{ url_for('static', filename='js/html5shiv.min.js') }}"></script> @@ -64,6 +65,7 @@ <script src="{{ url_for('static', filename='js/jquery-1.11.1.min.js') }}"></script> <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script> {% if autocomplete %}<script src="{{ url_for('static', filename='js/typeahead.bundle.min.js') }}"></script>{% endif %} - <script src="{{ url_for('static', filename='js/scripts.js') }}"></script> + <script src="{{ url_for('static', filename='js/require-2.1.15.min.js') }}"></script> + <script src="{{ url_for('static', filename='js/scripts.js') }}"></script>--> </body> </html> diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index 3b0963816..018a29e0e 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -4,5 +4,7 @@ {% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
+<div class="clearfix"></div>
+
<span class="label label-default pull-right">{{ result.engine }}</span>
<p class="text-muted">{{ result.pretty_url }}</p>
diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html index 5570a3143..578df4595 100644 --- a/searx/templates/oscar/result_templates/images.html +++ b/searx/templates/oscar/result_templates/images.html @@ -14,6 +14,7 @@ {% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
</div>
<div class="modal-footer">
+ <div class="clearfix"></div>
<span class="label label-default pull-right">{{ result.engine }}</span>
<p class="text-muted pull-left">{{ result.pretty_url }}</p>
<div class="clearfix"></div>
diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html new file mode 100644 index 000000000..3385f5ba7 --- /dev/null +++ b/searx/templates/oscar/result_templates/map.html @@ -0,0 +1,18 @@ +<h3>{% if result['favicon'] %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result['favicon'] }}.png" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
+
+{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
+
+{% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
+
+{% if result.latitude and result.longitude %}
+ <button type="button" class="btn btn-default btn-collapse collapsed searx_init_map" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('Show Map') }}" data-btn-text-not-collapsed="{{ _('Hide Map') }}">{{ _('Show Map') }}</button>
+
+ <div class="collapse" id="result-map-{{ index }}">
+ <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
+ </div>
+{% endif %}
+
+<div class="clearfix"></div>
+
+<span class="label label-default pull-right">{{ result.engine }}</span>
+<p class="text-muted">{{ result.pretty_url }}</p>
diff --git a/searx/templates/oscar/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html index 903d304eb..1be66e75a 100644 --- a/searx/templates/oscar/result_templates/torrent.html +++ b/searx/templates/oscar/result_templates/torrent.html @@ -10,5 +10,7 @@ {% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
+<div class="clearfix"></div>
+
<span class="label label-default pull-right">{{ result.engine }}</span>
<p class="text-muted">{{ result.pretty_url }}</p>
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html index 1a9b60717..4d711ea71 100644 --- a/searx/templates/oscar/result_templates/videos.html +++ b/searx/templates/oscar/result_templates/videos.html @@ -9,5 +9,7 @@ </div>
</div>
+<div class="clearfix"></div>
+
<span class="label label-default pull-right">{{ result.engine }}</span>
<p class="text-muted">{{ result.pretty_url }}</p>
|