From ed3f985309bc265e07d30f7d6df375b2800c57ea Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 30 Apr 2019 13:35:51 +0200 Subject: Label generation: label generation available at the bottom of tables --- .../templates/blocks/DataTables-content.html | 44 ++++++++++++++++------ ishtar_common/templates/blocks/DataTables.html | 10 ++++- 2 files changed, 40 insertions(+), 14 deletions(-) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/blocks/DataTables-content.html b/ishtar_common/templates/blocks/DataTables-content.html index 1b069f674..4a9257f65 100644 --- a/ishtar_common/templates/blocks/DataTables-content.html +++ b/ishtar_common/templates/blocks/DataTables-content.html @@ -21,19 +21,39 @@
-
- {% if source_full or extra_sources %} - {% trans "Simple CSV" %} - {% if source_full %}{% trans "CSV full" %}{% endif %} - {% for slug, name, extra_source in extra_sources %} - {{name}} - {% endfor %} - {% else %} - {% trans "CSV" %} - {% endif %} +
+ +
+ {% if current_model.has_label_templates %}
+ + +
{% endif %}
diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index 90eced2f9..a20a151a9 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -163,8 +163,14 @@ update_submit_args = function(){ var csv_full_url = "{{source_full}}csv?submited=1&" + data; $(".{{sname}}-csv-full").attr("href", csv_full_url); {% for slug, name, extra_source in extra_sources %} - $(".{{slug}}-csv-full").attr("href", '{{extra_source}}csv?submited=1&' + data); - {% endfor %} + $(".{{slug}}-csv-full").attr("href", '{{extra_source}}csv?submited=1&' + data);{% endfor %} + {% for template in current_model.label_templates %} + $(".{{template.slug}}-labels").attr("href", '{{template.get_baselink_for_labels}}?submited=1&' + data);{% endfor %} + + if ($('.modal-progress').length > 0){ + $('.modal-progress').modal('hide'); + } + return false; }; -- cgit v1.2.3