Add "open post" button to comments

Since I started working on the i18n support, comments lost it's previous
link to the post, so it's been added back in a form of an actual button
This commit is contained in:
daudix
2024-06-18 06:08:18 +03:00
parent bcf57b7147
commit 17634a94da
3 changed files with 16 additions and 6 deletions

View File

@ -13,21 +13,23 @@
{% endif %}
{% set id = page.extra.comments.id %}
{% set post_url = "https://{{ host }}/@{{ username }}/{{ id }}" %}
<section id="comments">
{% if config.extra.comments.show_qr %}
<img id="qrcode" class="no-hover pixels" alt="QR code to a Mastodon post" src="https://api.qrserver.com/v1/create-qr-code/?data={{ post_url }}&format=gif" />
<img id="qrcode" class="no-hover pixels" alt="QR code to a Mastodon post" src="https://api.qrserver.com/v1/create-qr-code/?data=https://{{ host }}/@{{ username }}/{{ id }}&format=gif" />
{% endif %}
<h2>{{ trans(key="comments", lang=lang) }}</h2>
<p>{{ trans(key="comments_description", lang=lang) }}</p>
<p>
<div class="dialog-buttons">
<a id="load-comments" class="inline-button" onclick="loadComments()" onkeypress="loadComments()" tabindex="0">
{{ trans(key="load_comments", lang=lang) }}
</a>
</p>
<a class="inline-button colored external" href="https://{{ host }}/@{{ username }}/{{ id }}">
{{ trans(key="open_post", lang=lang) }}
</a>
</div>
<div id="comments-wrapper">
<noscript>