From 7adb17452d8c845f46858b4cebe8198988edfdbc Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Sat, 20 Dec 2014 23:33:03 +0100 Subject: [enh] add result_templates/code.html --- searx/templates/oscar/result_templates/code.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 searx/templates/oscar/result_templates/code.html (limited to 'searx/templates/oscar/result_templates') diff --git a/searx/templates/oscar/result_templates/code.html b/searx/templates/oscar/result_templates/code.html new file mode 100644 index 000000000..d9079a464 --- /dev/null +++ b/searx/templates/oscar/result_templates/code.html @@ -0,0 +1,17 @@ +{% from 'oscar/macros.html' import icon %} + +

{% if result['favicon'] %}{{ result['favicon'] }} {% endif %}{{ result.title|safe }}

+ +{% if result.publishedDate %}{% endif %} +{{ icon('link') }} {{ _('cached') }} + +{% if result.content %}

{{ result.content|safe }}

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

{{ icon('file') }} {{ result.repository }}

{% endif %} + +{{ result.codelines|code_highlighter(result.code_language)|safe }} + +
+ +{{ result.engine }} +

{{ result.pretty_url }}

-- cgit v1.2.3 From d810763107733cec017b8688c0350dff527f2ed1 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Mon, 22 Dec 2014 16:07:02 +0100 Subject: [enh] remove repeating codeparts inside the oscar template --- searx/templates/oscar/result_templates/code.html | 13 ++++--------- searx/templates/oscar/result_templates/default.html | 13 ++++--------- searx/templates/oscar/result_templates/images.html | 4 +++- searx/templates/oscar/result_templates/map.html | 14 ++++---------- searx/templates/oscar/result_templates/torrent.html | 13 ++++--------- searx/templates/oscar/result_templates/videos.html | 13 ++++--------- 6 files changed, 23 insertions(+), 47 deletions(-) (limited to 'searx/templates/oscar/result_templates') diff --git a/searx/templates/oscar/result_templates/code.html b/searx/templates/oscar/result_templates/code.html index d9079a464..236834d0a 100644 --- a/searx/templates/oscar/result_templates/code.html +++ b/searx/templates/oscar/result_templates/code.html @@ -1,9 +1,7 @@ -{% from 'oscar/macros.html' import icon %} +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer, icon %} -

{% if result['favicon'] %}{{ result['favicon'] }} {% endif %}{{ result.title|safe }}

- -{% if result.publishedDate %}{% endif %} -{{ icon('link') }} {{ _('cached') }} +{{ result_header(result) }} +{{ result_sub_header(result) }} {% if result.content %}

{{ result.content|safe }}

{% endif %} @@ -11,7 +9,4 @@ {{ result.codelines|code_highlighter(result.code_language)|safe }} -
- -{{ result.engine }} -

{{ result.pretty_url }}

+{{ result_footer(result) }} diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index 0f090d862..bc967f01e 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -1,13 +1,8 @@ -{% from 'oscar/macros.html' import icon %} +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer %} -

{% if result['favicon'] %}{{ result['favicon'] }} {% endif %}{{ result.title|safe }}

- -{% if result.publishedDate %}{% endif %} -{{ icon('link') }} {{ _('cached') }} +{{ result_header(result) }} +{{ result_sub_header(result) }} {% if result.content %}

{{ result.content|safe }}

{% endif %} -
- -{{ result.engine }} -

{{ result.pretty_url }}

+{{ result_footer(result) }} diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html index 7689f9f58..69c2e6fff 100644 --- a/searx/templates/oscar/result_templates/images.html +++ b/searx/templates/oscar/result_templates/images.html @@ -1,3 +1,5 @@ +{% from 'oscar/macros.html' import draw_favicon %} + {{ result.title|striptags }} @@ -7,7 +9,7 @@