summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/blocks
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-27 11:55:34 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-27 11:55:34 +0100
commitd409bc5da81eff3cd1f8459263b99d4f61a07272 (patch)
tree1e5c122563a17902ab37229ce471408e09467bfd /ishtar_common/templates/blocks
parent2f36126163498299174d5dc0162a008b57fe5ea7 (diff)
downloadIshtar-d409bc5da81eff3cd1f8459263b99d4f61a07272.tar.bz2
Ishtar-d409bc5da81eff3cd1f8459263b99d4f61a07272.zip
Syndication - table: add export button et "Expand table"
Diffstat (limited to 'ishtar_common/templates/blocks')
-rw-r--r--ishtar_common/templates/blocks/DataTables-content.html34
-rw-r--r--ishtar_common/templates/blocks/DataTables.html42
2 files changed, 64 insertions, 12 deletions
diff --git a/ishtar_common/templates/blocks/DataTables-content.html b/ishtar_common/templates/blocks/DataTables-content.html
index dc699fa91..029ebd84c 100644
--- a/ishtar_common/templates/blocks/DataTables-content.html
+++ b/ishtar_common/templates/blocks/DataTables-content.html
@@ -16,7 +16,7 @@
<div class="btn-group btn-group-sm" role="group">
<button type='button' class="btn btn-secondary" data-toggle="modal"
data-target="#modal_grid_{{name}}">
- {% trans "Expand table" %} <i class="fa fa-expand" aria-hidden="true"></i>
+ {% trans "Expand table" %}&nbsp;<i class="fa fa-expand" aria-hidden="true"></i>
</button>
</div>
</div>
@@ -82,4 +82,36 @@
</thead>
</table>
</div>
+
+ <div id='foot_{{name}}_{{source_id}}' class="sources sources-{{source_id}} gridfooter row toolbar">
+ <div class='col col-sm-2'>
+ <div class="btn-group btn-group-sm" role="group">
+ <button type='button' class="btn btn-secondary" data-toggle="modal"
+ data-target="#modal_grid_{{name}}_{{source_id}}">
+ {% trans "Expand table" %}&nbsp;<i class="fa fa-expand" aria-hidden="true"></i>
+ </button>
+ </div>
+ </div>
+ <div class="col">
+ <div class="btn-group btn-group-sm" role="group">
+ <button id="export-{{name}}-" type="button"
+ class="btn btn-secondary dropdown-toggle table-export" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ {% trans 'Export'%}
+ </button>
+ <div class="dropdown-menu" aria-labelledby="export-{{name}}">
+ <a class="dropdown-item {{sname}}-csv" href="{{source}}csv" target="_blank" title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a>
+ </div>
+ <div class="input-group-append">
+ <div class="selected-lines input-group-text" id="btnGroupAddon">
+ <span class="sl-whole">{% trans "whole table" %}</span>
+ <span class="sl-selected"><span class="sl-number"></span>&nbsp;{% trans "selected item(s)" %}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+
{% endfor %}
diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html
index 95ebbbc6b..8ef1a5403 100644
--- a/ishtar_common/templates/blocks/DataTables.html
+++ b/ishtar_common/templates/blocks/DataTables.html
@@ -25,6 +25,25 @@
</div>
</div>
+{% for source_id, source_label, source_url in external_sources %}
+<div class="modal fade table-modal-lg" tabindex="-1" role="dialog"
+ aria-hidden="true" id="modal_grid_{{name}}_{{source_id}}">
+ <div class="modal-dialog full modal-lg">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ <div class="modal-body">
+ <div class="current-sheets"></div>
+ <div class="current-grid"></div>
+ </div>
+ </div>
+ </div>
+</div>
+{% endfor %}
+
{% if external_sources %}
{% include "blocks/DataTables-external-sources.html" %}
{% endif %}
@@ -36,21 +55,22 @@
<script type="text/javascript" language='javascript'>
$('#modal_grid_{{name}}').on('show.bs.modal', function (e) {
- $('#grid_{{name}}_wrapper').appendTo(
- '#modal_grid_{{name}} .modal-body .current-grid');
- $('#window').appendTo(
- '#modal_grid_{{name}} .modal-body .current-sheets');
- $('#grid_{{name}}').DataTable().clear().draw();
- current_modal = $("#modal_grid_{{name}}");
+ bs_expand_table("{{name}}");
});
$('#modal_grid_{{name}}').on('hide.bs.modal', function (e) {
- $('#grid_{{name}}_wrapper').appendTo(
- '#grid_{{name}}_meta_wrapper');
- $('#window').appendTo('#window_wrapper');
- $('#grid_{{name}}').DataTable().clear().draw();
- current_modal = null;
+ bs_hide_table("{{name}}");
+});
+
+{% for source_id, source_label, source_url in external_sources %}
+$('#modal_grid_{{name}}_{{source_id}}').on('show.bs.modal', function (e) {
+ bs_expand_table("{{name}}_{{source_id}}");
+});
+
+$('#modal_grid_{{name}}_{{source_id}}').on('hide.bs.modal', function (e) {
+ bs_hide_table("{{name}}_{{source_id}}");
});
+{% endfor %}
{% if gallery or use_map %}
$("#tab-grid-{{name}}").click(function(){