summaryrefslogtreecommitdiff
path: root/searx/templates/simple/result_templates
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-09-10 16:10:42 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-09-20 10:56:46 +0200
commit7eedd44f5f9965cf2fbff14d276f96944b5c6a98 (patch)
treeaf9e32c177fb8de237b605b1fc4160157707c862 /searx/templates/simple/result_templates
parent57ef342ad11eae84629b9c1e889d2b9aa212efeb (diff)
[mod] typification of SearXNG: add new result type Paper
This patch adds a new result type: Paper - Python class: searx/result_types/paper.py - Jinja template: searx/templates/simple/result_templates/paper.html - CSS (less) client/simple/src/less/result_types/paper.less Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/templates/simple/result_templates')
-rw-r--r--searx/templates/simple/result_templates/paper.html102
1 files changed, 80 insertions, 22 deletions
diff --git a/searx/templates/simple/result_templates/paper.html b/searx/templates/simple/result_templates/paper.html
index 7e94cf174..074ad9081 100644
--- a/searx/templates/simple/result_templates/paper.html
+++ b/searx/templates/simple/result_templates/paper.html
@@ -1,34 +1,92 @@
{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer, result_link with context %}
-{{ result_header(result, favicons, image_proxify) -}}
+{{ result_header(result, favicons, image_proxify) }}
+
<div class="attributes">
- {%- if result.publishedDate %}<div class="result_publishedDate"><span>{{ _("Published date") }}:</span><span><time class="published_date" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time></span></div>{% endif -%}
- {%- if result.authors %}<div class="result_authors"><span>{{ _("Author") }}:</span><span>{{ result.authors | join(", ") }}</span></div>{% endif -%}
+ {%- if result.date_of_publication %}
+ <div>
+ <span>{{ _("Published date") }}:</span>
+ <span>{{ result.date_of_publication.l10n_date("long", "UI") }}</span>
+ </div>
+ {% endif -%}
+ {%- if result.authors %}
+ <div>
+ <span>{{ _("Author") }}:</span>
+ <span>{{ result.authors | join(", ") }}</span>
+ </div>
+ {% endif -%}
{%- if result.journal -%}
- <div class="result_journal">
- <span>{{- _("Journal") }}:</span><span>{{ result.journal -}}
- {%- if result.volume -%}
- &nbsp;{{- result.volume -}}
- {%- if result.number -%}
- .{{- result.number -}}
+ <div>
+ <span>{{- _("Journal") }}:</span>
+ <span>{{ result.journal -}}
+ {%- if result.volume -%}
+ &nbsp;{{- result.volume -}}
+ {%- if result.number -%}.{{- result.number -}}{%- endif -%}
{%- endif -%}
- {%- endif -%}
- {%- if result.pages -%}
- &nbsp;{{- result.pages -}}
- {%- endif -%}
+ {%- if result.pages -%}&nbsp;{{- result.pages -}}{%- endif -%}
</span>
</div>
{%- endif %}
- {%- if result.editor %}<div class="result_editor"><span>{{ _("Editor") }}:</span><span>{{ result.editor }}</span></div>{% endif -%}
- {%- if result.publisher %}<div class="result_publisher"><span>{{ _("Publisher") }}:</span><span>{{ result.publisher }}</span></div>{% endif -%}
- {%- if result.type %}<div class="result_type"><span>{{ _("Type") }}:</span><span>{{ result.type }}</span></div>{% endif -%}
- {%- if result.tags %}<div class="result_tags"><span>{{ _("Tags") }}:</span><span>{{ result.tags | join(", ")}}</span></div>{%- endif -%}
- {%- if result.doi %}<div class="result_doi"><span>{{ _("DOI") }}:</span><span>{{ result_link(doi_resolver + result.doi, result.doi) }}</span></div>{% endif -%}
- {%- if result.issn %}<div class="result_issn"><span>{{ _("ISSN") }}:</span><span>{{ result.issn | join(", ") }}</span></div>{% endif -%}
- {%- if result.isbn %}<div class="result_isbn"><span>{{ _("ISBN") }}:</span><span>{{ result.isbn | join(", ") }}</span></div>{% endif -%}
+ {%- if result.editor %}
+ <div>
+ <span>{{ _("Editor") }}:</span>
+ <span>{{ result.editor }}</span>
+ </div>
+ {% endif -%}
+ {%- if result.publisher %}
+ <div>
+ <span>{{ _("Publisher") }}:</span>
+ <span>{{ result.publisher }}</span>
+ </div>
+ {% endif -%}
+ {%- if result.type %}
+ <div>
+ <span>{{ _("Type") }}:</span>
+ <span>{{ result.type }}</span>
+ </div>
+ {% endif -%}
+ {%- if result.tags %}
+ <div>
+ <span>{{ _("Tags") }}:</span>
+ <span>{{ result.tags | join(", ")}}</span>
+ </div>
+ {%- endif -%}
+ {%- if result.doi %}
+ <div>
+ <span>{{ _("DOI") }}:</span>
+ <span>{{ result_link(doi_resolver + result.doi, result.doi) }}</span>
+ </div>
+ {% endif -%}
+ {%- if result.issn %}
+ <div>
+ <span>{{ _("ISSN") }}:</span>
+ <span>{{ result.issn | join(", ") }}</span>
+ </div>
+ {% endif -%}
+ {%- if result.isbn %}
+ <div class="result_isbn">
+ <span>{{ _("ISBN") }}:</span>
+ <span>{{ result.isbn | join(", ") }}</span>
+ </div>
+ {% endif -%}
+ {%- if result.views %}
+ <div>
+ <span>{{ _('Views') }}:</span>
+ <span>{{ result.views }}</span>
+ </div>
+ {% endif -%}
</div>
-{%- if result.content -%}<p class="content">{{- result.content | safe -}}</p>{%- endif -%}
-{%- if result.comments -%}<p class="comments">{{- result.comments -}}</p>{%- endif -%}
+{%- if result.content -%}
+ <p class="content">{{- result.content | safe -}}</p>
+{%- endif -%}
+{%- if result.comments -%}
+ <p class="comments">{{- result.comments -}}</p>
+{%- endif -%}
+
+{%- if result.metadata %}
+ <div class="highlight">{{ result.metadata|safe }}</div>
+{% endif -%}
+
<p class="altlink">
{%- if result.pdf_url -%}{{ result_link(result.pdf_url, _('PDF')) }}{%- endif -%}
{%- if result.html_url -%}{{ result_link(result.html_url, _('HTML')) }}{%- endif -%}