Merge 6935fa393f8ef27a0706d43160070ca3b4affda3 into af3be2b12b3bfd03af319e0901a19121281c1d11

This commit is contained in:
Christian Neff 2024-04-23 17:26:08 +02:00 committed by GitHub
commit e6523a63aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 46 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -652,20 +652,30 @@ summary.title {
display: none;
}
.answer-title {
font-size: 1rem;
margin-top: 0;
margin-bottom: 1rem;
}
span {
overflow-wrap: anywhere;
}
.answer {
display: flex;
flex-direction: column;
.answer-fields dt {
font-weight: bold;
margin-top: 0.8rem;
margin-bottom: 0.4rem;
}
.answer-url {
margin-left: auto;
margin-top: 5px;
margin-right: 10px;
margin-bottom: 10px;
.answer-fields dd {
margin-left: 1.5rem;
}
.answer-sources {
margin-top: 1rem;
font-size: 0.8rem;
.ltr-text-align-right();
}
}

View File

@ -23,10 +23,30 @@
<div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>
{%- for answer in answers.values() -%}
<div class="answer">
{% if answer.title %}
<h5 class="answer-title">{{ answer.title }}</h5>
{% endif %}
{% if answer.url %}
<a href="{{ answer.url }}">{{ answer.answer }}</a>
{% else %}
<span>{{ answer.answer }}</span>
{% if answer.url -%}
<a href="{{ answer.url }}" class="answer-url">{{ urlparse(answer.url).hostname }}</a>
{% endif -%}
{% endif %}
{% if answer.fields %}
<dl class="answer-fields">
{% for field in answer.fields -%}
<dt>{{ field.label }}</dt>
<dd>{{ field.value }}</dd>
{%- endfor %}
</dl>
{% endif %}
{% if answer.sources %}
<div class="answer-sources">
{{ _('Sources') }}:
{% for source in answer.sources -%}
{% if not loop.first %}, {% endif %}<a href="{{ source.url }}">{{ source.title }}</a>
{%- endfor %}
</div>
{% endif %}
</div>
{%- endfor -%}
</div>