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

@ -34,6 +34,7 @@ footer_source = "Website source"
go_to_top = "Go to Top" go_to_top = "Go to Top"
load_comments = "Load Comments" load_comments = "Load Comments"
newest_to_oldest = "From newest to oldest" newest_to_oldest = "From newest to oldest"
open_post = "Open Post"
page_next = "Next" page_next = "Next"
page_previous = "Previous" page_previous = "Previous"
posts_in_total = "posts in total" posts_in_total = "posts in total"
@ -76,6 +77,7 @@ footer_source = "Исходный код веб-сайта"
go_to_top = "Перейти в Начало" go_to_top = "Перейти в Начало"
load_comments = "Загрузить Комментарии" load_comments = "Загрузить Комментарии"
newest_to_oldest = "От новейшего к старейшему" newest_to_oldest = "От новейшего к старейшему"
open_post = "Открыть Пост"
page_next = "Следующий" page_next = "Следующий"
page_previous = "Предыдущий" page_previous = "Предыдущий"
posts_in_total = "всего постов" posts_in_total = "всего постов"

View File

@ -25,6 +25,12 @@ section#comments {
margin-top: 2rem; margin-top: 2rem;
} }
.dialog-buttons {
justify-content: start;
gap: 0.25rem;
margin-top: 2rem;
}
.comment { .comment {
display: grid; display: grid;
grid-template-columns: min-content; grid-template-columns: min-content;
@ -140,14 +146,14 @@ section#comments {
} }
footer { footer {
display: flex;
grid-area: interactions; grid-area: interactions;
gap: 0.25rem;
margin-top: 1rem; margin-top: 1rem;
.boosts, .boosts,
.faves { .faves {
display: inline-block;
transition: var(--transition); transition: var(--transition);
margin-right: 0.25rem;
border-radius: 999px; border-radius: 999px;
background-color: transparent; background-color: transparent;
padding: 0.25rem 0.75rem; padding: 0.25rem 0.75rem;

View File

@ -13,21 +13,23 @@
{% endif %} {% endif %}
{% set id = page.extra.comments.id %} {% set id = page.extra.comments.id %}
{% set post_url = "https://{{ host }}/@{{ username }}/{{ id }}" %}
<section id="comments"> <section id="comments">
{% if config.extra.comments.show_qr %} {% 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 %} {% endif %}
<h2>{{ trans(key="comments", lang=lang) }}</h2> <h2>{{ trans(key="comments", lang=lang) }}</h2>
<p>{{ trans(key="comments_description", lang=lang) }}</p> <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"> <a id="load-comments" class="inline-button" onclick="loadComments()" onkeypress="loadComments()" tabindex="0">
{{ trans(key="load_comments", lang=lang) }} {{ trans(key="load_comments", lang=lang) }}
</a> </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"> <div id="comments-wrapper">
<noscript> <noscript>