Merge pull request #3454 from FinnStutzenstein/UserFormFix

Fixed user form for groups with ids greater than 9
This commit is contained in:
Norman Jäckel 2017-10-29 17:57:18 +01:00 committed by GitHub
commit 452ecfbbd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -1479,6 +1479,7 @@ img {
vertical-align: top; vertical-align: top;
text-align: center; text-align: center;
min-width: 40px; min-width: 40px;
overflow: hidden;
} }
#groups-table .perm-head { #groups-table .perm-head {

View File

@ -335,9 +335,8 @@ angular.module('OpenSlidesApp.users.site', [
type: 'select-multiple', type: 'select-multiple',
templateOptions: { templateOptions: {
label: gettextCatalog.getString('Groups'), label: gettextCatalog.getString('Groups'),
options: Group.getAll(), options: Group.filter({where: {id: {'>': 1}}}),
ngOptions: 'option.id as option.name | translate for option in to.options | ' + ngOptions: "option.id as option.name | translate for option in to.options | orderBy: 'id'",
'filter: {id: "!1"}',
placeholder: gettextCatalog.getString('Select or search a group ...') placeholder: gettextCatalog.getString('Select or search a group ...')
} }
}, },
@ -785,10 +784,8 @@ angular.module('OpenSlidesApp.users.site', [
'$state', '$state',
'User', 'User',
'UserForm', 'UserForm',
'Group',
'ErrorMessage', 'ErrorMessage',
function($scope, $state, User, UserForm, Group, ErrorMessage) { function($scope, $state, User, UserForm, ErrorMessage) {
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
$scope.alert = {}; $scope.alert = {};
// get all form fields // get all form fields
$scope.formFields = UserForm.getFormFields(true); $scope.formFields = UserForm.getFormFields(true);
@ -815,11 +812,9 @@ angular.module('OpenSlidesApp.users.site', [
'$state', '$state',
'User', 'User',
'UserForm', 'UserForm',
'Group',
'userId', 'userId',
'ErrorMessage', 'ErrorMessage',
function($scope, $state, User, UserForm, Group, userId, ErrorMessage) { function($scope, $state, User, UserForm, userId, ErrorMessage) {
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
$scope.alert = {}; $scope.alert = {};
// set initial values for form model by create deep copy of user object // set initial values for form model by create deep copy of user object
// so list/detail view is not updated while editing // so list/detail view is not updated while editing