fix: Enhances activity visibility control

Replaces conditional rendering with inline style for hidden
activities. This simplifies the template logic and maintains
consistent structure for all activities, enhancing UI flexibility.
This commit is contained in:
Kumi 2024-11-18 08:35:29 +01:00
parent d522f23b55
commit 3c3cfc38ba
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -79,14 +79,13 @@
<b>{{ activitycategory.name }}</b> <b>{{ activitycategory.name }}</b>
</p> </p>
{% for activity in activitycategory.activity_set.all|dictsort:"name" %} {% for activity in activitycategory.activity_set.all|dictsort:"name" %}
{% if not activity.hidden %} <p {% if activity.hidden %}style="display: none;"{% endif %}>
<input type="checkbox" <input type="checkbox"
{% if activity in object.activity_set %}checked{% endif %} {% if activity in object.activity_set %}checked{% endif %}
value="{{ activity.id }}" value="{{ activity.id }}"
name="activities"> name="activities">
<i class="{{ activity.icon }}" style="color:{{ activity.color }};"></i> {{ activity }} <i class="{{ activity.icon }}" style="color:{{ activity.color }};"></i> {{ activity }}
<br> </p>
{% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% other_activities as activities %} {% other_activities as activities %}