Skip to content

Commit 8fc14a0

Browse files
committed
minor #823 [Demo] Polish style of sources feature of wikipedia example (chr-hertel)
This PR was merged into the main branch. Discussion ---------- [Demo] Polish style of sources feature of wikipedia example | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | | License | MIT <img width="1483" height="932" alt="image" src="https://github.com/user-attachments/assets/e7fe58e6-1c19-4ed4-87bd-2ea51e72c42f" /> Commits ------- 6b923ca Polish style of sources feature of wikipedia example
2 parents 17837ef + 6b923ca commit 8fc14a0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

demo/templates/components/wikipedia.html.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
<div id="chat-body" class="card-body p-4 overflow-auto">
1010
{% for message in this.messages %}
1111
{% include '_message.html.twig' with { message, latest: loop.last } %}
12-
{% if message.metadata.has('sources') %}
13-
<div class="ms-5">
14-
<h6>Sources:</h6>
15-
<ol>
16-
{% for source in message.metadata.get('sources') %}
17-
<li><a class="text-black-50" href="{{ source.reference }}" target="_blank" rel="noopener">{{ source.name }}</a></li>
18-
{% endfor %}
19-
</ol>
12+
{% if message.metadata.has('sources') and 0 != message.metadata.get('sources')|length %}
13+
<div class="ms-5 ps-4" style="margin-top: -1.5em;">
14+
<span class="text-muted">Sources:</span>
15+
{% for source in message.metadata.get('sources') %}
16+
<a class="text-black-50" href="{{ source.reference }}" target="_blank" rel="noopener">
17+
<span class="badge text-bg-secondary">{{ source.name }}</span>
18+
</a>
19+
{% endfor %}
2020
</div>
2121
{% endif %}
2222
{% else %}

0 commit comments

Comments
 (0)