From 48e8c61a89781df02727dbd843d7792af6e6c0de Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 13 Jan 2021 18:07:06 -0800 Subject: serp: expand abstracts using
This isn't very polished, but a start, and uses no javascript. --- fatcat_scholar/templates/base.html | 10 ++++++++++ fatcat_scholar/templates/search_macros.html | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'fatcat_scholar') diff --git a/fatcat_scholar/templates/base.html b/fatcat_scholar/templates/base.html index 8ac8096..138940d 100644 --- a/fatcat_scholar/templates/base.html +++ b/fatcat_scholar/templates/base.html @@ -74,6 +74,16 @@ line-height: 1.28571429em; } + .serp-hit-box details > summary { + list-style-type: none; + color: #28629c; + text-decoration: underline; + margin-left: 0.3em; + } + .serp-hit-box details > summary::-webkit-details-marker { + display: none; + } + {# fix RTL dividers #} {% if locale in ['ar'] %} .ui.divided.grid:not([class*="vertically divided"])>.column:not(.row), .ui.divided.grid:not([class*="vertically divided"])>.row>.column { diff --git a/fatcat_scholar/templates/search_macros.html b/fatcat_scholar/templates/search_macros.html index 6346754..3c8509c 100644 --- a/fatcat_scholar/templates/search_macros.html +++ b/fatcat_scholar/templates/search_macros.html @@ -121,7 +121,11 @@ {% elif paper.abstracts %}
{% if paper.abstracts[0].body|length > 500 %} - {{ paper.abstracts[0].body[:500] }}... + {{ paper.abstracts[0].body | truncate(500, False, '') }} +
+ {% trans %}more »{% endtrans %} + ... {{ paper.abstracts[0].body[480:] }} +
{% else %} {{ paper.abstracts[0].body }} {% endif %} -- cgit v1.2.3