summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2014-11-19 16:19:03 +0100
committerAdam Tauber <asciimoo@gmail.com>2014-11-19 16:19:03 +0100
commit075a5fe8985dcd3e675e7249755ab211da7a5ce4 (patch)
tree3b343fae9708407151932ff17f4434e8372be1f2 /searx/templates
parent1a81c20d738cdd760805ae597e611026ea007f3f (diff)
parent807db97690e8421c0995860ec9644a8bbe084cba (diff)
Merge pull request #127 from pointhi/template_oscar_map
Template oscar, add map support
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/courgette/result_templates/map.html13
-rw-r--r--searx/templates/default/result_templates/map.html13
-rw-r--r--searx/templates/oscar/base.html4
-rw-r--r--searx/templates/oscar/result_templates/default.html9
-rw-r--r--searx/templates/oscar/result_templates/images.html3
-rw-r--r--searx/templates/oscar/result_templates/map.html74
-rw-r--r--searx/templates/oscar/result_templates/torrent.html11
-rw-r--r--searx/templates/oscar/result_templates/videos.html13
8 files changed, 128 insertions, 12 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 807da84e7..6fde942ac 100644
--- a/searx/templates/oscar/base.html
+++ b/searx/templates/oscar/base.html
@@ -11,7 +11,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>
@@ -71,6 +72,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/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..3fe9b913c 100644
--- a/searx/templates/oscar/result_templates/default.html
+++ b/searx/templates/oscar/result_templates/default.html
@@ -1,8 +1,13 @@
-<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>
+{% from 'oscar/macros.html' import icon %}
+
+<h4 class="result_header">{% 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></h4>
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
+
+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
-{% 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 3ad48352a..91838cba0 100644
--- a/searx/templates/oscar/result_templates/images.html
+++ b/searx/templates/oscar/result_templates/images.html
@@ -11,9 +11,10 @@
</div>
<div class="modal-body">
<img class="img-responsive center-block" src="{{ result.img_src }}" alt="{{ result.title }}">
- {% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
+ {% if result.content %}<p class="result-content">{{ 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..531146dc6
--- /dev/null
+++ b/searx/templates/oscar/result_templates/map.html
@@ -0,0 +1,74 @@
+{% from 'oscar/macros.html' import icon %}
+
+<h4 class="result_header">{% 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></h4>
+
+{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
+
+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
+
+{% if (result.latitude and result.longitude) or result.boundingbox %}
+ <small> &bull; <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer" 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') }}">{{ icon('globe') }} {{ _('show map') }}</a></small>
+{% endif %}
+
+{% if result.osm and (result.osm.type and result.osm.id) %}
+ <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer searx_overpass_request" data-toggle="collapse" data-target="#result-overpass-{{ index }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}">{{ icon('map-marker') }} {{ _('show details') }}</a></small>
+{% endif %}
+
+{# {% if (result.latitude and result.longitude) %}
+ <small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer" data-toggle="collapse" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('map-marker') }} {{ _('show geodata') }}</a></small>
+{% endif %} #}
+
+<div class="container-fluid">
+
+{% if result.address %}
+<p class="row result-content result-adress col-xs-12 col-sm-5 col-md-4" itemscope itemtype="http://schema.org/PostalAddress">
+ {% if result.address.name %}
+ <strong itemprop="name">{{ result.address.name }}</strong><br/>
+ {% endif %}
+ {% if result.address.road %}
+ <span itemprop="streetAddress">
+ {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %}
+ {{ result.address.road }}
+ </span><br/>
+ {% endif %}
+ {% if result.address.locality %}
+ <span itemprop="addressLocality">{{ result.address.locality }}</span>
+ {% if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif %}
+ <br/>
+ {% endif %}
+ {% if result.address.country %}
+ <span itemprop="addressCountry">{{ result.address.country }}</span>
+ {% endif %}
+</p>
+{% endif %}
+
+{% if result.osm and (result.osm.type and result.osm.id) %}
+ <div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}">
+ <div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div>
+ <table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}">
+ <tr><th>key</th><th>value</th></tr>
+ </table>
+ </div>
+{% endif %}
+
+{# {% if (result.latitude and result.longitude) %}
+ <div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}">
+ <strong>Longitude:</strong> {{ result.longitude }} <br/>
+ <strong>Latitude:</strong> {{ result.latitude }}
+ </div>
+{% endif %} #}
+
+{% if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif %}
+
+</div>
+
+{% if (result.latitude and result.longitude) or result.boundingbox %}
+ <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..a234a176a 100644
--- a/searx/templates/oscar/result_templates/torrent.html
+++ b/searx/templates/oscar/result_templates/torrent.html
@@ -1,14 +1,17 @@
{% from 'oscar/macros.html' import icon %}
-<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>
+<h4 class="result_header">{% 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></h4>
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
-<p>{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span>, {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span></p>
+<p class="result-content">{{ icon('transfer') }} {{ _('Seeder') }} <span class="badge">{{ result.seed }}</span>, {{ _('Leecher') }} <span class="badge">{{ result.leech }}</span>
+<br/>
+<a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} magnet link</a></p>
-<p><a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} magnet link</a></p>
+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
-{% 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..0d6cf50aa 100644
--- a/searx/templates/oscar/result_templates/videos.html
+++ b/searx/templates/oscar/result_templates/videos.html
@@ -1,13 +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>
+{% from 'oscar/macros.html' import icon %}
+
+<h4 class="result_header">{% 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></h4>
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
-
+<small><a class="text-info" href="https://web.archive.org/web/{{ result.pretty_url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
+
<div class="container-fluid">
<div class="row">
- <img class="thumbnail col-xs-6 col-sm-4 col-md-4" src="{{ result.thumbnail|safe }}" />
- {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif %}
+ <img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ result.thumbnail|safe }}" />
+ {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
</div>
</div>
+<div class="clearfix"></div>
+
<span class="label label-default pull-right">{{ result.engine }}</span>
<p class="text-muted">{{ result.pretty_url }}</p>