diff options
Diffstat (limited to 'ishtar_common/templates/blocks/DataTables.html')
-rw-r--r-- | ishtar_common/templates/blocks/DataTables.html | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index 70d47cb8d..7fad1f121 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -162,16 +162,35 @@ jQuery(document).ready(function(){ "select": { "style": {% if multiple_select %}'multi'{% else %}'single'{% endif %} }, - {% if multiple_select %}"buttons": [ - 'selectAll', - 'selectNone' - ], - "language": { - buttons: { - selectAll: "{% trans 'Select all items' %}", - selectNone: "{% trans 'Select none' %}" + {% if multiple_select or quick_actions %}"buttons": [ + {% for url, title, icon, target in quick_actions %} + { + {% if target == 'one' %}extend: 'selectedSingle', + {% elif target == 'many' %}extend: 'selected', + {% endif %} + className: "btn btn-success", + text: "{{icon}}", + titleAttr: "{{title}}", + action: function (e, dt, node, config) { + var url = dt_generate_qa_url(dt, "{{url}}"); + dt_qa_open(url); + return false; + } + }, + {% if not forloop.last %},{% endif %} + {% endfor %}{% if multiple_select %}{% if quick_actions%},{% endif %} + { + extend: 'selectAll', + text: '<i class="fa fa-check-circle-o"></i>', + titleAttr: "{% trans 'Select all items' %}" + }, + { + extend: 'selectNone', + text: '<i class="fa fa-times"></i>', + titleAttr: "{% trans 'Deselect' %}" } - }, + {% endif %} + ], "dom": 'lBtip', {% else %} "dom": 'ltip', |