Display status if there's no comments

This commit is contained in:
daudix
2024-08-08 05:56:48 +03:00
parent 83b7e84292
commit 5325d17667
5 changed files with 19 additions and 0 deletions

View File

@ -41,6 +41,7 @@ many_minutes_read = "$NUMBER دقائق القراءة"
minutes_read = "$NUMBER دقائق القراءة" minutes_read = "$NUMBER دقائق القراءة"
newest_to_oldest = "من الأحدث إلى الأقدم" newest_to_oldest = "من الأحدث إلى الأقدم"
next = "التالي" next = "التالي"
no_comments = "لا توجد تعليقات حتى الآن :/"
note = "ملاحظة" note = "ملاحظة"
open_post = "افتح المنشور" open_post = "افتح المنشور"
posts = "الوظائف في المجموع" posts = "الوظائف في المجموع"

View File

@ -43,6 +43,7 @@ many_tags = "$NUMBER tags in total"
minutes_read = "$NUMBER minute read" minutes_read = "$NUMBER minute read"
newest_to_oldest = "From newest to oldest" newest_to_oldest = "From newest to oldest"
next = "Next" next = "Next"
no_comments = "No comments yet :/"
note = "Note" note = "Note"
one_posts = "$NUMBER post in total" one_posts = "$NUMBER post in total"
one_tags = "$NUMBER tag in total" one_tags = "$NUMBER tag in total"

View File

@ -47,6 +47,7 @@ many_posts = "Всего $NUMBER постов"
many_tags = "Всего $NUMBER тегов" many_tags = "Всего $NUMBER тегов"
newest_to_oldest = "От новейшего к старейшему" newest_to_oldest = "От новейшего к старейшему"
next = "Следующий" next = "Следующий"
no_comments = "Комментариев пока нет :/"
note = "Заметьте" note = "Заметьте"
one_posts = "Всего $NUMBER пост" one_posts = "Всего $NUMBER пост"
one_tags = "Всего $NUMBER тег" one_tags = "Всего $NUMBER тег"

View File

@ -30,6 +30,14 @@
gap: 2rem; gap: 2rem;
margin-top: 2rem; margin-top: 2rem;
#comments-status {
margin-block-start: 0;
color: var(--fg-muted-4);
font-weight: bold;
font-size: 1.5em;
text-align: center;
}
.comment { .comment {
display: grid; display: grid;
grid-template-columns: min-content; grid-template-columns: min-content;

View File

@ -342,6 +342,14 @@
commentsWrapper.innerHTML += comment.outerHTML; commentsWrapper.innerHTML += comment.outerHTML;
}); });
} }
else {
var statusText = document.createElement("p");
statusText.innerHTML = "{{ macros_translate::translate(key='no_comments', default='No comments yet :/', language_strings=language_strings) }}";
statusText.setAttribute("id", "comments-status");
commentsWrapper.appendChild(statusText);
}
loadCommentsButton.innerHTML = "{{ macros_translate::translate(key='reload', default='Reload', language_strings=language_strings) }}"; loadCommentsButton.innerHTML = "{{ macros_translate::translate(key='reload', default='Reload', language_strings=language_strings) }}";
}); });
} }