diff options
author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2014-11-03 10:39:47 +0100 |
---|---|---|
committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2014-11-03 10:39:47 +0100 |
commit | 2e7723a6c1ce51c6b3830470164ac818126760ae (patch) | |
tree | ac7839a2f53bbf993704f13da734826a3ad23ee9 /searx/templates | |
parent | b2c976a5a33f234de1f5c67de0e04034c21c20d8 (diff) | |
download | searxng-2e7723a6c1ce51c6b3830470164ac818126760ae.tar.gz searxng-2e7723a6c1ce51c6b3830470164ac818126760ae.zip |
[enh] oscar_template: improve result visualisation
* highlight parts of result
* add link to archiv.to
* fix little bugs
* add little icons
* change style of "show map" button
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/oscar/base.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/default.html | 7 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/images.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/map.html | 16 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/torrent.html | 5 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/videos.html | 9 |
6 files changed, 26 insertions, 15 deletions
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index 8c4dd3edc..0acece9d2 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -66,6 +66,6 @@ <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>--> + <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 018a29e0e..3fe9b913c 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -1,8 +1,11 @@ -<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>{{ result.content|safe }}</p>{% endif %}
+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
<div class="clearfix"></div>
diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html index 578df4595..c1b9e9b01 100644 --- a/searx/templates/oscar/result_templates/images.html +++ b/searx/templates/oscar/result_templates/images.html @@ -11,7 +11,7 @@ </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>
diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index 3385f5ba7..45aa76356 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -1,12 +1,16 @@ -<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 %}
-{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.publishedDate }}" pubdate>{{ result.publishedDate }}</time>{% endif %}
-
-{% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
+<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.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>
+{% 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> • <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.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
+{% 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>
diff --git a/searx/templates/oscar/result_templates/torrent.html b/searx/templates/oscar/result_templates/torrent.html index 1be66e75a..60d8f2987 100644 --- a/searx/templates/oscar/result_templates/torrent.html +++ b/searx/templates/oscar/result_templates/torrent.html @@ -1,14 +1,15 @@ {% 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><a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} magnet link</a></p>
-{% if result.content %}<p>{{ result.content|safe }}</p>{% endif %}
+{% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
<div class="clearfix"></div>
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html index 4d711ea71..f69134d6f 100644 --- a/searx/templates/oscar/result_templates/videos.html +++ b/searx/templates/oscar/result_templates/videos.html @@ -1,11 +1,14 @@ -<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 %}
+ {% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
</div>
</div>
|