diff options
Diffstat (limited to 'ishtar_common/templates/blocks')
| -rw-r--r-- | ishtar_common/templates/blocks/DataTables.html | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index 711f0b7c3..42b6eb8ad 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -17,17 +17,6 @@ <em><span id="pinned_search_content_{{name}}"></span></em> </div> -<div class="row toolbar justify-content-center"> - <div class='col-2'> - <div class="btn-group btn-group-sm" role="group"> - <button class="btn btn-secondary" data-toggle="modal" - data-target=".table-modal-lg"> - {% trans "Expand table" %} <i class="fa fa-expand" aria-hidden="true"></i> - </button> - </div> - </div> -</div> - <div class="modal fade table-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="modal_grid_{{name}}"> <div class="modal-dialog full modal-lg"> @@ -59,11 +48,19 @@ <div id='foot_{{name}}' class="gridfooter row toolbar"> <div class='col-md-2'> + <div class="btn-group btn-group-sm" role="group"> + <button class="btn btn-secondary" data-toggle="modal" + data-target=".table-modal-lg"> + {% trans "Expand table" %} <i class="fa fa-expand" aria-hidden="true"></i> + </button> + </div> + </div> + <div class='col-md-2'> <div class="btn-group btn-group-sm" role="group" aria-label="{% trans 'Export'%}"> {% if source_full or extra_sources %} <a class="btn btn-secondary" href='{{source}}csv' target='_blank' - title="{% trans 'Export as CSV - ' %}{% trans 'simple'%}">{% trans "CSV" %}</a> + title="{% trans 'Export as CSV - ' %}{% trans 'simple'%}">{% trans "Simple CSV" %}</a> {% if source_full %}<a class='btn btn-secondary' href='{{source_full}}csv' target='_blank' title="{% trans 'Export as CSV - full' %}">{% trans "CSV full" %}</a>{% endif %} {% for slug, name, extra_source in extra_sources %} <a class="btn btn-secondary" href='{{extra_source}}csv' target='_blank' title="{% trans 'Export as CSV - ' %}{{name}}">{{name}}</a> @@ -143,26 +140,21 @@ jQuery(document).ready(function(){ } return false; }); + datatable_options = { "ajax": { "url": "{{source}}", "dataSrc": "rows" }, - "processing": true, - "serverSide": true, - "scrollX": true, - "scrollY": true, - "searching": false, - "info": false, - "scrollCollapse": true, "columns": [ { "data": "id", "visible": false }, { "data": "link", "orderable": false },{% for col in extra_cols %} { "data": "{{col}}", "defaultContent": "-"}{% if not forloop.last %},{% endif %}{% endfor %} ] }; - if (datatables_i18n) datatable_options['language'] = datatables_i18n; + $.extend(datatable_options, datatables_default); + if (datatables_i18n) datatable_options['language'] = datatables_i18n; datatable_{{sname}} = jQuery("#grid_{{name}}").DataTable(datatable_options); {% comment %} |
