add actions to the listing
This commit is contained in:
@@ -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 %}
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user