-
-
A CSV file will be attached and a link will be sent
+ {% if is_ready %}
+
+ {% block export_links %}
+ {% block download_link %}
+ {% if config.report_formats|length > 1 %}
+ {% if DataSets|length > 1 %}All Report Tables:{% endif %}
+
+
+ Download/show as
+
+
+
+ {% else %}
+
+ Download {{config.report_formats[config.report_formats|keys[0]]}}
+
+ {% endif %}
+ {% endblock %}
+ {% if config.mail_settings.enabled %}
+ {% block email_report_button %}
+
Email Report
+
+
+
+
+
+
+
A CSV file will be attached and a link will be sent
-
-
-
- {% endblock %}
- {% endif %}
- {% endblock %}
-
+ var data = {
+ email: $('#email-report-modal-email').val(),
+ subject: $('#email-report-modal-subject').val(),
+ message: $('#email-report-modal-message').val(),
+ url: window.location.href
+ };
+
+ $.getJSON('{{base}}/email',data,function(response) {
+ if(response && response.success) {
+ $('#email-modal').modal('hide');
+
+ //show success message
+ $('#email-report-success-message').show(300).delay(5000).hide(300);
+ }
+ else {
+ var error = (response && response.error)? response.error : "There was a problem sending the email";
+ $('#email-report-modal-alert').text(error).show(300);
+ }
+ button.button('reset');
+ })
+ .error(function() {
+ $('#email-report-modal-alert').text("There was an error while sending the email").show(300);
+ });
+
+ return false;
+ });
+ });
+
+ {% endblock %}
+ {% endif %}
+ {% endblock %}
+
- {% if config.mail_settings.enabled %}
-
- {% block email_report_success_message %}
- Email Sent Successfully
- {% endblock %}
-
+ {% if config.mail_settings.enabled %}
+
+ {% block email_report_success_message %}
+ Email Sent Successfully
+ {% endblock %}
+
+ {% endif %}
{% endif %}
diff --git a/templates/default/html/table.twig b/templates/default/html/table.twig
index b4d028aa..923b6c54 100644
--- a/templates/default/html/table.twig
+++ b/templates/default/html/table.twig
@@ -1,7 +1,31 @@
{% if not nodata %}
{% for dataset in DataSets %}
- {% if dataset.title %}
{{dataset.title}}
- {% endif %}
+ {% if dataset.title %}
{{dataset.title}} {% endif %}
+ {% if DataSets|length > 1 %}
+ {% block table_download_link %}
+ {% set dataset_id = loop.index - 1 %}
+ {% if config.report_formats|length > 1 %}
+
+
+ Download/show as
+
+
+
+ {% else %}
+
+ Download {{config.report_formats[config.report_formats|keys[0]]}}
+
+ {% endif %}
+ {% endblock %}
+ {% endif %}
{% if dataset.vertical %}