mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 18:42:33 +02:00
[enh] oscar_template: initial osm-map support for map results
* TODO: remove leaflet.min.css if not required
This commit is contained in:
parent
b4829891f9
commit
740594a4b7
18 changed files with 268 additions and 4 deletions
13
searx/templates/courgette/result_templates/map.html
Normal file
13
searx/templates/courgette/result_templates/map.html
Normal file
|
@ -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>
|
13
searx/templates/default/result_templates/map.html
Normal file
13
searx/templates/default/result_templates/map.html
Normal file
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
18
searx/templates/oscar/result_templates/map.html
Normal file
18
searx/templates/oscar/result_templates/map.html
Normal file
|
@ -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>
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue