From 10a24bdc2c3870f07ec62dd710841628d325aaf6 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Sun, 12 Feb 2017 15:06:01 +0100 Subject: [enh] add simple theme (WIP) --- searx/templates/simple/result_templates/code.html | 13 ++++ .../templates/simple/result_templates/default.html | 17 ++++++ .../templates/simple/result_templates/images.html | 4 ++ searx/templates/simple/result_templates/map.html | 71 ++++++++++++++++++++++ .../templates/simple/result_templates/torrent.html | 24 ++++++++ .../templates/simple/result_templates/videos.html | 15 +++++ 6 files changed, 144 insertions(+) create mode 100644 searx/templates/simple/result_templates/code.html create mode 100644 searx/templates/simple/result_templates/default.html create mode 100644 searx/templates/simple/result_templates/images.html create mode 100644 searx/templates/simple/result_templates/map.html create mode 100644 searx/templates/simple/result_templates/torrent.html create mode 100644 searx/templates/simple/result_templates/videos.html (limited to 'searx/templates/simple/result_templates') diff --git a/searx/templates/simple/result_templates/code.html b/searx/templates/simple/result_templates/code.html new file mode 100644 index 000000000..9db05311f --- /dev/null +++ b/searx/templates/simple/result_templates/code.html @@ -0,0 +1,13 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} +{%- if result.content %}{{ result.content|safe }}{% endif %}

+{%- if result.repository -%} +

{{ result.repository }}

+{%- endif -%} +
+ {{- result.codelines|code_highlighter(result.code_language)|safe -}} +
{{- '' -}} +{{- result_sub_footer(result, proxify) -}} +{{ result_footer(result) }} diff --git a/searx/templates/simple/result_templates/default.html b/searx/templates/simple/result_templates/default.html new file mode 100644 index 000000000..b29ca550f --- /dev/null +++ b/searx/templates/simple/result_templates/default.html @@ -0,0 +1,17 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} +{% if result.embedded -%} + +{%- endif %} +

+ {%- if result.content %}{{ result.content|safe }}{% endif -%} +

+{{- result_sub_footer(result, proxify) -}} +{% if result.embedded -%} + +{%- endif %} +{{- result_footer(result) }} diff --git a/searx/templates/simple/result_templates/images.html b/searx/templates/simple/result_templates/images.html new file mode 100644 index 000000000..f756acbe3 --- /dev/null +++ b/searx/templates/simple/result_templates/images.html @@ -0,0 +1,4 @@ +
+ {{ result.title|striptags }} + {{ result.parsed_url[0] }}://{{ result.parsed_url[1] }} +
diff --git a/searx/templates/simple/result_templates/map.html b/searx/templates/simple/result_templates/map.html new file mode 100644 index 000000000..1fe0c86ac --- /dev/null +++ b/searx/templates/simple/result_templates/map.html @@ -0,0 +1,71 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl, icon %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} + +{%- if (result.latitude and result.longitude) or result.boundingbox -%} + +{%- endif -%} + +{%- if result.osm and (result.osm.type and result.osm.id) -%} + +{%- endif -%} +{#- +{% if (result.latitude and result.longitude) %} + {{ icon('location') }} {{ _('show geodata') }} +{% endif %} +-#} + +{%- if result.address -%} +

+ {%- if result.address.name -%} + {{ result.address.name }}
+ {%- endif -%} + {% if result.address.road -%} + + {% if result.address.house_number %}{{ result.address.house_number }}, {% endif %} + {{ result.address.road }} +
+ {%- endif %} + {%- if result.address.locality -%} + {{ result.address.locality }} + {% if result.address.postcode %}, {{ result.address.postcode }}{% endif %} +
+ {%- endif -%} + {%- if result.address.country -%} + {{ result.address.country }} + {%- endif -%} +

+{%- endif -%} + +{%- if result.content %}

{{ result.content|safe }}

{% endif -%} + +{{- result_sub_footer(result, proxify) -}} + +{% if result.osm and (result.osm.type and result.osm.id) -%} + +{%- endif %} + +{#- +{% if (result.latitude and result.longitude) -%} + +{%- endif %} +-#} + +{% if (result.latitude and result.longitude) or result.boundingbox -%} + +{%- endif %} + +{{- result_footer(result) }} diff --git a/searx/templates/simple/result_templates/torrent.html b/searx/templates/simple/result_templates/torrent.html new file mode 100644 index 000000000..3c7fd15e8 --- /dev/null +++ b/searx/templates/simple/result_templates/torrent.html @@ -0,0 +1,24 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl, result_link %} + +{{ result_header(result, favicons, image_proxify) -}} +{{- result_sub_header(result) -}} + +{% if result.magnetlink %}{% endif %} +{% if result.torrentfile %}{% endif %} + +{% if result.seed %}

• {{ icon('arrow-swap') }} {{ _('Seeder') }} {{ result.seed }} • {{ _('Leecher') }} {{ result.leech }}

{% endif %} + +{%- if result.filesize %}

{{ icon('floppy-disk') }} {{ _('Filesize') }} + {%- if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }} + {%- elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }} + {%- elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }} + {%- elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }} + {%- else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif -%} +

+{%- endif -%} + +{%- if result.files %}

{{ icon('file') }} {{ _('Number of Files') }} {{ result.files }}

{% endif -%} + +{%- if result.content %}

{{ result.content|safe }}

{% endif -%} +{{- result_sub_footer(result, proxify) -}} +{{- result_footer(result) }} diff --git a/searx/templates/simple/result_templates/videos.html b/searx/templates/simple/result_templates/videos.html new file mode 100644 index 000000000..be270e932 --- /dev/null +++ b/searx/templates/simple/result_templates/videos.html @@ -0,0 +1,15 @@ +{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_footer_rtl %} + +{{ result_header(result, favicons, image_proxify) }} +{{ result_sub_header(result) }} +{% if result.embedded -%} + +{%- endif %} +{% if result.content %}

{{ result.content|safe }}

{% endif %} +{{- result_sub_footer(result, proxify) -}} +{% if result.embedded -%} + +{%- endif %} +{{ result_footer(result) }} -- cgit v1.2.3