diff --git a/openslides/users/static/js/users/base.js b/openslides/users/static/js/users/base.js index 1c6b34a98..81ef0fac6 100644 --- a/openslides/users/static/js/users/base.js +++ b/openslides/users/static/js/users/base.js @@ -83,33 +83,39 @@ angular.module('OpenSlidesApp.users', []) }, get_short_name: function() { // should be the same as in the python user model. - var firstName = _.trim(this.first_name), + var title = _.trim(this.title), + firstName = _.trim(this.first_name), lastName = _.trim(this.last_name), - name; + name = ''; + if (title) { + name = title + ' '; + } if (firstName && lastName) { - // TODO: check config - name = [firstName, lastName].join(' '); + name += [firstName, lastName].join(' '); } else { - name = firstName || lastName || this.username; + name += firstName || lastName || this.username; } return name; }, get_full_name: function() { // should be the same as in the python user model. - var firstName = _.trim(this.first_name), + var title = _.trim(this.title), + firstName = _.trim(this.first_name), lastName = _.trim(this.last_name), structure_level = _.trim(this.structure_level), - name; + name = ''; + if (title) { + name = title + ' '; + } if (firstName && lastName) { - // TODO: check config - name = [firstName, lastName].join(' '); + name += [firstName, lastName].join(' '); } else { - name = firstName || lastName || this.username; + name += firstName || lastName || this.username; } if (structure_level) { - name = name + " (" + structure_level + ")"; + name += " (" + structure_level + ")"; } return name; },