mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 10:32:21 +02:00
[mod] typification of SearXNG: add new result type KeyValue
This patch adds a new result type: KeyValue - Python class: searx/result_types/keyvalue.py - Jinja template: searx/templates/simple/result_templates/keyvalue.html - CSS (less) client/simple/src/less/result_types/keyvalue.less Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
8769b7c6d6
commit
af5dbdf768
8 changed files with 127 additions and 1 deletions
21
searx/templates/simple/result_templates/keyvalue.html
Normal file
21
searx/templates/simple/result_templates/keyvalue.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<article class="result result-keyvalue {% if result.category -%}category-{{ result.category }}{%- endif -%}">
|
||||
<table>
|
||||
{%- if result.caption %}<caption>{{ result.caption }}</caption>{%- endif -%}
|
||||
{%- if result.key_title or result.value_title %}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-key" scope="col" >{{result.key_title}}</th>
|
||||
<th class="col-value" scope="col" >{{result.value_title}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{%- endif -%}
|
||||
{%- for key, value in result.kvmap.items() -%}
|
||||
<tr class="{{ loop.cycle('odd', 'even') }}">
|
||||
<th class="col-key" scope="row">{{ key }}</th>{{- '' -}}
|
||||
<td class="col-value">{{ value }}</td>{{- '' -}}
|
||||
</tr>
|
||||
{%- endfor -%}
|
||||
</table>{{- '' -}}
|
||||
<div class="engines">{% for engine in result.engines %}<span>{{ engine }}</span>{% endfor %}</div>{{- '' -}}
|
||||
<div class="break"></div>{{- '' -}}
|
||||
</article>
|
Loading…
Add table
Add a link
Reference in a new issue