summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-10-13 09:28:42 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-10-20 10:18:33 +0200
commit937165853185ca16b0da6f72bc42bd1487ea0dcb (patch)
tree70da1dce7cb51d0f59cd36392103e8f33318f379 /client
parentee6d4f322f4bda18759ffb99380a06923424695b (diff)
[mod] typification of SearXNG: add new result type File
This PR adds a new result type: File Python class: searx/result_types/file.py Jinja template: searx/templates/simple/result_templates/file.html CSS (less) client/simple/src/less/result_types/file.less Class 'File' (singular) replaces template 'files.html' (plural). The renaming was carried out because there is only one file (singular) in a result. Not to be confused with the category 'files' where in multiple results can exist. As mentioned in issue [1], the class '.category-files' was removed from the CSS and the stylesheet was adopted in result_types/file.less (there based on the templates and no longer based on the category). [1] https://github.com/searxng/searxng/issues/5198 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'client')
-rw-r--r--client/simple/src/less/result_types/file.less22
-rw-r--r--client/simple/src/less/style.less3
2 files changed, 23 insertions, 2 deletions
diff --git a/client/simple/src/less/result_types/file.less b/client/simple/src/less/result_types/file.less
new file mode 100644
index 000000000..178a09f7a
--- /dev/null
+++ b/client/simple/src/less/result_types/file.less
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+/*
+ Layout of the Files result class
+*/
+
+#main_results .result-file {
+ border: 1px solid var(--color-result-border);
+ margin: 0 @results-tablet-offset 1rem @results-tablet-offset !important;
+ .rounded-corners;
+
+ video {
+ width: 100%;
+ aspect-ratio: 16 / 9;
+ padding: 10px 0 0 0;
+ }
+
+ audio {
+ width: 100%;
+ padding: 10px 0 0 0;
+ }
+}
diff --git a/client/simple/src/less/style.less b/client/simple/src/less/style.less
index 027e8d2bf..e751b7813 100644
--- a/client/simple/src/less/style.less
+++ b/client/simple/src/less/style.less
@@ -163,7 +163,6 @@ article[data-vim-selected].category-videos,
article[data-vim-selected].category-news,
article[data-vim-selected].category-map,
article[data-vim-selected].category-music,
-article[data-vim-selected].category-files,
article[data-vim-selected].category-social {
border: 1px solid var(--color-result-vim-arrow);
.rounded-corners;
@@ -387,7 +386,6 @@ article[data-vim-selected].category-social {
.category-news,
.category-map,
.category-music,
-.category-files,
.category-social {
border: 1px solid var(--color-result-border);
margin: 0 @results-tablet-offset 1rem @results-tablet-offset !important;
@@ -1168,3 +1166,4 @@ pre code {
@import "result_types/keyvalue.less";
@import "result_types/code.less";
@import "result_types/paper.less";
+@import "result_types/file.less";