diff --git a/app/assets/javascripts/controllers/admin/statistics.coffee.erb b/app/assets/javascripts/controllers/admin/statistics.coffee.erb index d9b5f058f..32c06e1d4 100644 --- a/app/assets/javascripts/controllers/admin/statistics.coffee.erb +++ b/app/assets/javascripts/controllers/admin/statistics.coffee.erb @@ -291,10 +291,12 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state", # export requested if info.type == 'current' custom = buildCustomFilterQuery() - Export.stats $scope.selectedIndex.es_type_key, - buildElasticDataQuery($scope.type.active.key, custom, $scope.agePicker.start, $scope.agePicker.end, moment($scope.datePickerStart.selected), moment($scope.datePickerEnd.selected), $scope.sorting) + $scope.exportUrl = '/stats/'+$scope.selectedIndex.es_type_key+'/export' + $scope.exportQuery = buildElasticDataQuery($scope.type.active.key, custom, $scope.agePicker.start, $scope.agePicker.end, moment($scope.datePickerStart.selected), moment($scope.datePickerEnd.selected), $scope.sorting) + angular.element('#export-stats').submit() else if info.type == 'global' - Export.stats 'global', + $scope.exportUrl = '/stats/global/export' + $scope.exportQuery = "query": "bool": "must": [ @@ -305,6 +307,7 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state", "lte": moment(info.dates.end).format() } ] + angular.element('#export-stats').submit() diff --git a/app/assets/templates/admin/statistics/index.html.erb b/app/assets/templates/admin/statistics/index.html.erb index 39a104fb7..2d6696d84 100644 --- a/app/assets/templates/admin/statistics/index.html.erb +++ b/app/assets/templates/admin/statistics/index.html.erb @@ -289,3 +289,7 @@ +
+ +
+ diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 669623a3c..bb3a62d1c 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -4,5 +4,4 @@ # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone -Mime::Type.register "application/vnd.ms-excel", :xls -Mime::Type.register "application/xlsx", :xlsx \ No newline at end of file +Mime::Type.register "application/vnd.ms-excel", :xls \ No newline at end of file