From a9fbbb522ecf22690c30418242996550ab2d1e33 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 6 Jan 2017 15:08:51 +0100 Subject: [PATCH] Change user import table --- openslides/core/static/css/app.css | 4 + openslides/users/static/js/users/site.js | 7 +- .../static/templates/users/user-import.html | 201 +++++++++--------- 3 files changed, 110 insertions(+), 102 deletions(-) diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index 9595f7f85..d4d8d96bf 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -1249,6 +1249,10 @@ img { padding-right: 0 !important; } +.scroll-x-container { + overflow-x: auto; +} + /* user details */ .user_details fieldset { margin-bottom: 10px; diff --git a/openslides/users/static/js/users/site.js b/openslides/users/static/js/users/site.js index 24fbec9bc..4ffdb19ed 100644 --- a/openslides/users/static/js/users/site.js +++ b/openslides/users/static/js/users/site.js @@ -963,6 +963,7 @@ angular.module('OpenSlidesApp.users.site', [ $scope.duplicates = 0; var quotionRe = /^"(.*)"$/; angular.forEach($scope.csv.result, function (user) { + user.selected = true; // title if (user.title) { user.title = user.title.replace(quotionRe, '$1'); @@ -1098,7 +1099,7 @@ angular.module('OpenSlidesApp.users.site', [ $scope.usersWillBeImported = 0; $scope.users.forEach(function(user) { - if (user.importerror || (user.duplicate && user.duplicateAction == $scope.duplicateActions[0])) { + if (!user.selected || user.importerror || (user.duplicate && user.duplicateAction == $scope.duplicateActions[0])) { $scope.usersWillNotBeImported++; } else { $scope.usersWillBeImported++; @@ -1121,7 +1122,7 @@ angular.module('OpenSlidesApp.users.site', [ // collect all needed groups and create non existing groups var groupsToCreate = []; _.forEach($scope.users, function (user) { - if (!user.importerror && user.groups.length) { + if (user.selected && !user.importerror && user.groups.length) { _.forEach(user.groupsToCreate, function (group) { // Just append groups, that are not listed yet. if (_.indexOf(groupsToCreate, group) == -1) { groupsToCreate.push(group); @@ -1147,7 +1148,7 @@ angular.module('OpenSlidesApp.users.site', [ var existingUsers = User.getAll(); _.forEach($scope.users, function (user) { - if (!user.importerror) { + if (user.selected && !user.importerror) { // Assign all groups _.forEach(user.groups, function(csvGroup) { allGroups.forEach(function (allGroup) { diff --git a/openslides/users/static/templates/users/user-import.html b/openslides/users/static/templates/users/user-import.html index 28c7db2f5..d1cef57f1 100644 --- a/openslides/users/static/templates/users/user-import.html +++ b/openslides/users/static/templates/users/user-import.html @@ -77,108 +77,111 @@

Preview

- - - - - + + +
- # - Title - Given name - Surname - Structure level - Participant number - Groups - Comment - Is active - Is present - Is committee - - 1 duplicate - {{ duplicates }} duplicates +
+ + + + + - - -
+ # + Title + Given name + Surname + Structure level + Participant number + Groups + Comment + Is active + Is present + Is committee + + 1 duplicate + {{ duplicates }} duplicates -
- - -
-
- - - - - - - - - - - {{ (currentPage - 1) * itemsPerPage + $index + 1 }} - - {{ user.title }} - - - - - {{ user.first_name }} - - - - - {{ user.last_name }} - - {{ user.structure_level }} - - {{ user.number }} - -
- {{ groupname | translate }} -
-
- - {{ groupname | translate }} -
-
- - {{ user.comment | limitTo: 30 }}{{ user.comment.length > 30 ? '...' : '' }} - - - - - - - - -
- -
+ + +
+
+ + + + + + + + + + + + {{ (currentPage - 1) * itemsPerPage + $index + 1 }} + + {{ user.title }} + + + + + {{ user.first_name }} + + + + + {{ user.last_name }} + + {{ user.structure_level }} + + {{ user.number }} + +
+ {{ groupname | translate }} +
+
+ + {{ groupname | translate }} +
+
+ + {{ user.comment | limitTo: 30 }}{{ user.comment.length > 30 ? '...' : '' }} + + + + + + + + +
+ + +
+