Refactor group display in home template to use articles for better structure and styling

This commit is contained in:
Edgar P. Burkhart 2025-06-13 23:58:24 +02:00
parent 6ada3290c8
commit 43ba52f31e
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 26 additions and 12 deletions

View file

@ -19,3 +19,15 @@ i.owner {
.template {
display: none;
}
a.group {
text-decoration: none;
}
.group-owner, .group i {
margin-left: .5rem;
}
.group-owner {
color: var(--pico-color-zinc-500);
}

View file

@ -7,16 +7,18 @@
{% endif %}
</p>
{% if user.owned_group_set.exists or user.group_set.exists %}
<ul>
{% for group in user.owned_group_set.all %}
<li>
<a href="{{ group.get_absolute_url }}">{{ group.name }}</a> <i class="ri-vip-crown-fill owner"></i>
</li>
{% endfor %}
{% for group in user.group_set.all %}
<li>
<a href="{{ group.get_absolute_url }}">{{ group.name }}</a>
</li>
{% endfor %}
</ul>
{% for group in user.owned_group_set.all %}
<a class="group" href="{{ group.get_absolute_url }}">
<article>
{{ group.name }} <i class="ri-vip-crown-fill owner"></i>
</article>
</a>
{% endfor %}
{% for group in user.group_set.all %}
<a class="group" href="{{ group.get_absolute_url }}">
<article>
{{ group.name }} <span class="group-owner">{{ group.owner }}</span>
</article>
</a>
{% endfor %}
{% endif %}