forum: minor improvements to thread display

This commit is contained in:
Lephe 2021-07-12 15:18:54 +02:00 committed by Gitea
parent d10f9b3b48
commit 7423e522c3
3 changed files with 17 additions and 3 deletions

View File

@ -118,6 +118,9 @@ table.thread td {
table.thread td.message {
padding-top: 8px;
}
table.thread.topcomment td.message {
padding-top: 0;
}
table.thread td.message > *:nth-child(2) {
margin-top: 0;
}
@ -126,10 +129,15 @@ table.thread td.message img {
}
table.thread div.info {
float: right;
text-align: right;
position: relative;
}
table.thread.topcomment div.info {
padding-bottom: 4px;
}
table.thread:not(.topcomment) div.info {
float: right;
}
table.thread div.info > * {
display: inline-block;
vertical-align: top;

View File

@ -29,7 +29,7 @@
table {
--border: #d8d8d8;
}
table tr:nth-child(even) {
table tr:nth-child(odd) {
--background: rgba(0, 0, 0, .1);
}
table th {

View File

@ -3,9 +3,12 @@
{% macro thread(comments, top_comment) %}
<table class="thread {{ 'topcomment' if top_comment == None else ''}} ">
{% if top_comment == None %}
<tr></tr>
{% endif %}
{% for c in comments %}
<tr id="{{ c.id }}">
{% if c != top_comment %}
<tr id="{{ c.id }}">
<td class="author">{{ widget_user.profile(c.author) }}</td>
<td class="message">
<div class="info">
@ -46,8 +49,11 @@
{{ c.author.signature|md }}
{% endif %}
</td>
</tr>
{% elif loop.index0 != 0 %}
<tr id="{{ c.id }}">
<div>Ce message est le top comment</div>
</tr>
{% endif %}
</tr>
{% endfor %}