summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre FLAMENT <alexandre.flament@hesge.ch>2022-08-26 16:07:18 +0000
committerAlexandre Flament <alex@al-f.net>2022-09-23 20:45:58 +0200
commit5ba831d6a88bca617d984593f6710d0c18bae120 (patch)
treecbf13cafd14c0ccd1ef892152c24d5ea982150a6
parenta96f503d7b4866e6eb352afd759433b3aad0a3f5 (diff)
Add paper.html result template
-rw-r--r--searx/static/themes/simple/src/less/style.less65
-rw-r--r--searx/templates/simple/result_templates/paper.html44
2 files changed, 109 insertions, 0 deletions
diff --git a/searx/static/themes/simple/src/less/style.less b/searx/static/themes/simple/src/less/style.less
index 11d2ef58..dd8e8a59 100644
--- a/searx/static/themes/simple/src/less/style.less
+++ b/searx/static/themes/simple/src/less/style.less
@@ -302,6 +302,49 @@ article[data-vim-selected].category-social {
}
}
+.result-paper {
+ .attributes {
+ display: table;
+ border-spacing: 0.125rem;
+
+ div {
+ display: table-row;
+
+ span {
+ font-size: 0.9rem;
+ margin-top: 0.25rem;
+ display: table-cell;
+
+ time {
+ font-size: 0.9rem;
+ }
+ }
+
+ span:first-child {
+ color: var(--color-base-font);
+ min-width: 10rem;
+ }
+
+ span:nth-child(2) {
+ color: var(--color-result-publishdate-font);
+ }
+ }
+ }
+
+ .content {
+ margin-top: 0.25rem;
+ }
+
+ .comments {
+ font-size: 0.9rem;
+ margin: 0.25rem 0 0 0;
+ padding: 0;
+ word-wrap: break-word;
+ line-height: 1.24;
+ font-style: italic;
+ }
+}
+
.template_group_images {
display: flex;
flex-wrap: wrap;
@@ -955,6 +998,28 @@ article[data-vim-selected].category-social {
border: none !important;
background-color: var(--color-sidebar-background);
}
+
+ .result-paper {
+ .attributes {
+ display: block;
+
+ div {
+ display: block;
+
+ span {
+ display: inline;
+ }
+
+ span:first-child {
+ font-weight: bold;
+ }
+
+ span:nth-child(2) {
+ .ltr-margin-left(0.5rem);
+ }
+ }
+ }
+ }
}
/*
diff --git a/searx/templates/simple/result_templates/paper.html b/searx/templates/simple/result_templates/paper.html
new file mode 100644
index 00000000..3ede1b25
--- /dev/null
+++ b/searx/templates/simple/result_templates/paper.html
@@ -0,0 +1,44 @@
+{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %}
+
+{{ 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.journal -%}
+ <div class="result_journal">
+ <span>{{- _("Journal") }}:</span><span>{{ result.journal -}}
+ {%- if result.volume -%}
+ &nbsp;{{- result.volume -}}
+ {%- if result.number -%}
+ .{{- result.number -}}
+ {%- endif -%}
+ {%- endif -%}
+ {%- if result.start_page -%}
+ &nbsp;{{- result.start_page -}} / {{- result.end_page -}}
+ {%- 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.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 -%}
+</div>
+{%- if result.content -%}<p class="content">{{- result.content | safe -}}</p>{%- endif -%}
+{%- if result.comments -%}<p class="comments">{{- result.comments -}}</p>{%- endif -%}
+<p class="altlink">
+ {%- if result.pdf_url -%}
+ <a href="{{ result.pdf_url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('PDF') }}</a>
+ {%- endif -%}
+ {%- if result.html_url -%}
+ <a href="{{ result.html_url }}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>{{ _('HTML') }}</a>
+ {%- endif -%}
+ {%- if result.doi %}
+ <a href="https://www.altmetric.com/details/doi/{{result.doi}}" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %}>Altmetric</a>
+ {% endif -%}
+</p>
+{{- result_sub_footer(result, proxify) -}}
+{{- result_footer(result) }}