summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-30 13:35:51 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:27 +0200
commited3f985309bc265e07d30f7d6df375b2800c57ea (patch)
tree78ef660a5c7c814e1f2d207276c908f3e9f6e25b /ishtar_common/templates
parent909f30658bd76f338a21108d770edca517683cc2 (diff)
downloadIshtar-ed3f985309bc265e07d30f7d6df375b2800c57ea.tar.bz2
Ishtar-ed3f985309bc265e07d30f7d6df375b2800c57ea.zip
Label generation: label generation available at the bottom of tables
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/blocks/DataTables-content.html44
-rw-r--r--ishtar_common/templates/blocks/DataTables.html10
2 files changed, 40 insertions, 14 deletions
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 @@
</div>
</div>
<div>
- <div class="btn-group btn-group-sm" role="group"
- aria-label="{% trans 'Export'%}">
- {% if source_full or extra_sources %}
- <a class="btn btn-secondary {{sname}}-csv" href='{{source}}csv' target='_blank'
- title="{% trans 'Export as CSV - ' %}{% trans 'simple'%}">{% trans "Simple CSV" %}</a>
- {% if source_full %}<a class='btn btn-secondary {{sname}}-csv-full' 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 {{slug}}-csv-full" href='{{extra_source}}csv' target='_blank' title="{% trans 'Export as CSV - ' %}{{name}}">{{name}}</a>
- {% endfor %}
- {% else %}
- <a class="btn btn-secondary {{sname}}-csv" href="{{source}}csv" target="_blank" title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a>
- {% endif %}
+ <div class="btn-group btn-group-sm" role="group">
+ <button id="export-{{name}}" type="button"
+ class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ {% trans 'Export'%}
+ </button>
+ <div class="dropdown-menu" aria-labelledby="export-{{name}}">
+ {% if source_full or extra_sources %}
+ <a class="dropdown-item {{sname}}-csv" href='{{source}}csv' target='_blank'
+ title="{% trans 'Export as CSV - ' %}{% trans 'simple'%}">{% trans "Simple CSV" %}</a>
+ {% if source_full %}<a class='dropdown-item {{sname}}-csv-full' 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="dropdown-item {{slug}}-csv-full" href='{{extra_source}}csv' target='_blank' title="{% trans 'Export as CSV - ' %}{{name}}">{{name}}</a>
+ {% endfor %}
+ {% else %}
+ <a class="dropdown-item {{sname}}-csv" href="{{source}}csv" target="_blank" title="{% trans 'Export as CSV' %}">{% trans "CSV" %}</a>
+ {% endif %}
+ </div>
</div>
+ {% if current_model.has_label_templates %}<div class="btn-group btn-group-sm" role="group">
+ <button id="export-labels-{{name}}" type="button"
+ class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"
+ aria-haspopup="true" aria-expanded="false">
+ {% trans 'Labels'%}
+ </button>
+ <div class="dropdown-menu" aria-labelledby="export-labels-{{name}}">
+ {% for template in current_model.label_templates %}
+ <a class="dropdown-item {{template.slug}}-labels" href="{{template.get_baselink_for_labels}}" target="_blank" title="{{template.name}}">
+ {{template.name}}
+ </a>
+ {% endfor %}
+ </div>
+ </div>{% endif %}
</div>
</div>
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;
};