add actions to the listing

This commit is contained in:
envoyr
2022-02-23 18:24:51 +01:00
parent 04263cb69f
commit c4940897a3
6 changed files with 77 additions and 14 deletions

View File

@@ -16,4 +16,21 @@
{% else %}
<i class="fa fa-times-circle"></i>
{% endif %}
{% endmacro %}
{% macro actions(data) %}
{% for action in data %}
{% if action.visible is not defined or action.visible is defined and action.visible %}
{% apply spaceless %}
<a href="{{ action.href }}" {% if action.target is defined %}target="{{ action.target }}"{% endif %}>
{% if action.icon is defined %}
<i class="{{ action.icon }}"></i>
{% endif %}
{% if action.text is defined %}
{{ action.text }}
{% endif %}
</a>
{% endapply %}
{% endif %}
{% endfor %}
{% endmacro %}

View File

@@ -31,6 +31,8 @@
{{ callbacks.progressbar(value.data) }}
{% elseif value.type == 'boolean' %}
{{ callbacks.boolean(value.data) }}
{% elseif value.type == 'actions' %}
{{ callbacks.actions(value.data) }}
{% else %}
Callback '{{ value|json_encode }}' is not implemented!
{% endif %}