[Feature] Simple template extension mechanism (#361)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#361
This commit is contained in:
2026-03-16 21:06:20 +13:00
parent 3cc7fa9e8b
commit 68aea97013
5 changed files with 55 additions and 9 deletions

View File

@ -1,21 +1,34 @@
{% extends "collections/paginated_base.html" %}
{% load envipytags %}
{% block page_title %}Compounds{% endblock %}
{% block action_button %}
{% if meta.can_edit %}
<button
type="button"
class="btn btn-primary btn-sm"
onclick="document.getElementById('new_compound_modal').showModal(); return false;"
>
New Compound
</button>
{% endif %}
<div class="flex items-center gap-2">
{% if meta.can_edit %}
<button
type="button"
class="btn btn-primary btn-sm"
onclick="document.getElementById('new_compound_modal').showModal(); return false;"
>
New Compound
</button>
{% endif %}
{% epdb_slot_templates "epdb.actions.collections.compound" as action_button_templates %}
{% for tpl in action_button_templates %}
{% include tpl %}
{% endfor %}
</div>
{% endblock action_button %}
{% block action_modals %}
{% include "modals/collections/new_compound_modal.html" %}
{% epdb_slot_templates "modals.collections.compound" as action_modals_templates %}
{% for tpl in action_modals_templates %}
{% include tpl %}
{% endfor %}
{% endblock action_modals %}
{% block description %}