diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-05 10:41:24 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:08 +0200 |
commit | 40c94fba1a9e3e119af8738f75f1e8082feb0c8b (patch) | |
tree | 63a7d4c8f7cb34c6f4c0c9089bfafce00a46dfd8 /ishtar_common/templates/blocks/DataTables.html | |
parent | e5568da593a5bc13ab2065ec22a2d6b035be756b (diff) | |
download | Ishtar-40c94fba1a9e3e119af8738f75f1e8082feb0c8b.tar.bz2 Ishtar-40c94fba1a9e3e119af8738f75f1e8082feb0c8b.zip |
Quick actions: generic urls, views and forms
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', |