Introduce panel actions

This commit is contained in:
Jeremy Stretch
2025-11-03 09:55:56 -05:00
parent da68503a19
commit 37bea1e98e
4 changed files with 121 additions and 55 deletions

View File

@@ -1,4 +1,18 @@
<div class="card">
<h2 class="card-header">{{ title }}</h2>
<h2 class="card-header">
{{ title }}
{% if actions %}
<div class="card-actions">
{% for action in actions %}
<a href="{{ action.url }}" class="btn btn-ghost-{{ action.button_class|default:"primary" }} btn-sm">
{% if action.button_icon %}
<i class="mdi mdi-{{ action.button_icon }}" aria-hidden="true"></i>
{% endif %}
{{ action.label }}
</a>
{% endfor %}
</div>
{% endif %}
</h2>
{% block panel_content %}{% endblock %}
</div>

View File

@@ -3,8 +3,8 @@
{% block panel_content %}
<div class="card-body">
{% if comments %}
{{ comments|markdown }}
{% if object.comments %}
{{ object.comments|markdown }}
{% else %}
<span class="text-muted">{% trans "None" %}</span>
{% endif %}