diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2023-04-23 13:19:21 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2023-05-28 12:19:32 +0200 |
| commit | b7e315563d2401e6fb659fcfcb361e6d5bb915d5 (patch) | |
| tree | 722dd54802c9533ce6ae13fb1b271bee67d45be6 /searx/templates/simple/elements/infobox.html | |
| parent | 79c02456c1a852ecab5548a840d09e9642565615 (diff) | |
[mod] simple theme: collaps/expand elements in the sidebar
Make elements in the sidebar collapse able. Except infoboxes all elements in
the sidebar are collapsed by default.
By folding out the sidebar elements, the UI looks less cluttered. Especially on
small devices like smartphones, where the sidebar is above the results list, the
UX should be improved [1].
[1] https://github.com/searxng/searxng/issues/2140
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/templates/simple/elements/infobox.html')
| -rw-r--r-- | searx/templates/simple/elements/infobox.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/searx/templates/simple/elements/infobox.html b/searx/templates/simple/elements/infobox.html new file mode 100644 index 000000000..68fd32559 --- /dev/null +++ b/searx/templates/simple/elements/infobox.html @@ -0,0 +1,48 @@ +<aside class="infobox" aria-label="{{ infobox.infobox }}"> + <h2 class="title"><bdi>{{ infobox.infobox }}</bdi></h2> + {%- if infobox.img_src -%}<img src="{{ image_proxify(infobox.img_src) }}" title="{{ infobox.infobox|striptags }}" alt="{{ infobox.infobox|striptags }}">{%- endif -%} + <p><bdi>{{ infobox.content | safe }}</bdi></p> + {%- if infobox.attributes -%} + <div class="attributes"> + {%- for attribute in infobox.attributes -%} + <dl> + <dt><bdi>{{ attribute.label }} :</bdi></dt> + {%- if attribute.image -%} + <dd><img src="{{ image_proxify(attribute.image.src) }}" alt="{{ attribute.image.alt }}"></dd> + {%- else -%} + <dd><bdi>{{ attribute.value }}</bdi></dd> + {%- endif -%} + </dl> + {%- endfor -%} + </div> + {%- endif -%} + {%- if infobox.urls -%} + <div class="urls"> + <ul> + {%- for url in infobox.urls -%} + <li class="url"><bdi><a href="{{ url.url }}" {%- if results_on_new_tab -%}target="_blank" rel="noopener noreferrer"{%- else -%}rel="noreferrer"{%- endif -%}>{{ url.title }}</a></bdi></li> + {%- endfor -%} + </ul> + </div> + {%- endif -%} + {%- if infobox.relatedTopics -%} + <div class="relatedTopics"> + {%- for topic in infobox.relatedTopics -%} + <div> + <h3><bdi>{{ topic.name }}</bdi></h3> + {%- for suggestion in topic.suggestions -%} + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> + <input type="hidden" name="q" value="{{ suggestion }}"> + <input type="hidden" name="time_range" value="{{ time_range }}"> + <input type="hidden" name="language" value="{{ current_language }}"> + <input type="hidden" name="safesearch" value="{{ safesearch }}"> + <input type="hidden" name="theme" value="{{ theme }}"> + {%- if timeout_limit -%}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{%- endif -%} + <input type="submit" value="{{ suggestion }}" /> + </form> + {%- endfor -%} + </div> + {%- endfor -%} + </div> + {%- endif -%} +</aside> |