diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js
index d54200919..c353f1c28 100644
--- a/openslides/users/static/js/users/site.js
+++ b/openslides/users/static/js/users/site.js
@@ -712,6 +712,23 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
$scope.clear = function () {
$scope.csv.result = null;
};
+ // download CSV example file
+ $scope.downloadCSVExample = function () {
+ var element = document.getElementById('downloadLink');
+ var csvRows = [
+ // column header line
+ ['title', 'first_name', 'last_name', 'structure_level', 'groups', 'comment', 'is_active'],
+ // example entries
+ ['Dr.', 'Max', 'Mustermann', 'Berlin', '"3,4"', 'xyz', '1'],
+ ['', 'John', 'Doe', 'Washington', '3', 'abc', '1'],
+ ['', 'Fred', 'Bloggs', 'London', '', '', ''],
+
+ ];
+ var csvString = csvRows.join("%0A");
+ element.href = 'data:text/csv;charset=utf-8,' + csvString;
+ element.download = 'users-example.csv';
+ element.target = '_blank';
+ }
}
])
diff --git a/openslides/users/static/templates/users/user-import.html b/openslides/users/static/templates/users/user-import.html
index 575eaad0b..8e316453f 100644
--- a/openslides/users/static/templates/users/user-import.html
+++ b/openslides/users/static/templates/users/user-import.html
@@ -74,9 +74,7 @@
At least first name or last name have to be filled in. All
other fields are optional and may be empty.
Only double quotes are accepted as text delimiter (no single quotes).
-
- Use the CSV example file from OpenSlides Wiki.
-
+ Download CSV example file