{% extends 'django_spire/card/title_card.html' %} {% load permission_tags %} {% load model_tags %} {% block card_title %} Comments {% endblock %} {% block card_button %} {% with app_label=obj|model_app_label model_name=obj|model_name %} {% check_permission user app_label model_name 'change' as has_access %} {% if has_access %} {% include 'django_spire/button/primary_button.html' with button_text='Add' button_icon='bi bi-plus' %} {% endif %} {% endwith %} {% endblock %} {% block card_title_content %} {% with obj.comments.active.prefetch_user as comments %} {% if comments %} {% for comment in comments %} {% include 'django_spire/comment/item/comment_item.html' %} {% endfor %} {% else %} {% include 'django_spire/item/no_data_item.html' %} {% endif %} {% endwith %} {% endblock %}