From d70f0a3321b32816c0f277b4be9a43e4f1074b39 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 24 Apr 2025 17:28:16 +0200 Subject: [feat] result types: add weather result answerer and template --- searx/templates/simple/answer/weather.html | 67 ++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 searx/templates/simple/answer/weather.html (limited to 'searx/templates') diff --git a/searx/templates/simple/answer/weather.html b/searx/templates/simple/answer/weather.html new file mode 100644 index 000000000..4cea9b683 --- /dev/null +++ b/searx/templates/simple/answer/weather.html @@ -0,0 +1,67 @@ +{% macro show_weather_data(data) %} + + + {%- if data.condition -%} + + + + + {%- endif -%} + {%- if data.temperature -%} + + + + + {%- endif -%} + {%- if data.feelsLike -%} + + + + + {%- endif -%} + {%- if data.wind -%} + + + + + {%- endif -%} + {%- if data.humidity -%} + + + + + {%- endif -%} + {%- if data.pressure -%} + + + + + {%- endif -%} + + {%- for name, value in data.attributes.items() -%} + + + + + {%- endfor -%} + +
{{ _("Condition") }}{{ data.condition }}
{{ _("Temperature") }}{{ data.temperature }}
{{ _("Feels Like") }}{{ data.feelsLike }}
{{ _("Wind") }}{{ data.wind }}
{{ _("Humidity") }}{{ data.humidity }}
{{ _("Pressure") }}{{ data.pressure }}
{{ name }}{{ value }}
+{% endmacro %} + +
+ It's currently {{ answer.current.condition }}, {{ answer.current.temperature }} in {{ answer.location }} +
+

{{ answer.location }}

+

{{ _("Current condition") }}

+ {{ show_weather_data(answer.current) }} + + {%- if answer.forecasts -%} +
+ {%- for forecast in answer.forecasts -%} +

{{ forecast.time }}

+ {{ show_weather_data(forecast) }} + {%- endfor -%} +
+ {%- endif -%} +
+
-- cgit v1.2.3